1.1 --- a/src/work/marci/iterator_bfs_demo.cc Thu Apr 08 13:11:58 2004 +0000
1.2 +++ b/src/work/marci/iterator_bfs_demo.cc Tue Apr 13 20:35:47 2004 +0000
1.3 @@ -168,7 +168,7 @@
1.4
1.5 cout << "bfs and dfs iterator demo on the reversed directed graph" << endl;
1.6 for(GW::NodeIt n(gw); gw.valid(n); gw.next(n)) {
1.7 - cout << node_name[n] << ": ";
1.8 + cout << node_name[GW::Node(n)] << ": ";
1.9 cout << "out edges: ";
1.10 for(GW::OutEdgeIt e(gw, n); gw.valid(e); gw.next(e))
1.11 cout << edge_name[e] << " ";
1.12 @@ -183,8 +183,8 @@
1.13 bfs.pushAndSetReached(t);
1.14 while (!bfs.finished()) {
1.15 //cout << "edge: ";
1.16 - if (gw.valid(bfs)) {
1.17 - cout << edge_name[bfs] << /*endl*/", " <<
1.18 + if (gw.valid(GW::OutEdgeIt(bfs))) {
1.19 + cout << edge_name[GW::OutEdgeIt(bfs)] << /*endl*/", " <<
1.20 node_name[gw.aNode(bfs)] <<
1.21 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
1.22 node_name[gw.bNode(bfs)] <<
1.23 @@ -217,8 +217,8 @@
1.24 while (!dfs.finished()) {
1.25 ++dfs;
1.26 //cout << "edge: ";
1.27 - if (gw.valid(dfs)) {
1.28 - cout << edge_name[dfs] << /*endl*/", " <<
1.29 + if (gw.valid(GW::OutEdgeIt(dfs))) {
1.30 + cout << edge_name[GW::OutEdgeIt(dfs)] << /*endl*/", " <<
1.31 node_name[gw.aNode(dfs)] <<
1.32 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") <<
1.33 node_name[gw.bNode(dfs)] <<
1.34 @@ -236,7 +236,6 @@
1.35 }
1.36
1.37 {
1.38 - //typedef UndirGraphWrapper<const Graph> GW;
1.39 typedef UndirGraphWrapper<const Graph> GW;
1.40 GW gw(G);
1.41
1.42 @@ -244,7 +243,7 @@
1.43
1.44 cout << "bfs and dfs iterator demo on the undirected graph" << endl;
1.45 for(GW::NodeIt n(gw); gw.valid(n); gw.next(n)) {
1.46 - cout << node_name[n] << ": ";
1.47 + cout << node_name[GW::Node(n)] << ": ";
1.48 cout << "out edges: ";
1.49 for(GW::OutEdgeIt e(gw, n); gw.valid(e); gw.next(e))
1.50 cout << edge_name[e] << " ";