src/work/reverse_bfs.hh
changeset 39 28b0d751d29f
parent 22 0286c68fc680
equal deleted inserted replaced
0:1f6fe982b230 1:3b00ad19b4fe
    65       while (!bfs_queue.empty()) {
    65       while (!bfs_queue.empty()) {
    66 
    66 
    67         node_iterator v=bfs_queue.front();	
    67         node_iterator v=bfs_queue.front();	
    68 	bfs_queue.pop();
    68 	bfs_queue.pop();
    69 
    69 
    70 	for(in_edge_iterator e=G.first_in_edge(v); e.is_valid(); ++e) {
    70 	for(in_edge_iterator e=G.first_in_edge(v); e.valid(); ++e) {
    71 	  node_iterator w=G.tail(e);
    71 	  node_iterator w=G.tail(e);
    72 	  if (!reached.get(w)) {
    72 	  if (!reached.get(w)) {
    73 	    bfs_queue.push(w);
    73 	    bfs_queue.push(w);
    74 	    distance.put(w, distance.get(v)+1);
    74 	    distance.put(w, distance.get(v)+1);
    75 	    reached.put(w, true);
    75 	    reached.put(w, true);