Changeset 986:e997802b855c in lemon-0.x for src/work/marci/oldies/marci_graph_demo.cc
- Timestamp:
- 11/13/04 13:53:28 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/oldies/marci_graph_demo.cc
r921 r986 32 32 std::cout << " outdegree (OutEdgeIt): " << count(G.first<OutEdgeIt>(i)) << " "; 33 33 for(OutEdgeIt j=G.first<OutEdgeIt>(i); G.valid(j); G.next(j)) { 34 std::cout << "(" << G.id(G. tail(j)) << "--" << G.id(j) << "->" << G.id(G.head(j)) << ") ";34 std::cout << "(" << G.id(G.source(j)) << "--" << G.id(j) << "->" << G.id(G.target(j)) << ") "; 35 35 } 36 36 std::cout << std::endl; … … 90 90 } 91 91 92 std::cout << "node and edge property values on the tails and heads of edges..." << std::endl;92 std::cout << "node and edge property values on the sources and targets of edges..." << std::endl; 93 93 for(EdgeIt j=G.first<EdgeIt>(); G.valid(j); G.next(j)) { 94 std::cout << my_property_vector.get(G. tail(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.head(j)) << " ";94 std::cout << my_property_vector.get(G.source(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.target(j)) << " "; 95 95 } 96 96 std::cout << std::endl; … … 159 159 std::cout << "out edges: "; 160 160 for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 161 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";161 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 162 162 std::cout << "in edges: "; 163 163 for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 164 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";164 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 165 165 std::cout << std::endl; 166 166 } … … 172 172 173 173 174 //flowG.set Tail(v3_t, v2);175 //flowG.set Head(v3_t, s);174 //flowG.setSource(v3_t, v2); 175 //flowG.setTarget(v3_t, s); 176 176 /* 177 177 for(NodeIt i=flowG.first<NodeIt>(); flowG.valid(i); flowG.next(i)) { … … 179 179 std::cout << "out edges: "; 180 180 for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 181 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";181 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 182 182 std::cout << "in edges: "; 183 183 for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 184 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";184 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 185 185 std::cout << std::endl; 186 186 } 187 187 188 188 for(EdgeIt e=flowG.first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 189 std::cout << node_name.get(flowG. tail(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.head(e)) << " ";189 std::cout << node_name.get(flowG.source(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.target(e)) << " "; 190 190 } 191 191 */ … … 197 197 std::cout << "out edges: "; 198 198 for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 199 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";199 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 200 200 std::cout << "in edges: "; 201 201 for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 202 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";202 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 203 203 std::cout << std::endl; 204 204 } … … 211 211 std::cout << "out edges: "; 212 212 for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 213 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";213 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 214 214 std::cout << "in edges: "; 215 215 for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 216 std::cout << node_name.get(flowG. tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";216 std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " "; 217 217 std::cout << std::endl; 218 218 } … … 229 229 max_flow_test.augmentOnBlockingFlow<ListGraph>(); 230 230 for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 231 std::cout<<"("<<flowG. tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";231 std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") "; 232 232 } 233 233 std::cout<<std::endl; 234 234 max_flow_test.augmentOnBlockingFlow<ListGraph>(); 235 235 for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 236 std::cout<<"("<<flowG. tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";236 std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") "; 237 237 } 238 238 std::cout<<std::endl;*/ … … 242 242 while (max_flow_test.augmentOnShortestPath()) { 243 243 for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 244 std::cout<<"("<<flowG. tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";244 std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") "; 245 245 } 246 246 std::cout<<std::endl; … … 261 261 std::cout << "maximum flow: "<< std::endl; 262 262 for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 263 std::cout<<"("<<flowG. tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";263 std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") "; 264 264 } 265 265 std::cout<<std::endl;
Note: See TracChangeset
for help on using the changeset viewer.