Class CyclePoppingRandomTreeAlgorithm<TVertex, TEdge>
Wilson-Propp Cycle-Popping algorithm for Random Tree Generation.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph.Algorithms.RandomWalks
Assembly: QuikGraph.dll
Syntax
public sealed class CyclePoppingRandomTreeAlgorithm<TVertex, TEdge> : RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>, IAlgorithm<IVertexListGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IVertexColorizerAlgorithm<TVertex>, ITreeBuilderAlgorithm<TVertex, TEdge> where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceCyclePoppingRandomTreeAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>, IMarkovEdgeChain<TVertex, TEdge>)
Initializes a new instance of the CyclePoppingRandomTreeAlgorithm<TVertex, TEdge> class.
Declaration
public CyclePoppingRandomTreeAlgorithm(IAlgorithmComponent host, IVertexListGraph<TVertex, TEdge> visitedGraph, IMarkovEdgeChain<TVertex, TEdge> edgeChain)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
IMarkovEdgeChain<TVertex, TEdge> | edgeChain | Edge chain strategy to use. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge>)
Initializes a new instance of the CyclePoppingRandomTreeAlgorithm<TVertex, TEdge> class.
Declaration
public CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge>, IMarkovEdgeChain<TVertex, TEdge>)
Initializes a new instance of the CyclePoppingRandomTreeAlgorithm<TVertex, TEdge> class.
Declaration
public CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph, IMarkovEdgeChain<TVertex, TEdge> edgeChain)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
IMarkovEdgeChain<TVertex, TEdge> | edgeChain | Edge chain strategy to use. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceEdgeChain
Edge chain strategy for the random walk.
Declaration
public IMarkovEdgeChain<TVertex, TEdge> EdgeChain { get; }
Property Value
Type | Description |
---|---|
IMarkovEdgeChain<TVertex, TEdge> |
Rand
Gets or sets the random number generator used in RandomTree().
Declaration
public Random Rand { get; set; }
Property Value
Type | Description |
---|---|
System.Random |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Set value is null. |
Successors
Map vertices associated to their edge successors.
Declaration
public IDictionary<TVertex, TEdge> Successors { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TVertex, TEdge> |
VerticesColors
Stores vertices associated to their colors (treatment state).
Declaration
public IDictionary<TVertex, GraphColor> VerticesColors { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TVertex, GraphColor> |
Methods
| Improve this Doc View SourceGetVertexColor(TVertex)
Gets the GraphColor associated to the given vertex
.
Declaration
public GraphColor GetVertexColor(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
GraphColor | The vertex GraphColor. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
VertexNotFoundException |
|
Initialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
RandomTree()
Runs a random tree generation.
Declaration
public void RandomTree()
RandomTreeWithRoot(TVertex)
Runs a random tree generation starting at root
vertex.
Declaration
public void RandomTreeWithRoot(TVertex root)
Parameters
Type | Name | Description |
---|---|---|
TVertex | root | Tree starting vertex. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
Events
| Improve this Doc View SourceClearTreeVertex
Fired when a vertex is removed from the random tree.
Declaration
public event VertexAction<TVertex> ClearTreeVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
FinishVertex
Fired when a vertex is treated and considered as in the random tree.
Declaration
public event VertexAction<TVertex> FinishVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
InitializeVertex
Fired when a vertex is initialized.
Declaration
public event VertexAction<TVertex> InitializeVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
TreeEdge
Fired when an edge is encountered.
Declaration
public event EdgeAction<TVertex, TEdge> TreeEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |