Need Help about BFS

Topics: algorithm
Jun 16, 2008 at 10:57 PM
Hi,
I am using QuickGraph library to implement a graph of states of a robot. I use the state of the robot as a Vertex and the control I give to the robot as a tag in an Edge.
I need help in using BFS since I am new in using this library. I need a way to give a starting state and a finish state and use BFS to find the quickest (least states between start and finish) route.
Is there a way to have BFS give me a list of edges so I can extract the commands from them?

Thanks in advance,
Coordinator
Aug 26, 2008 at 5:20 PM

Attach a EdgeRecorderObserver to the BFS instance, it will record the tree edges in a list.

Note that you might want to use a shortest path algorithm to get the shortest path from one command to the other.