// Copyright 2003, Trustees of Indiana University // Please see the license in the file ../LICENSE using GCollections; using System; public class bellman_ford_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>(); 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; bellman_ford_shortest_paths.go,IEnumerable >,double,hash_property_map,double>,hash_property_map,hash_property_map,plus_double,less_double>( g, 4, weight_map, pred_map, distance_map, new plus_double(), new less_double()); //System.out.println((VertexListGraph,int>)(g)); } }