Richard, QuickGraph does not do any of this for you, it only makes available events that you can subscribe to. By subscribing to these events, you can respond accordingly. From the admittedly missing QuickGraph documentation on Depth First Search (yes, I understand that you are doing BFS, not DFS, but the concept of how to subscribe to events is the same):
- InitializeVertex, called at each vertex before starting the calculation,
- DiscoverVertex, called when the vertex is first encountered,
- ExamineEdge called at each outer end of each vertex after it is detected,
- TreeEdge is called on each edge when it becomes a member of the edges that form the search tree.
- FinishVertex is called at the vertex after all of its outer edges have been added to the search tree and all adjacent vertices have been detected (but before their outer edges have been checked).
By the way, open Reflector and take a look at QuickGraph.Algorithms.Observers. And your shortest path would be easier with a different method than BFS.
Kylem source share