Show / Hide Table of Contents

Class BreadthFirst<T>

A graph solver which exhaustively searches a graph by only considering the distance searched so far.

Inheritance
System.Object
SolverBase<T>
BreadthFirst<T>
Implements
IGraphSolver<T>
IComparer<PathFinder.Solvers.Generic.GraphNodeMetaData<T>>
Inherited Members
SolverBase<T>.Open
SolverBase<T>.Closed
SolverBase<T>.OpenCount
SolverBase<T>.ClosedCount
SolverBase<T>.Current
SolverBase<T>.PathCost
SolverBase<T>.State
SolverBase<T>.Ticks
SolverBase<T>.Origin
SolverBase<T>.Destination
SolverBase<T>.Path
SolverBase<T>.CurrentBestPath
SolverBase<T>.MaxTicks
SolverBase<T>.Stop()
SolverBase<T>.Run(Int32)
Namespace: PathFinder.Solvers.Generic
Assembly: PathFinder.dll
Syntax
public sealed class BreadthFirst<T> : SolverBase<T>, IGraphSolver<T>, IComparer<GraphNodeMetaData<T>> where T : IEquatable<T>
Type Parameters
Name Description
T

The type of nodes to traverse. Must extend ITraversableNode<T> if traverser is null.

Remarks

Useful in cases in which a estimation function is not possible or wildly inaccurate.

Constructors

| Improve this Doc View Source

BreadthFirst(T, T, INodeTraverser<T>)

Creates a solver using the Breadth First method.

Declaration
public BreadthFirst(T origin, T destination, INodeTraverser<T> traverser = null)
Parameters
Type Name Description
T origin

Origin

T destination

Destination

INodeTraverser<T> traverser

The INodeTraverser<T> implementation to use when traversing the graph

-or-

null to use the ITraversableNode<T> implementation on each node.

Methods

| Improve this Doc View Source

Solve(T, T, out IList<T>, INodeTraverser<T>, Int32)

Finds a path between the origin and destination node using the Breadth First method.

Declaration
public static SolverState Solve(T origin, T destination, out IList<T> path, INodeTraverser<T> traverser = null, int maxTicks = 1000000)
Parameters
Type Name Description
T origin

Origin

T destination

Destination

IList<T> path

The resulting path if Success, otherwise null

INodeTraverser<T> traverser

The INodeTraverser<T> implementation to use when traversing the graph

-or-

null to use the ITraversableNode<T> implementation on each node.

System.Int32 maxTicks

The maximum number of ticks to run before failing.

Returns
Type Description
SolverState

The SolverState of the solver after running.

Implements

IGraphSolver<T>
IComparer<>
  • Improve this Doc
  • View Source
☀
☾
Back to top Generated by DocFX