Show / Hide Table of Contents

Class CyclePoppingRandomTreeAlgorithm<TVertex, TEdge>

Wilson-Propp Cycle-Popping algorithm for Random Tree Generation.

Inheritance
System.Object
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>
CyclePoppingRandomTreeAlgorithm<TVertex, TEdge>
Implements
IAlgorithm<IVertexListGraph<TVertex, TEdge>>
IComputation
IAlgorithmComponent
IVertexColorizerAlgorithm<TVertex>
ITreeBuilderAlgorithm<TVertex, TEdge>
Inherited Members
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.TryGetRootVertex(TVertex)
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.SetRootVertex(TVertex)
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.ClearRootVertex()
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.RootVertexChanged
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.OnRootVertexChanged(EventArgs)
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.GetAndAssertRootInGraph()
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.AssertRootInGraph(TVertex)
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>.Compute(TVertex)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.State
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Started
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Services
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Clean()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 Source

CyclePoppingRandomTreeAlgorithm(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

visitedGraph is null.

System.ArgumentNullException

edgeChain is null.

| Improve this Doc View Source

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

visitedGraph is null.

| Improve this Doc View Source

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

visitedGraph is null.

System.ArgumentNullException

edgeChain is null.

Properties

| Improve this Doc View Source

EdgeChain

Edge chain strategy for the random walk.

Declaration
public IMarkovEdgeChain<TVertex, TEdge> EdgeChain { get; }
Property Value
Type Description
IMarkovEdgeChain<TVertex, TEdge>
| Improve this Doc View Source

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.

| Improve this Doc View Source

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>
| Improve this Doc View Source

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 Source

GetVertexColor(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

vertex is null.

VertexNotFoundException

vertex has no associated color.

| Improve this Doc View Source

Initialize()

Called on algorithm initialization step.

Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IVertexListGraph<TVertex, TEdge>>.Initialize()
| Improve this Doc View Source

InternalCompute()

Algorithm compute step.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IVertexListGraph<TVertex, TEdge>>.InternalCompute()
| Improve this Doc View Source

RandomTree()

Runs a random tree generation.

Declaration
public void RandomTree()
| Improve this Doc View Source

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

root is null.

System.ArgumentException

root is part of VisitedGraph.

Events

| Improve this Doc View Source

ClearTreeVertex

Fired when a vertex is removed from the random tree.

Declaration
public event VertexAction<TVertex> ClearTreeVertex
Event Type
Type Description
VertexAction<TVertex>
| Improve this Doc View Source

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>
| Improve this Doc View Source

InitializeVertex

Fired when a vertex is initialized.

Declaration
public event VertexAction<TVertex> InitializeVertex
Event Type
Type Description
VertexAction<TVertex>
| Improve this Doc View Source

TreeEdge

Fired when an edge is encountered.

Declaration
public event EdgeAction<TVertex, TEdge> TreeEdge
Event Type
Type Description
EdgeAction<TVertex, TEdge>

Implements

IAlgorithm<TGraph>
IComputation
IAlgorithmComponent
IVertexColorizerAlgorithm<TVertex>
ITreeBuilderAlgorithm<TVertex, TEdge>

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • CyclePoppingRandomTreeAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>, IMarkovEdgeChain<TVertex, TEdge>)
    • CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge>)
    • CyclePoppingRandomTreeAlgorithm(IVertexListGraph<TVertex, TEdge>, IMarkovEdgeChain<TVertex, TEdge>)
  • Properties
    • EdgeChain
    • Rand
    • Successors
    • VerticesColors
  • Methods
    • GetVertexColor(TVertex)
    • Initialize()
    • InternalCompute()
    • RandomTree()
    • RandomTreeWithRoot(TVertex)
  • Events
    • ClearTreeVertex
    • FinishVertex
    • InitializeVertex
    • TreeEdge
  • Implements
  • Extension Methods
Back to top QuikGraph