src/work/alpar/smart_graph_demo.cc
changeset 1112 b258584569f2
parent 921 818510fa3d99
equal deleted inserted replaced
4:5d0927e7dad0 5:d5760bc9f323
   109   
   109   
   110     Graph::EdgeMap<int> em(G);
   110     Graph::EdgeMap<int> em(G);
   111     Graph::SymEdgeMap<int> sm(G);
   111     Graph::SymEdgeMap<int> sm(G);
   112     for(EdgeIt e(G);G.valid(e);G.next(e)) em[e]=G.id(e);
   112     for(EdgeIt e(G);G.valid(e);G.next(e)) em[e]=G.id(e);
   113     for(EdgeIt e(G);G.valid(e);G.next(e))
   113     for(EdgeIt e(G);G.valid(e);G.next(e))
   114       if(G.tail(e)<G.head(e)) sm[e]=G.id(e);
   114       if(G.source(e)<G.target(e)) sm[e]=G.id(e);
   115     
   115     
   116     for(EdgeIt e(G);G.valid(e);G.next(e))
   116     for(EdgeIt e(G);G.valid(e);G.next(e))
   117       std::cout << G.id(G.tail(e)) << "->" << G.id(G.head(e))
   117       std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e))
   118 		<< ": id=" << G.id(e) << " oppid=" << G.id(G.opposite(e))
   118 		<< ": id=" << G.id(e) << " oppid=" << G.id(G.opposite(e))
   119 		<< " em=" << em[e]
   119 		<< " em=" << em[e]
   120 		<< " sm=" << sm[e] << "\n";
   120 		<< " sm=" << sm[e] << "\n";
   121     
   121     
   122   }
   122   }