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$
5
  • $\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, 2016 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, 2016 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, 2016 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, 2016 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, 2016 at 13:10

0

Browse other questions tagged or ask your own question.