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.