title: how to visit each point in directed graph
body: <p>In Prolog, how can I implement graph algorithm in order to find all path in order to implement travel salesman problem in directed graph ?</p>
  
  <p>example : </p>
  
  <pre><code>                                                                         graph
                      expected input     expected output                 X -----&gt; Y
      start X             X  Y               X Z                         Y -----&gt; T
      end   Z             Y  T               X Y Z                       T -----&gt; Z
                          T  Z               X Y T Z                     Y -----&gt; Z
                          Y  Z                                           X -----&gt; Z
                          X  Z
  </code></pre>
  
  <p>As you know, in directed graph, there could be a cycle. However, no need to pass same point two times. </p>
  
  <pre><code>             graph             expected output             
             X ----&gt; Y            
             Y ----&gt; X               X Y Z
             Y ----&gt; Z 
  </code></pre>
  
  <p>Why I am elimineting this case is because ;</p>
  
  <pre><code>      output :
  
        X Y X Y ...   Z
                ^^^
                god knows this length ( when program terminates )
                termination is np problem
  </code></pre>