Interface IShortestDistanceTreeFinder
An algorithm that, given a start vertex on a weighted directed graph, finds the shortest distance from the start to any other vertex in the graph, and a path for each vertex of the graph having such a total distance.
Namespace: MoreStructures.Graphs.ShortestDistanceTree
Assembly: MoreStructures.dll
Syntax
public interface IShortestDistanceTreeFinder
Remarks
It differs from IShortestDistanceFinder and its implementation in this class of
algorithms finds the shortest distance from all vertices of the graph, whereas
IShortestDistanceFinder algorithms find the distance between the provided couple of
vertices only.
IShortestDistanceFinder implementations can provide the best performance when the
shortest distance search is between two fixed points.
If shortest distance has to be found from (or to) a given vertex to any other vertex, the class of algorithms
implementing IShortestDistanceTreeFinder can provide better performance, since all distances are
computed in a single execution of the algorithm.
Methods
| Improve this Doc View SourceFindTree(IGraph, IGraphDistances, Int32)
Finds the shortest distance and path in the provided graph
from the start
vertex to each vertex of the graph
, i.e. a path such that the sum of distances of all the
edges on the path is non-bigger than the one of any other path from the provided start
to
the vertex.
Declaration
BestPreviouses FindTree(IGraph graph, IGraphDistances distances, int start)
Parameters
Type | Name | Description |
---|---|---|
IGraph | graph | The graph to traverse. |
IGraphDistances | distances | A map between each edge of |
System.Int32 | start | The id of the vertex, to start traversal from. |
Returns
Type | Description |
---|---|
BestPreviouses | A BestPreviouses instance, wrapping a dictionary, mapping:
|