Class CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge>
Algorithm that explores a graph starting from a given vertex.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph.Algorithms.Exploration
Assembly: QuikGraph.dll
Syntax
public sealed class CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge> : RootedAlgorithmBase<TVertex, IMutableVertexAndEdgeSet<TVertex, TEdge>>, IAlgorithm<IMutableVertexAndEdgeSet<TVertex, TEdge>>, IComputation, IAlgorithmComponent, ITreeBuilderAlgorithm<TVertex, TEdge> where TVertex : ICloneable where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceCloneableVertexGraphExplorerAlgorithm(IAlgorithmComponent, IMutableVertexAndEdgeSet<TVertex, TEdge>)
Initializes a new instance of the CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge> class.
Declaration
public CloneableVertexGraphExplorerAlgorithm(IAlgorithmComponent host, IMutableVertexAndEdgeSet<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IMutableVertexAndEdgeSet<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
CloneableVertexGraphExplorerAlgorithm(IMutableVertexAndEdgeSet<TVertex, TEdge>)
Initializes a new instance of the CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge> class.
Declaration
public CloneableVertexGraphExplorerAlgorithm(IMutableVertexAndEdgeSet<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IMutableVertexAndEdgeSet<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceAddEdgePredicate
Predicate that an edge must match to be added in the graph.
Declaration
public EdgePredicate<TVertex, TEdge> AddEdgePredicate { get; set; }
Property Value
Type | Description |
---|---|
EdgePredicate<TVertex, TEdge> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Set value is null. |
AddVertexPredicate
Predicate that a vertex must match to be added in the graph.
Declaration
public VertexPredicate<TVertex> AddVertexPredicate { get; set; }
Property Value
Type | Description |
---|---|
VertexPredicate<TVertex> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Set value is null. |
ExploreVertexPredicate
Predicate that checks if a given vertex should be explored or ignored.
Declaration
public VertexPredicate<TVertex> ExploreVertexPredicate { get; set; }
Property Value
Type | Description |
---|---|
VertexPredicate<TVertex> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Set value is null. |
FinishedPredicate
Predicate that checks if the exploration is finished or not.
Declaration
public Predicate<CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge>> FinishedPredicate { get; set; }
Property Value
Type | Description |
---|---|
System.Predicate<CloneableVertexGraphExplorerAlgorithm<TVertex, TEdge>> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Set value is null. |
FinishedSuccessfully
Indicates if the algorithm finished successfully or not.
Declaration
public bool FinishedSuccessfully { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
UnExploredVertices
Gets the enumeration of unexplored vertices.
Declaration
public IEnumerable<TVertex> UnExploredVertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TVertex> |
Methods
| Improve this Doc View SourceAddTransitionFactories(IEnumerable<ITransitionFactory<TVertex, TEdge>>)
Adds new ITransitionFactory<TVertex, TEdge>s to this algorithm.
Declaration
public void AddTransitionFactories(IEnumerable<ITransitionFactory<TVertex, TEdge>> transitionFactories)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ITransitionFactory<TVertex, TEdge>> | transitionFactories | Transition factories to add. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
AddTransitionFactory(ITransitionFactory<TVertex, TEdge>)
Adds a new ITransitionFactory<TVertex, TEdge> to this algorithm.
Declaration
public void AddTransitionFactory(ITransitionFactory<TVertex, TEdge> transitionFactory)
Parameters
Type | Name | Description |
---|---|---|
ITransitionFactory<TVertex, TEdge> | transitionFactory | Transition factory to add. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ClearTransitionFactories()
Clears all ITransitionFactory<TVertex, TEdge> from this algorithm.
Declaration
public void ClearTransitionFactories()
Compute(TVertex)
Runs the algorithm with the given root
vertex.
Declaration
public override void Compute(TVertex root)
Parameters
Type | Name | Description |
---|---|---|
TVertex | root | Root vertex. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
System.InvalidOperationException | Something went wrong when running the algorithm. |
ContainsTransitionFactory(ITransitionFactory<TVertex, TEdge>)
Checks if this algorithm contains the given transitionFactory
.
Declaration
public bool ContainsTransitionFactory(ITransitionFactory<TVertex, TEdge> transitionFactory)
Parameters
Type | Name | Description |
---|---|---|
ITransitionFactory<TVertex, TEdge> | transitionFactory | Transition factory to check. |
Returns
Type | Description |
---|---|
System.Boolean |
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
RemoveTransitionFactory(ITransitionFactory<TVertex, TEdge>)
Removes the given transitionFactory
from this algorithm.
Declaration
public bool RemoveTransitionFactory(ITransitionFactory<TVertex, TEdge> transitionFactory)
Parameters
Type | Name | Description |
---|---|---|
ITransitionFactory<TVertex, TEdge> | transitionFactory | Transition factory to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
Events
| Improve this Doc View SourceBackEdge
Fired when a back edge is encountered.
Declaration
public event EdgeAction<TVertex, TEdge> BackEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
DiscoverVertex
Fired when a vertex is discovered.
Declaration
public event VertexAction<TVertex> DiscoverVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
EdgeSkipped
Fired when an edge was skipped from exploration due to failed vertex or edge predicate check.
Declaration
public event EdgeAction<TVertex, TEdge> EdgeSkipped
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
TreeEdge
Fired when an edge is encountered.
Declaration
public event EdgeAction<TVertex, TEdge> TreeEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |