test/kruskal_test.cc
changeset 638 57e6f560fb13
parent 440 88ed40ad0d4f
equal deleted inserted replaced
3:ee05154fd6ff 4:2506a84917a7
    97         "Total cost should be 10");
    97         "Total cost should be 10");
    98   //Test with an edge map (filled with uniform costs).
    98   //Test with an edge map (filled with uniform costs).
    99   check(kruskal(G, edge_cost_map, tree_map)==10,
    99   check(kruskal(G, edge_cost_map, tree_map)==10,
   100         "Total cost should be 10");
   100         "Total cost should be 10");
   101 
   101 
   102   edge_cost_map.set(e1, -10);
   102   edge_cost_map[e1] = -10;
   103   edge_cost_map.set(e2, -9);
   103   edge_cost_map[e2] = -9;
   104   edge_cost_map.set(e3, -8);
   104   edge_cost_map[e3] = -8;
   105   edge_cost_map.set(e4, -7);
   105   edge_cost_map[e4] = -7;
   106   edge_cost_map.set(e5, -6);
   106   edge_cost_map[e5] = -6;
   107   edge_cost_map.set(e6, -5);
   107   edge_cost_map[e6] = -5;
   108   edge_cost_map.set(e7, -4);
   108   edge_cost_map[e7] = -4;
   109   edge_cost_map.set(e8, -3);
   109   edge_cost_map[e8] = -3;
   110   edge_cost_map.set(e9, -2);
   110   edge_cost_map[e9] = -2;
   111   edge_cost_map.set(e10, -1);
   111   edge_cost_map[e10] = -1;
   112 
   112 
   113   vector<Edge> tree_edge_vec(5);
   113   vector<Edge> tree_edge_vec(5);
   114 
   114 
   115   //Test with a edge map and inserter.
   115   //Test with a edge map and inserter.
   116   check(kruskal(G, edge_cost_map,
   116   check(kruskal(G, edge_cost_map,