public final class Dijkstra
extends java.lang.Object
Constructor and Description |
---|
Dijkstra() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Map<T,java.lang.Double> |
shortestPaths(DirectedGraph<T> graph,
T source)
Given a directed, weighted graph G and a source node s, produces the
distances from s to each other node in the graph.
|
public static <T> java.util.Map<T,java.lang.Double> shortestPaths(DirectedGraph<T> graph, T source)
graph
- The graph upon which to run Dijkstra's algorithm.source
- The source node in the graph.