COIN-OR::LEMON - Graph Library

Changeset 1741:7a98fe2ed989 in lemon-0.x for lemon/belmann_ford.h


Ignore:
Timestamp:
10/26/05 12:50:47 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2269
Message:

Some modifications on shortest path algoritms:

  • heap traits
  • checked execution
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/belmann_ford.h

    r1723 r1741  
    413413      int num = countNodes(*graph) - 1;
    414414      for (int i = 0; i < num; ++i) {
    415         bool ready = true;
     415        bool done = true;
    416416        for (EdgeIt it(*graph); it != INVALID; ++it) {
    417417          Node source = graph->source(it);
     
    422422            _pred->set(target, it);
    423423            _dist->set(target, relaxed);
    424             ready = false;
     424            done = false;
    425425          }
    426426        }
    427         if (ready) return;
    428       }
    429     }
    430 
    431     /// \brief Executes the algorithm and check the negative circles.
     427        if (done) return;
     428      }
     429    }
     430
     431    /// \brief Executes the algorithm and checks the negative circles.
    432432    ///
    433433    /// \pre init() must be called and at least one node should be added
     
    443443      int num = countNodes(*graph);
    444444      for (int i = 0; i < num; ++i) {
    445         bool ready = true;
     445        bool done = true;
    446446        for (EdgeIt it(*graph); it != INVALID; ++it) {
    447447          Node source = graph->source(it);
     
    452452            _pred->set(target, it);
    453453            _dist->set(target, relaxed);
    454             ready = false;
     454            done = false;
    455455          }
    456456        }
    457         if (ready) return true;
     457        if (done) return true;
    458458      }
    459459      return false;
Note: See TracChangeset for help on using the changeset viewer.