Changeset 2059:ebf3b2962554 in lemon0.x for lemon/bellman_ford.h
 Timestamp:
 04/18/06 09:02:32 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2703
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bellman_ford.h
r2042 r2059 421 421 /// \brief Executes one round from the bellman ford algorithm. 422 422 /// 423 /// If the algoritm calculated the distances in the previous round 424 /// strictly for all at most k length paths then it will calculate the 425 /// distances strictly for all at most k + 1 length paths. With k 426 /// iteration this function calculates the at most k length paths. 427 /// \return %True when the algorithm have not found more shorter paths. 423 /// If the algoritm calculated the distances in the previous round 424 /// exactly for all at most \f$ k \f$ length path lengths then it will 425 /// calculate the distances exactly for all at most \f$ k + 1 \f$ 426 /// length path lengths. With \f$ k \f$ iteration this function 427 /// calculates the at most \f$ k \f$ length path lengths. 428 /// 429 /// \warning The paths with limited edge number cannot be retrieved 430 /// easily with \ref getPath() or \ref predEdge() functions. If you 431 /// need the shortest path and not just the distance you should store 432 /// after each iteration the \ref predEdgeMap() map and manually build 433 /// the path. 434 /// 435 /// \return %True when the algorithm have not found more shorter 436 /// paths. 428 437 bool processNextRound() { 429 438 for (int i = 0; i < (int)_process.size(); ++i) { … … 527 536 /// with addSource() before using this function. 528 537 /// 529 /// This method runs the %BellmanFord algorithm from the root node(s) 530 /// in order to compute the shortest path with at most \c length edge 531 /// long paths to each node. The algorithm computes 532 ///  The shortest path tree. 538 /// This method runs the %BellmanFord algorithm from the root 539 /// node(s) in order to compute the shortest path lengths with at 540 /// most \c num edge. 541 /// 542 /// \warning The paths with limited edge number cannot be retrieved 543 /// easily with \ref getPath() or \ref predEdge() functions. If you 544 /// need the shortest path and not just the distance you should store 545 /// after each iteration the \ref predEdgeMap() map and manually build 546 /// the path. 547 /// 548 /// The algorithm computes 549 ///  The predecessor edge from each node. 533 550 ///  The limited distance of each node from the root(s). 534 void limitedStart(int length) {535 for (int i = 0; i < length; ++i) {551 void limitedStart(int num) { 552 for (int i = 0; i < num; ++i) { 536 553 if (processNextRound()) break; 537 554 }
Note: See TracChangeset
for help on using the changeset viewer.