COIN-OR::LEMON - Graph Library

Changeset 30:10a3f2e0928c in lemon-0.x for src/work/proba.cc


Ignore:
Timestamp:
01/21/04 15:51:05 (21 years ago)
Author:
jacint
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@43
Message:

is_valid changed to valid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/proba.cc

    r23 r30  
    99#include <preflow_push_max_flow.hh>
    1010#include <reverse_bfs.hh>
     11//#include <dijkstra.hh>
    1112
    1213using namespace marci;
     
    2526  list_graph flow_test;
    2627 
    27   //Ahuja könyv példája, maxflowvalue=13
     28  /*  //Ahuja könyv példája, maxflowvalue=13
    2829  node_iterator s=flow_test.add_node();
    2930  node_iterator v1=flow_test.add_node();
     
    4647  edge_iterator s_v2=flow_test.add_edge(s, v2);
    4748  edge_iterator s_v3=flow_test.add_edge(s, v3);
    48  
    4949  edge_iterator v2_v4=flow_test.add_edge(v2, v4);
    5050  edge_iterator v2_v5=flow_test.add_edge(v2, v5);
    51 
    5251  edge_iterator v3_v5=flow_test.add_edge(v3, v5);
    53 
    5452  edge_iterator v4_t=flow_test.add_edge(v4, t);
    5553  edge_iterator v5_t=flow_test.add_edge(v5, t);
     54  edge_iterator v2_s=flow_test.add_edge(v2, s);
    5655 
    5756  edge_property_vector<list_graph, int> cap(flow_test); 
     
    6463  cap.put(v4_t, 8);
    6564  cap.put(v5_t, 8);
    66 
     65  cap.put(v2_s, 0);
     66*/
    6767
    6868 
    6969  //Marci példája, maxflowvalue=23
    70   /*   node_iterator s=flow_test.add_node();
     70     node_iterator s=flow_test.add_node();
    7171  node_iterator v1=flow_test.add_node();
    7272  node_iterator v2=flow_test.add_node();
     
    9898  edge_iterator v3_v3=flow_test.add_edge(v3, v3);
    9999  edge_iterator s_w=flow_test.add_edge(s, w);
     100  edge_iterator v2_s=flow_test.add_edge(v2, s);
    100101 
    101102
     
    114115  cap.put(v3_v3, 4);
    115116  cap.put(s_w, 4);
    116   */
     117  cap.put(v2_s, 0);
    117118
    118119
     
    156157  bfs_test.run();
    157158
    158   for (each_node_iterator w=flow_test.first_node(); w.is_valid(); ++w) {
     159  for (each_node_iterator w=flow_test.first_node(); w.valid(); ++w) {
    159160    std::cout <<"The distance of " << w << " is " << bfs_test.dist(w) <<std::endl;
    160161    }
     
    175176
    176177  edge_property_vector<list_graph, int> flow=preflow_push_test.allflow(); 
    177   for (each_edge_iterator e=flow_test.first_edge(); e.is_valid(); ++e) {
     178  for (each_edge_iterator e=flow_test.first_edge(); e.valid(); ++e) {
    178179    std::cout <<"Flow on edge " << flow_test.tail(e) <<"-" << flow_test.head(e)<< " is " <<flow.get(e) <<std::endl;
    179180    }
     
    182183  node_property_vector<list_graph, bool> mincut=preflow_push_test.mincut();
    183184
    184   for (each_node_iterator v=flow_test.first_node(); v.is_valid(); ++v) {
     185  for (each_node_iterator v=flow_test.first_node(); v.valid(); ++v) {
    185186      if (mincut.get(v)) std::cout <<node_name.get(v)<< " ";
    186187    }
     
    202203  node_property_vector<list_graph, bool> mincut2=max_flow_test.mincut();
    203204
    204   for (each_node_iterator v=flow_test.first_node(); v.is_valid(); ++v) {
     205  for (each_node_iterator v=flow_test.first_node(); v.valid(); ++v) {
    205206    if (mincut2.get(v)) std::cout <<node_name.get(v)<< " ";
    206207  }
     
    210211
    211212
     213//    std::cout << "Testing dijkstra..." << std::endl;
     214 
     215//    dijkstra<list_graph, int> dijkstra_test(flow_test, s, cap);
     216
     217//    dijkstra_test.run();
     218
     219//    for (each_node_iterator w=flow_test.first_node(); w.valid(); ++w) {
     220//      std::cout <<"The distance of " << w << " is " << dijkstra_test.dist(w) <<std::endl;
     221//      }
     222
     223
     224
     225
    212226  return 0;
    213227}
Note: See TracChangeset for help on using the changeset viewer.