Package dsa.lab11.solutions
Class DAGRelaxer
java.lang.Object
dsa.lab11.solutions.DAGRelaxer
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DAGRelaxer
public DAGRelaxer()
-
-
Method Details
-
relaxDAG
public static <Vertex> Map<Vertex,Path<Vertex, relaxDAGDouble>> (DirectedGraph<Vertex, Double> dag, Vertex source) Find the shortest (weighted) paths to each of the vertices reachable from the given source vertex in the given directed acyclic graph (DAG).The weighted distance between two vertices is the sum of the path's edges' weights. Here we consider only weights that are
double
s (e.g. 8.2).- Type Parameters:
Vertex
- the vertex type- Parameters:
dag
- the directed acyclic graphsource
- the source vertex- Returns:
- the shortest (weighted) paths to each reachable vertex and their (weighted) distances
-