some java code to get average shortest path and diameter of a network 03-07-2014d1702 public double calculateAverageShortestPathLength(Graph graph) { calculateAverageShortestPathLengthAndDiameter(graph); return average_path_length; } public double calculateDiameter(Graph graph) { calculateAverageShortestPathLengthAndDiameter(graph); return diameter; } public void calculateAverageShortestPathLengthAndDiameter(Graph graph) { if(average_path_length_and_diameter_calculated==false) { FloydWarshallShortestPaths shortest_paths = new FloydWarshallShortestPaths(graph); Collection c = shortest_paths.getShortestPaths(); Object[] o = c.toArray(); int sum = 0; int count = 0; for(int i=0; i