Show / Hide Table of Contents

Class PrimMinimumSpanningTreeAlgorithm<TVertex, TEdge>

Prim minimum spanning tree algorithm implementation.

Inheritance
System.Object
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>
PrimMinimumSpanningTreeAlgorithm<TVertex, TEdge>
Implements
IAlgorithmComponent
IMinimumSpanningTreeAlgorithm<TVertex, TEdge>
IAlgorithm<IUndirectedGraph<TVertex, TEdge>>
IComputation
ITreeBuilderAlgorithm<TVertex, TEdge>
Inherited Members
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.State
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Started
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Services
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IUndirectedGraph<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.MinimumSpanningTree
Assembly: QuikGraph.dll
Syntax
public sealed class PrimMinimumSpanningTreeAlgorithm<TVertex, TEdge> : AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>, IAlgorithmComponent, IMinimumSpanningTreeAlgorithm<TVertex, TEdge>, IAlgorithm<IUndirectedGraph<TVertex, TEdge>>, IComputation, ITreeBuilderAlgorithm<TVertex, TEdge> where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Constructors

| Improve this Doc View Source

PrimMinimumSpanningTreeAlgorithm(IAlgorithmComponent, IUndirectedGraph<TVertex, TEdge>, Func<TEdge, Double>)

Initializes a new instance of the PrimMinimumSpanningTreeAlgorithm<TVertex, TEdge> class.

Declaration
public PrimMinimumSpanningTreeAlgorithm(IAlgorithmComponent host, IUndirectedGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> edgeWeights)
Parameters
Type Name Description
IAlgorithmComponent host

Host to use if set, otherwise use this reference.

IUndirectedGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Func<TEdge, System.Double> edgeWeights

Function that computes the weight for a given edge.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

edgeWeights is null.

| Improve this Doc View Source

PrimMinimumSpanningTreeAlgorithm(IUndirectedGraph<TVertex, TEdge>, Func<TEdge, Double>)

Initializes a new instance of the PrimMinimumSpanningTreeAlgorithm<TVertex, TEdge> class.

Declaration
public PrimMinimumSpanningTreeAlgorithm(IUndirectedGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> edgeWeights)
Parameters
Type Name Description
IUndirectedGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Func<TEdge, System.Double> edgeWeights

Function that computes the weight for a given edge.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

edgeWeights is null.

Methods

| Improve this Doc View Source

Initialize()

Called on algorithm initialization step.

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

InternalCompute()

Algorithm compute step.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IUndirectedGraph<TVertex, TEdge>>.InternalCompute()

Events

| Improve this Doc View Source

ExamineEdge

Fired when an edge is going to be analyzed.

Declaration
public event EdgeAction<TVertex, TEdge> ExamineEdge
Event Type
Type Description
EdgeAction<TVertex, TEdge>
| 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

IAlgorithmComponent
IMinimumSpanningTreeAlgorithm<TVertex, TEdge>
IAlgorithm<TGraph>
IComputation
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
Back to top QuikGraph