Show / Hide Table of Contents

Class TarjanOfflineLeastCommonAncestorAlgorithm<TVertex, TEdge>

Offline least common ancestor in a rooted tree.

Inheritance
System.Object
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>
RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>
TarjanOfflineLeastCommonAncestorAlgorithm<TVertex, TEdge>
Implements
IAlgorithm<IVertexListGraph<TVertex, TEdge>>
IComputation
IAlgorithmComponent
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
Assembly: QuikGraph.dll
Syntax
public sealed class TarjanOfflineLeastCommonAncestorAlgorithm<TVertex, TEdge> : RootedAlgorithmBase<TVertex, IVertexListGraph<TVertex, TEdge>>, IAlgorithm<IVertexListGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Remarks

Reference: Gabow, H. N. and Tarjan, R. E. 1983. A linear-time algorithm for a special case of disjoint set union. In Proceedings of the Fifteenth Annual ACM Symposium on theory of Computing STOC '83. ACM, New York, NY, 246-251. DOI= http://doi.acm.org/10.1145/800061.808753

Constructors

| Improve this Doc View Source

TarjanOfflineLeastCommonAncestorAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>)

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

Declaration
public TarjanOfflineLeastCommonAncestorAlgorithm(IAlgorithmComponent host, IVertexListGraph<TVertex, TEdge> visitedGraph)
Parameters
Type Name Description
IAlgorithmComponent host

Host to use if set, otherwise use this reference.

IVertexListGraph<TVertex, TEdge> visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

| Improve this Doc View Source

TarjanOfflineLeastCommonAncestorAlgorithm(IVertexListGraph<TVertex, TEdge>)

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

Declaration
public TarjanOfflineLeastCommonAncestorAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph)
Parameters
Type Name Description
IVertexListGraph<TVertex, TEdge> visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

Properties

| Improve this Doc View Source

Ancestors

Ancestors of vertices pairs.

Declaration
public IDictionary<SEquatableEdge<TVertex>, TVertex> Ancestors { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<SEquatableEdge<TVertex>, TVertex>

Methods

| Improve this Doc View Source

Compute(TVertex, IEnumerable<SEquatableEdge<TVertex>>)

Runs the algorithm with the given root vertex and set of vertices pairs.

Declaration
public void Compute(TVertex root, IEnumerable<SEquatableEdge<TVertex>> pairs)
Parameters
Type Name Description
TVertex root

Root vertex.

System.Collections.Generic.IEnumerable<SEquatableEdge<TVertex>> pairs

Vertices pairs.

Exceptions
Type Condition
System.ArgumentNullException

root is null.

System.ArgumentNullException

pairs is null.

System.ArgumentException

root is not part of VisitedGraph.

System.ArgumentException

pairs is empty or any vertex from pairs is not part of VisitedGraph.

| 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

SetVertexPairs(IEnumerable<SEquatableEdge<TVertex>>)

Sets vertices pairs.

Declaration
public void SetVertexPairs(IEnumerable<SEquatableEdge<TVertex>> pairs)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<SEquatableEdge<TVertex>> pairs

Vertices pairs.

Exceptions
Type Condition
System.ArgumentNullException

pairs is null.

System.ArgumentException

pairs is empty or any vertex from pairs is not part of VisitedGraph.

| Improve this Doc View Source

TryGetVertexPairs(out IEnumerable<SEquatableEdge<TVertex>>)

Tries to get vertices pairs if set.

Declaration
public bool TryGetVertexPairs(out IEnumerable<SEquatableEdge<TVertex>> pairs)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<SEquatableEdge<TVertex>> pairs

Vertices pairs if set.

Returns
Type Description
System.Boolean

True if vertex pairs were set, false otherwise.

Implements

IAlgorithm<TGraph>
IComputation
IAlgorithmComponent

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