Package org.cloudbus.cloudsim.network
Class FloydWarshall
java.lang.Object
org.cloudbus.cloudsim.network.FloydWarshall
public class FloydWarshall extends Object
Floyd-Warshall algorithm to calculate the predecessor matrix and the delay
between all pairs of nodes. The delay represents the distance between the two vertices and it works as the weight for the Floyd-Warshall algorithm.
- Since:
- CloudSim Toolkit 1.0
- Version:
- 1.2, 6/20/2005
- Author:
- Rahul Simha, Weishuai Yang
-
Constructor Summary
Constructors Constructor Description FloydWarshall(int numVertices)
Creates a matrix of network nodes. -
Method Summary
Modifier and Type Method Description double[][]
computeShortestPaths(double[][] originalDelayMatrix)
Computes the shortest path between a vertex to all the other ones, for all existing vertices.int
getNumVertices()
int[][]
getPk()
Gets a copy of the predecessor matrix.
-
Constructor Details
-
FloydWarshall
public FloydWarshall(int numVertices)Creates a matrix of network nodes.- Parameters:
numVertices
- number of network nodes
-
-
Method Details
-
computeShortestPaths
public double[][] computeShortestPaths(double[][] originalDelayMatrix)Computes the shortest path between a vertex to all the other ones, for all existing vertices. This is represented by the delay between all pairs vertices.- Parameters:
originalDelayMatrix
- original delay matrix- Returns:
- the new delay matrix (dk)
-
getPk
public int[][] getPk()Gets a copy of the predecessor matrix.- Returns:
- the predecessor matrix copy
-
getNumVertices
public int getNumVertices()
-