0
$\begingroup$

I am looking for an algorithm to determine the best route where the groups of destinations alternate.

For example: I have three stores and three warehouses. So I would like to visit a warehouse first, then a store, then a warehouse, then a store and so on. What are some algorithms for finding the best route in these circumstances.

Parameters and Restrictions:

  • Equal number of Warehouse and Stores.
  • Each location only visited once.
$\endgroup$
  • 1
    $\begingroup$ Just run a standard traveling salesman algorithm, setting the distances between stores to infinity (meaning: to such a large number that no self-respecting traveling salesman algorithm would ever include an edge joining two stores) and likewise the distances between warehouses. $\endgroup$ – Gerry Myerson May 8 at 3:12
  • $\begingroup$ @GerryMyerson I think that deserves to be an answer rather than a comment. $\endgroup$ – LarrySnyder610 May 8 at 4:43
  • $\begingroup$ The technical term for this is the "bipartite traveling salesman problem," which turns up quite a lot of literature on the subject when Googled. $\endgroup$ – Kevin May 8 at 4:49
  • $\begingroup$ @Kevin make this a answer please $\endgroup$ – Cornel May 8 at 5:01
  • $\begingroup$ @Cornel: Stack Exchange policy is very clear: A search query is not an answer. I would have to pick one of those papers and write it up, and I lack both the technical knowledge and the institutional library access to do that. $\endgroup$ – Kevin May 8 at 5:19
1
$\begingroup$

Just run a standard traveling salesman algorithm, setting the distances between stores to infinity (meaning: to such a large number that no self-respecting traveling salesman algorithm would ever include an edge joining two stores) and likewise the distances between warehouses.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.