Show / Hide Table of Contents

Class RootedSearchAlgorithmBase<TVertex, TGraph>

Base class for all graph algorithm performing a search in a graph.

Inheritance
System.Object
AlgorithmBase<TGraph>
RootedAlgorithmBase<TVertex, TGraph>
RootedSearchAlgorithmBase<TVertex, TGraph>
BestFirstFrontierSearchAlgorithm<TVertex, TEdge>
Implements
IAlgorithm<TGraph>
IComputation
IAlgorithmComponent
Inherited Members
RootedAlgorithmBase<TVertex, TGraph>.TryGetRootVertex(TVertex)
RootedAlgorithmBase<TVertex, TGraph>.SetRootVertex(TVertex)
RootedAlgorithmBase<TVertex, TGraph>.ClearRootVertex()
RootedAlgorithmBase<TVertex, TGraph>.RootVertexChanged
RootedAlgorithmBase<TVertex, TGraph>.OnRootVertexChanged(EventArgs)
RootedAlgorithmBase<TVertex, TGraph>.GetAndAssertRootInGraph()
RootedAlgorithmBase<TVertex, TGraph>.AssertRootInGraph(TVertex)
RootedAlgorithmBase<TVertex, TGraph>.Compute(TVertex)
AlgorithmBase<TGraph>.SyncRoot
AlgorithmBase<TGraph>.State
AlgorithmBase<TGraph>.Compute()
AlgorithmBase<TGraph>.Abort()
AlgorithmBase<TGraph>.StateChanged
AlgorithmBase<TGraph>.OnStateChanged(EventArgs)
AlgorithmBase<TGraph>.Started
AlgorithmBase<TGraph>.OnStarted(EventArgs)
AlgorithmBase<TGraph>.Finished
AlgorithmBase<TGraph>.OnFinished(EventArgs)
AlgorithmBase<TGraph>.Aborted
AlgorithmBase<TGraph>.OnAborted(EventArgs)
AlgorithmBase<TGraph>.VisitedGraph
AlgorithmBase<TGraph>.Services
AlgorithmBase<TGraph>.GetService<T>()
AlgorithmBase<TGraph>.TryGetService<T>(T)
AlgorithmBase<TGraph>.TryGetService(Type, Object)
AlgorithmBase<TGraph>.ThrowIfCancellationRequested()
AlgorithmBase<TGraph>.Initialize()
AlgorithmBase<TGraph>.InternalCompute()
AlgorithmBase<TGraph>.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
[Serializable]
public abstract class RootedSearchAlgorithmBase<TVertex, TGraph> : RootedAlgorithmBase<TVertex, TGraph>, IAlgorithm<TGraph>, IComputation, IAlgorithmComponent where TGraph : IImplicitVertexSet<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TGraph

Graph type.

Remarks

Requires a starting vertex (root) and an ending vertex (target).

Constructors

| Improve this Doc View Source

RootedSearchAlgorithmBase(IAlgorithmComponent, TGraph)

Initializes a new instance of the RootedSearchAlgorithmBase<TVertex, TGraph> class.

Declaration
protected RootedSearchAlgorithmBase(IAlgorithmComponent host, TGraph visitedGraph)
Parameters
Type Name Description
IAlgorithmComponent host

Host to use if set, otherwise use this reference.

TGraph visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

Methods

| Improve this Doc View Source

ClearTargetVertex()

Clears the target vertex.

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

Compute(TVertex, TVertex)

Runs the algorithm with the given root vertex.

Declaration
public void Compute(TVertex root, TVertex target)
Parameters
Type Name Description
TVertex root

Root vertex.

TVertex target

Target vertex.

Exceptions
Type Condition
System.ArgumentNullException

root is null.

System.ArgumentNullException

target is null.

System.ArgumentException

root is not part of VisitedGraph.

System.ArgumentException

target is not part of VisitedGraph.

System.InvalidOperationException

Something went wrong when running the algorithm.

| Improve this Doc View Source

OnTargetReached()

Called when the target vertex is reached.

Declaration
protected virtual void OnTargetReached()
| Improve this Doc View Source

OnTargetVertexChanged(EventArgs)

Called on each target vertex change.

Declaration
protected virtual void OnTargetVertexChanged(EventArgs args)
Parameters
Type Name Description
System.EventArgs args

EventArgs.Empty.

| Improve this Doc View Source

SetTargetVertex(TVertex)

Sets the target vertex.

Declaration
public void SetTargetVertex(TVertex target)
Parameters
Type Name Description
TVertex target

Target vertex.

Exceptions
Type Condition
System.ArgumentNullException

target is null.

| Improve this Doc View Source

TryGetTargetVertex(out TVertex)

Tries to get the target vertex if set.

Declaration
public bool TryGetTargetVertex(out TVertex target)
Parameters
Type Name Description
TVertex target

Target vertex if set, otherwise null.

Returns
Type Description
System.Boolean

True if the target vertex was set, false otherwise.

Events

| Improve this Doc View Source

TargetReached

Fired when the target vertex is reached.

Declaration
public event EventHandler TargetReached
Event Type
Type Description
System.EventHandler
| Improve this Doc View Source

TargetVertexChanged

Fired when the target vertex is changed.

Declaration
public event EventHandler TargetVertexChanged
Event Type
Type Description
System.EventHandler

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
  • Constructors
    • RootedSearchAlgorithmBase(IAlgorithmComponent, TGraph)
  • Methods
    • ClearTargetVertex()
    • Compute(TVertex, TVertex)
    • OnTargetReached()
    • OnTargetVertexChanged(EventArgs)
    • SetTargetVertex(TVertex)
    • TryGetTargetVertex(out TVertex)
  • Events
    • TargetReached
    • TargetVertexChanged
  • Implements
  • Extension Methods
Back to top QuikGraph