I am trying to solve a variant of the traveling salesman problem.

In this variant, the nodes have a state which is required to go in order. Specifically, first is order food, second is give food, and third is pay. To do pay, food is required to be already handed to the table. Similarly, to give food, an order is required before on a particular table. The restaurant's tables are the nodes. The node's have a unique customer name. a. For the cost, I am using distance to walk between table's by a waitress. Notably, the distances stay the same while moved.

I am looking for any kind of algorithm, even brute force. I know Python, but pseudo code works as well.

  • $\begingroup$ Isn't it optimal to order food, give food, pay for one table, go on to another table to order food, give food, pay, and so on? $\endgroup$
    – xskxzr
    Oct 22 '21 at 6:42

Your Answer

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

Browse other questions tagged or ask your own question.