COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/31/04 19:54:22 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1070
Message:

graph_wrapper.h is ready for hugo 0.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/iterator_bfs_demo.cc

    r774 r777  
    1010
    1111using namespace hugo;
     12
    1213using std::cout;
    1314using std::endl;
     
    7374  cout << "    \\-->    ------------->         "<< endl;
    7475 
    75 //   typedef TrivGraphWrapper<const Graph> CGW;
    76 //   CGW gw(G);
    77 
    78 //   cout << "bfs and dfs demo on the directed graph" << endl;
    79 //   for(CGW::NodeIt n=gw.first<CGW::NodeIt>(); n.valid(); ++n) {
    80 //     cout << n << ": ";
    81 //     cout << "out edges: ";
    82 //     for(CGW::OutEdgeIt e=gw.first<CGW::OutEdgeIt>(n); e.valid(); ++e)
    83 //       cout << e << " ";
    84 //     cout << "in edges: ";
    85 //     for(CGW::InEdgeIt e=gw.first<CGW::InEdgeIt>(n); e.valid(); ++e)
    86 //       cout << e << " ";
    87 //     cout << endl;
    88 //   }
    89 
    9076  {
    9177    EdgeNameMap< Graph, Graph::NodeMap<string> > edge_name(G, node_name);
     
    10894    while (!bfs.finished()) {
    10995      //cout << "edge: ";
    110       if (Graph::Edge(Graph::OutEdgeIt(bfs))!=INVALID) {
     96      if (Graph::Edge(bfs)!=INVALID) {
    11197        cout << edge_name[bfs] << /*endl*/", " <<
    11298          node_name[G.tail(bfs)] <<
     
    117103      } else {
    118104        cout << "invalid" << /*endl*/", " <<
    119           node_name[bfs.aNode()] <<
     105          node_name[bfs.tail()] <<
    120106          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    121107         
     
    142128      ++dfs;
    143129      //cout << "edge: ";
    144       if (Graph::Edge(Graph::OutEdgeIt(dfs))!=INVALID) {
     130      if (Graph::Edge(dfs)!=INVALID) {
    145131        cout << edge_name[dfs] << /*endl*/", " <<
    146132          node_name[G.tail(dfs)] <<
     
    151137      } else {
    152138        cout << "invalid" << /*endl*/", " <<
    153           node_name[dfs.aNode()] <<
     139          node_name[dfs.tail()] <<
    154140          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    155141         
     
    184170    while (!bfs.finished()) {
    185171      //cout << "edge: ";
    186       if (GW::Edge(GW::OutEdgeIt(bfs))!=INVALID) {
    187         cout << edge_name[GW::OutEdgeIt(bfs)] << /*endl*/", " <<
     172      if (GW::Edge(bfs)!=INVALID) {
     173        cout << edge_name[GW::Edge(bfs)] << /*endl*/", " <<
    188174          node_name[gw.tail(bfs)] <<
    189175          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     
    193179      } else {
    194180        cout << "invalid" << /*endl*/", " <<
    195           node_name[bfs.aNode()] <<
     181          node_name[bfs.tail()] <<
    196182          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    197183         
     
    218204      ++dfs;
    219205      //cout << "edge: ";
    220       if (GW::OutEdgeIt(dfs)!=INVALID) {
    221         cout << edge_name[GW::OutEdgeIt(dfs)] << /*endl*/", " <<
     206      if (GW::Edge(dfs)!=INVALID) {
     207        cout << edge_name[GW::Edge(dfs)] << /*endl*/", " <<
    222208          node_name[gw.tail(dfs)] <<
    223209          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     
    227213      } else {
    228214        cout << "invalid" << /*endl*/", " <<
    229           node_name[dfs.aNode()] <<
     215          node_name[dfs.tail()] <<
    230216          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    231217         
     
    347333    while (!bfs.finished()) {
    348334      //cout << "edge: ";
    349       if (GW::OutEdgeIt(bfs)!=INVALID) {
    350         cout << edge_name[GW::OutEdgeIt(bfs)] << /*endl*/", " <<
     335      if (GW::Edge(bfs)!=INVALID) {
     336        cout << edge_name[GW::Edge(bfs)] << /*endl*/", " <<
    351337          node_name[gw.tail(bfs)] <<
    352338          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     
    356342      } else {
    357343        cout << "invalid" << /*endl*/", " <<
    358           node_name[bfs.aNode()] <<
     344          node_name[bfs.tail()] <<
    359345          (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    360346         
     
    381367      ++dfs;
    382368      //cout << "edge: ";
    383       if (GW::OutEdgeIt(dfs)!=INVALID) {
    384         cout << edge_name[GW::OutEdgeIt(dfs)] << /*endl*/", " <<
     369      if (GW::Edge(dfs)!=INVALID) {
     370        cout << edge_name[GW::Edge(dfs)] << /*endl*/", " <<
    385371          node_name[gw.tail(dfs)] <<
    386372          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
     
    390376      } else {
    391377        cout << "invalid" << /*endl*/", " <<
    392           node_name[dfs.aNode()] <<
     378          node_name[dfs.tail()] <<
    393379          (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
    394380         
Note: See TracChangeset for help on using the changeset viewer.