Reputation: 510
Each node in the above graph has been numbered.
I am trying to find the graph traversal algorithm that can be used to number the graph in this order. Appreciate if anyone can suggest an algorithm that can number them in the above order
Upvotes: -1
Views: 49
Reputation: 59134
The order you give is consistent with a topological sort using Kahn's algorithm.
To get exactly the order you specify, when the algorithm chooses between multiple nodes that are available simultaneously, you have to choose the one with the highest BB label.
Upvotes: 0