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 |
---|---|---|
IAlgorithm |
host | Host to use if set, otherwise use this reference. |
IVertex |
visitedGraph | Graph to visit. |
IMarkov |
edgeChain | Edge chain strategy to use. |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
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 |
---|---|---|
IVertex |
visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System. |
|
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 |
---|---|---|
IVertex |
visitedGraph | Graph to visit. |
IMarkov |
edgeChain | Edge chain strategy to use. |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
Properties
| Improve this Doc View SourceEdgeChain
Edge chain strategy for the random walk.
Declaration
public IMarkovEdgeChain<TVertex, TEdge> EdgeChain { get; }
Property Value
Type | Description |
---|---|
IMarkov |
Rand
Gets or sets the random number generator used in Random
Declaration
public Random Rand { get; set; }
Property Value
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
Set value is null. |
Successors
Map vertices associated to their edge successors.
Declaration
public IDictionary<TVertex, TEdge> Successors { get; }
Property Value
Type | Description |
---|---|
System. |
VerticesColors
Stores vertices associated to their colors (treatment state).
Declaration
public IDictionary<TVertex, GraphColor> VerticesColors { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceGetVertexColor(TVertex)
Gets the Graphvertex
.
Declaration
public GraphColor GetVertexColor(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
Graph |
The vertex Graph |
Exceptions
Type | Condition |
---|---|
System. |
|
Vertex |
|
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. |
|
System. |
|
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 |
---|---|
Vertex |
FinishVertex
Fired when a vertex is treated and considered as in the random tree.
Declaration
public event VertexAction<TVertex> FinishVertex
Event Type
Type | Description |
---|---|
Vertex |
InitializeVertex
Fired when a vertex is initialized.
Declaration
public event VertexAction<TVertex> InitializeVertex
Event Type
Type | Description |
---|---|
Vertex |
TreeEdge
Fired when an edge is encountered.
Declaration
public event EdgeAction<TVertex, TEdge> TreeEdge
Event Type
Type | Description |
---|---|
Edge |