Class FloydWarshall
java.lang.Object
org.cloudsimplus.network.FloydWarshall
An implementation of the Floyd-Warshall algorithm
to calculate the predecessor matrix and the delay between all pairs of nodes in a network.
The delay represents the distance between the two vertices,
working as the weight for the Floyd-Warshall algorithm.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Rahul Simha, Weishuai Yang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]computeShortestPaths(double[][] originalDelayMatrix) Computes the shortest path between a vertex to all the other ones, for all existing vertices.int[][]getPk()
-
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 every pair of vertices.- Parameters:
originalDelayMatrix- original delay matrix- Returns:
- the new delay matrix (dk)
-
getPk
public int[][] getPk()- Returns:
- a copy of the predecessor matrix.
-