equal
deleted
inserted
replaced
52 int N=_graph.nodeNum(); |
52 int N=_graph.nodeNum(); |
53 vector<Node> Q(N); |
53 vector<Node> Q(N); |
54 int Qh=0; |
54 int Qh=0; |
55 int Qt=0; |
55 int Qt=0; |
56 |
56 |
57 for(typename Graph::NodeIt n(_graph);_graph.valid(n);_graph.next(n)) |
57 for(typename Graph::NodeIt n(_graph);n!=INVALID;++n) |
58 _visited->set(n,false); |
58 _visited->set(n,false); |
59 |
59 |
60 Q[Qh++]=_source; |
60 Q[Qh++]=_source; |
61 _visited->set(_source,true); |
61 _visited->set(_source,true); |
62 do { |
62 do { |
63 Node m; |
63 Node m; |
64 Node n=Q[Qt++]; |
64 Node n=Q[Qt++]; |
65 for(OutEdgeIt e(_graph,n);_graph.valid(e);_graph.next(e)) |
65 for(OutEdgeIt e(_graph,n);e!=INVALID;++e) |
66 if(!(*_visited)[m=_graph.head(e)]) { |
66 if(!(*_visited)[m=_graph.head(e)]) { |
67 Q[Qh++]=m; |
67 Q[Qh++]=m; |
68 _visited->set(m,true); |
68 _visited->set(m,true); |
69 _predNode.set(m,n); |
69 _predNode.set(m,n); |
70 _predEdge.set(m,e); |
70 _predEdge.set(m,e); |