Show / Hide Table of Contents

Class Dijkstra

Implements Dijkstra's algorithm for finding shortest paths from a given node to all the other nodes in a graph.

Inheritance
System.Object
Dijkstra
Inherited Members
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: AlgorithmsAndDataStructures.Algorithms.GraphTraversal
Assembly: AlgorithmsAndDataStructures.dll
Syntax
public class Dijkstra

Methods

| Improve this Doc View Source

GetShortestDistancesFromRoot<TValue>(GraphNode<TValue>)

Implements Dijkstra's ShortestPath algorithm using MinBinaryHeap<TKey, TValue>.

Declaration
[Algorithm(AlgorithmType.GraphRouteSearch, "Dijkstra's shortest path", IsGreedy = true)]
[SpaceComplexity("O(3V)", false, InPlace = false)]
[TimeComplexity(Case.Average, "O((E+V)Log(V))")]
public static List<GraphNode<TValue>> GetShortestDistancesFromRoot<TValue>(GraphNode<TValue> startNode)
Parameters
Type Name Description
GraphNode<TValue> startNode

A node from which shortest paths to all the other nodes in the graph are computed.

Returns
Type Description
System.Collections.Generic.List<GraphNode<TValue>>

All the nodes in the graph, in the order visited with their shortest distance computed from startNode.

Type Parameters
Name Description
TValue
  • Improve this Doc
  • View Source
Back to top Generated by DocFX