// Copyright 2003, Trustees of Indiana University // Please see the license in the file ../LICENSE using GCollections; public class johnson_test { public static void Main(string[] args) { adjacency_list g = new adjacency_list(); hash_property_map pred_map = new hash_property_map(); hash_property_map distance_map = new hash_property_map(); hash_property_map,double> weight_map = new hash_property_map,double>(); hash_property_map,double> new_weight_map = new hash_property_map,double>(); hash_property_map > distance_matrix = new hash_property_map >(); double inf = 1.0/0.0; g.add_vertex(3); distance_map[3] = 0; g.add_vertex(4); distance_map[4] = inf; g.add_vertex(5); distance_map[5] = inf; g.add_vertex(6); distance_map[6] = inf; g.add_edge(3, 6); weight_map[new adj_list_edge(3, 6)] = 5; g.add_edge(3, 5); weight_map[new adj_list_edge(3, 5)] = 8; g.add_edge(4, 5); weight_map[new adj_list_edge(4, 5)] = -1; g.add_edge(6, 4); weight_map[new adj_list_edge(6, 4)] = -2; g.add_edge(4, 3); weight_map[new adj_list_edge(4, 3)] = 3; distance_matrix[3] = new hash_property_map(); distance_matrix[4] = new hash_property_map(); distance_matrix[5] = new hash_property_map(); distance_matrix[6] = new hash_property_map(); johnson_all_pairs_shortest_paths.go< adjacency_list, int, adj_list_edge, IEnumerable, IEnumerable >, IEnumerable >, double, hash_property_map, double>, hash_property_map, double>, hash_property_map, hash_property_map, hash_property_map >, plus_double, less_double, negate_double >(g, weight_map, new_weight_map, distance_map, distance_matrix, 0, inf, new plus_double(), new negate_double(), new less_double()); for (int i = 3; i < 7; ++i) { System.Console.Write("{0}: ", i); for (int j = 3; j < 7; ++j) { System.Console.Write("{0} ", distance_matrix[i][j]); } System.Console.WriteLine(""); } } }