|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.mhhe.clrs2e.AllPairsShortestPaths
Abstract class for computing all-pairs shortest paths.
| Constructor Summary | |
AllPairsShortestPaths()
|
|
| Method Summary | |
abstract double[][] |
computeShortestPaths(com.mhhe.clrs2e.WeightedAdjacencyMatrixGraph g)
Computes all-pairs shortest paths. |
protected double[][] |
graphToMatrix(com.mhhe.clrs2e.WeightedAdjacencyMatrixGraph g)
Converts a WeightedAdjacencyMatrixGraph to a matrix of
edge weights. |
static void |
printMatrix(boolean[][] matrix)
Prints out a 2-dimensional array of boolean as 0s
and 1s. |
static void |
printMatrix(double[][] matrix)
Prints out a 2-dimensional array of double. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AllPairsShortestPaths()
| Method Detail |
public abstract double[][] computeShortestPaths(com.mhhe.clrs2e.WeightedAdjacencyMatrixGraph g)
g - A weighted graph represented as an adjacency matrix.
protected double[][] graphToMatrix(com.mhhe.clrs2e.WeightedAdjacencyMatrixGraph g)
WeightedAdjacencyMatrixGraph to a matrix of
edge weights.
g - A weighted graph represented as an adjacency matrix.
public static void printMatrix(double[][] matrix)
double.
matrix - The array to print.public static void printMatrix(boolean[][] matrix)
boolean as 0s
and 1s.
matrix - The array to print.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||