Optimal solutions for routing problems with profits