how to visit each point in directed graph

后端 未结 2 925
灰色年华
灰色年华 2020-12-21 18:57

In Prolog, how can I implement graph algorithm in order to find all path in order to implement travel salesman problem in directed graph ?

example :



        
2条回答
  •  一整个雨季
    2020-12-21 19:17

    Keep a list of nodes you have already visited. In each step, check if the endpoint of the edge exists in the list or not.

提交回复
热议问题