COIN-OR::LEMON - Graph Library

Changeset 774:4297098d9677 in lemon-0.x for src/work/marci/bfs_dfs.h


Ignore:
Timestamp:
08/30/04 14:01:47 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
Message:

Merge back the whole branches/hugo++ to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/bfs_dfs.h

    r671 r774  
    6161        bfs_queue.push(s);
    6262        graph->first(actual_edge, s);
    63         if (graph->valid(actual_edge)) {
    64           Node w=graph->bNode(actual_edge);
     63        if (actual_edge!=INVALID) {
     64          Node w=graph->head(actual_edge);
    6565          if (!reached[w]) {
    6666            bfs_queue.push(w);
     
    7979    BfsIterator<Graph, /*OutEdgeIt,*/ ReachedMap>&
    8080    operator++() {
    81       if (graph->valid(actual_edge)) {
    82         graph->next(actual_edge);
    83         if (graph->valid(actual_edge)) {
    84           Node w=graph->bNode(actual_edge);
     81      if (actual_edge!=INVALID) {
     82        ++actual_edge;
     83        if (actual_edge!=INVALID) {
     84          Node w=graph->head(actual_edge);
    8585          if (!reached[w]) {
    8686            bfs_queue.push(w);
     
    9595        if (!bfs_queue.empty()) {
    9696          graph->first(actual_edge, bfs_queue.front());
    97           if (graph->valid(actual_edge)) {
    98             Node w=graph->bNode(actual_edge);
     97          if (actual_edge!=INVALID) {
     98            Node w=graph->head(actual_edge);
    9999            if (!reached[w]) {
    100100              bfs_queue.push(w);
     
    118118    bool isBNodeNewlyReached() const { return b_node_newly_reached; }
    119119    /// Returns if a-node is examined.
    120     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
     120    bool isANodeExamined() const { return actual_edge==INVALID; }
    121121    /// Returns a-node of the actual edge, so does if the edge is invalid.
    122122    Node aNode() const { return bfs_queue.front(); }
     
    238238      actual_edge=dfs_stack.top();
    239239      //actual_node=G.aNode(actual_edge);
    240       if (graph->valid(actual_edge)/*.valid()*/) {
    241         Node w=graph->bNode(actual_edge);
     240      if (actual_edge!=INVALID/*.valid()*/) {
     241        Node w=graph->head(actual_edge);
    242242        actual_node=w;
    243243        if (!reached[w]) {
     
    248248          b_node_newly_reached=true;
    249249        } else {
    250           actual_node=graph->aNode(actual_edge);
    251           graph->next(dfs_stack.top());
     250          actual_node=graph->tail(actual_edge);
     251          ++dfs_stack.top();
    252252          b_node_newly_reached=false;
    253253        }
     
    267267    bool isBNodeNewlyReached() const { return b_node_newly_reached; }
    268268    /// Returns if a-node is examined.
    269     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
     269    bool isANodeExamined() const { return actual_edge==INVALID; }
    270270    /// Returns a-node of the actual edge, so does if the edge is invalid.
    271271    Node aNode() const { return actual_node; /*FIXME*/}
Note: See TracChangeset for help on using the changeset viewer.