Visitor that computes the vertices predecessors.
Namespace:
QuickGraph.Algorithms.VisitorsAssembly: QuickGraph.Algorithms (in QuickGraph.Algorithms.dll) Version: 2.4.2.1514 (2.4.2.1514)
Syntax
| C# |
|---|
public class PredecessorRecorderVisitor : IPredecessorRecorderVisitor |
| Visual Basic (Declaration) |
|---|
Public Class PredecessorRecorderVisitor _ Implements IPredecessorRecorderVisitor |
Remarks
The visitor applies to any algorithm that implements the
model.
Examples
This sample shows how to use the find the predecessor map using a
:
CopyC#
Graph g = ...; // creating dfs algorithm DepthFirstSearchAlgorithm dfs = new DepthFirstSearchAlgorithm(g); // creating predecessor visitor PredecessorVisitor pred = new PredecessorVisitor(); // registering event handlers pred.RegisterHandlers(dfs); //executing... dfs.Compute(); // pred.Predecessors now contains the map of predecessors.
