3
$\begingroup$

I can solve a travelling salesman problem with FindShortestTour[], but couldn't find any function to solve a shorest tour problem with additional constraints like cost, fuel capacity etc. How cam I incorporate such constraints in Mathematica?

thanks in advance

$\endgroup$

closed as off-topic by MarcoB, user9660, m_goldberg, Yves Klett, LLlAMnYP Jun 10 '16 at 13:11

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Yves Klett, LLlAMnYP
  • "The question is out of scope for this site. The answer to this question requires either advice from Wolfram support or the services of a professional consultant." – MarcoB, Community, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ If the argument to FindShortestTour is a Graph object, then the function will automatically select GraphDistance as the distance function. In turn, GraphDistance will take edge weights into consideration for weighted graphs, so I think you should be able to impose constraints and external conditions by translating them into appropriate edge weights, imagined as "costs" of the trip between two vertices. $\endgroup$ – MarcoB Jun 2 '16 at 4:53
  • $\begingroup$ Sure but I am talking about multiple constraints imposed simultaneously i.e. edges having 2-3 weightings at the same time. $\endgroup$ – user40405 Jun 2 '16 at 8:57
  • 5
    $\begingroup$ If you could add a more detailed description of your task and sample data/code, that might help. $\endgroup$ – Yves Klett Jun 2 '16 at 9:47
  • $\begingroup$ There are several stations/nodes that you have to visit only once and come back using the shortest possible route. Distances between nodes are known. FindShortestTour[] function solves the problem. So far so good. But suppose cost of travel between each node is given amd you have to optimize both distance and cost. Now which Mathematica function should I use? $\endgroup$ – user40405 Jun 2 '16 at 14:47
  • $\begingroup$ As you may guess, optimizing either for cost or for distance will give different solutions and you will have to balance between the two. Now you need to compute the edge weights of a graph as a function of both cost and distance and it's up to you, as to how to balance between the two of them. $\endgroup$ – LLlAMnYP Jun 10 '16 at 13:10