0

I am attempting to solve Traveling Salesman problem and I dont understand step 3. What is that "preorder walk"? I recall there was such a thing as preorder walk over trees but Kruskals algorithm which I picked produces a directed graph, not a tree.

https://www.geeksforgeeks.org/travelling-salesman-problem-set-2-approximate-using-mst/

Algorithm:

  1. Let 1 be the starting and ending point for salesman.
  2. Construct MST from with 1 as root using Prim’s Algorithm.
  3. List vertices visited in preorder walk of the constructed MST and add 1 at the end.
ArekBulski
  • 4,520
  • 4
  • 39
  • 61

1 Answers1

0

Ah silly me. I misunderstood how Kruskal's algo works. Found edges should be added both ways so Kruskal's produces a non-directed graph, a tree. A tree is traversable in pre-order.

ArekBulski
  • 4,520
  • 4
  • 39
  • 61