// Copyright 2003, Trustees of Indiana University // Please see the license in the file ../LICENSE import java.lang.*; 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>(); g.add_vertex(new Integer(3)); distance_map.set(new Integer(3), new Double(0)); g.add_vertex(new Integer(4)); distance_map.set(new Integer(4), new Double(Double.POSITIVE_INFINITY)); g.add_vertex(new Integer(5)); distance_map.set(new Integer(5), new Double(Double.POSITIVE_INFINITY)); g.add_vertex(new Integer(6)); distance_map.set(new Integer(6), new Double(Double.POSITIVE_INFINITY)); g.add_edge(new Integer(3), new Integer(6)); weight_map.set(new adj_list_edge(new Integer(3), new Integer(6)), new Double(5)); g.add_edge(new Integer(3), new Integer(5)); weight_map.set(new adj_list_edge(new Integer(3), new Integer(5)), new Double(8)); g.add_edge(new Integer(4), new Integer(5)); weight_map.set(new adj_list_edge(new Integer(4), new Integer(5)), new Double(-1)); g.add_edge(new Integer(6), new Integer(4)); weight_map.set(new adj_list_edge(new Integer(6), new Integer(4)), new Double(-2)); g.add_edge(new Integer(4), new Integer(3)); weight_map.set(new adj_list_edge(new Integer(4), new Integer(3)), new Double(3)); bellman_ford_shortest_paths.bellman_ford_shortest_paths( g, 4, weight_map, pred_map, distance_map, new BinaryFunction() {public Double op(Double a, Double b) {return new Double((a.doubleValue() + b.doubleValue()));}}, new StrictWeakOrdering() {public boolean less(Double a, Double b) {return a.doubleValue()