Changeset 788:c92296660262 in lemon-main
- Timestamp:
- 11/18/09 14:38:02 (15 years ago)
- Branch:
- default
- Parents:
- 787:c2230649a493 (diff), 786:e20173729589 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/min_cost_flow.dox
r786 r788 27 27 minimum total cost from a set of supply nodes to a set of demand nodes 28 28 in a network with capacity constraints (lower and upper bounds) 29 and arc costs .29 and arc costs \ref amo93networkflows. 30 30 31 31 Formally, let \f$G=(V,A)\f$ be a digraph, \f$lower: A\rightarrow\mathbf{R}\f$, -
doc/min_cost_flow.dox
r755 r788 79 79 - if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. 80 80 - For all \f$u\in V\f$ nodes: 81 - \f$\pi(u) <=0\f$;81 - \f$\pi(u)\leq 0\f$; 82 82 - if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$, 83 83 then \f$\pi(u)=0\f$. … … 146 146 - if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. 147 147 - For all \f$u\in V\f$ nodes: 148 - \f$\pi(u) >=0\f$;148 - \f$\pi(u)\geq 0\f$; 149 149 - if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$, 150 150 then \f$\pi(u)=0\f$. -
lemon/bellman_ford.h
r786 r788 24 24 /// \brief Bellman-Ford algorithm. 25 25 26 #include <lemon/list_graph.h> 26 27 #include <lemon/bits/path_dump.h> 27 28 #include <lemon/core.h> … … 776 777 /// length if the algorithm has already found one. 777 778 /// Otherwise it gives back an empty path. 778 lemon::Path<Digraph> negativeCycle() {779 lemon::Path<Digraph> negativeCycle() const { 779 780 typename Digraph::template NodeMap<int> state(*_gr, -1); 780 781 lemon::Path<Digraph> cycle; -
lemon/bellman_ford.h
r781 r788 301 301 /// \ref named-templ-param "Named parameter" for setting 302 302 /// \c OperationTraits type. 303 /// For more information see \ref BellmanFordDefaultOperationTraits.303 /// For more information, see \ref BellmanFordDefaultOperationTraits. 304 304 template <class T> 305 305 struct SetOperationTraits … … 719 719 /// 720 720 /// The shortest path tree used here is equal to the shortest path 721 /// tree used in \ref predNode() and \ predMap().721 /// tree used in \ref predNode() and \ref predMap(). 722 722 /// 723 723 /// \pre Either \ref run() or \ref init() must be called before … … 734 734 /// 735 735 /// The shortest path tree used here is equal to the shortest path 736 /// tree used in \ref predArc() and \ predMap().736 /// tree used in \ref predArc() and \ref predMap(). 737 737 /// 738 738 /// \pre Either \ref run() or \ref init() must be called before -
lemon/bfs.h
r786 r788 702 702 ///Runs the algorithm to visit all nodes in the digraph. 703 703 704 ///This method runs the %BFS algorithm in order to 705 ///compute the shortest path to each node. 706 /// 707 ///The algorithm computes 708 ///- the shortest path tree (forest), 709 ///- the distance of each node from the root(s). 704 ///This method runs the %BFS algorithm in order to visit all nodes 705 ///in the digraph. 710 706 /// 711 707 ///\note <tt>b.run(s)</tt> is just a shortcut of the following code. … … 1047 1043 ///Runs BFS algorithm to visit all nodes in the digraph. 1048 1044 1049 ///This method runs BFS algorithm in order to compute1050 /// the shortest path to each node.1045 ///This method runs BFS algorithm in order to visit all nodes 1046 ///in the digraph. 1051 1047 void run() 1052 1048 { … … 1696 1692 /// \brief Runs the algorithm to visit all nodes in the digraph. 1697 1693 /// 1698 /// This method runs the %BFS algorithm in order to 1699 /// compute the shortest path to each node. 1700 /// 1701 /// The algorithm computes 1702 /// - the shortest path tree (forest), 1703 /// - the distance of each node from the root(s). 1694 /// This method runs the %BFS algorithm in order to visit all nodes 1695 /// in the digraph. 1704 1696 /// 1705 1697 /// \note <tt>b.run(s)</tt> is just a shortcut of the following code. -
lemon/bfs.h
r787 r788 64 64 ///The type of the map that indicates which nodes are processed. 65 65 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 66 ///By default it is a NullMap.66 ///By default, it is a NullMap. 67 67 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 68 68 ///Instantiates a \c ProcessedMap. … … 849 849 ///The type of the map that indicates which nodes are processed. 850 850 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 851 ///By default it is a NullMap.851 ///By default, it is a NullMap. 852 852 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 853 853 ///Instantiates a ProcessedMap. -
lemon/dfs.h
r786 r788 634 634 ///Runs the algorithm to visit all nodes in the digraph. 635 635 636 ///This method runs the %DFS algorithm in order to compute the 637 ///%DFS path to each node. 638 /// 639 ///The algorithm computes 640 ///- the %DFS tree (forest), 641 ///- the distance of each node from the root(s) in the %DFS tree. 636 ///This method runs the %DFS algorithm in order to visit all nodes 637 ///in the digraph. 642 638 /// 643 639 ///\note <tt>d.run()</tt> is just a shortcut of the following code. … … 977 973 ///Runs DFS algorithm to visit all nodes in the digraph. 978 974 979 ///This method runs DFS algorithm in order to compute980 /// the DFS path to each node.975 ///This method runs DFS algorithm in order to visit all nodes 976 ///in the digraph. 981 977 void run() 982 978 { … … 1579 1575 /// \brief Runs the algorithm to visit all nodes in the digraph. 1580 1576 1581 /// This method runs the %DFS algorithm in order to 1582 /// compute the %DFS path to each node. 1583 /// 1584 /// The algorithm computes 1585 /// - the %DFS tree (forest), 1586 /// - the distance of each node from the root(s) in the %DFS tree. 1577 /// This method runs the %DFS algorithm in order to visit all nodes 1578 /// in the digraph. 1587 1579 /// 1588 1580 /// \note <tt>d.run()</tt> is just a shortcut of the following code. -
lemon/dfs.h
r787 r788 64 64 ///The type of the map that indicates which nodes are processed. 65 65 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 66 ///By default it is a NullMap.66 ///By default, it is a NullMap. 67 67 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 68 68 ///Instantiates a \c ProcessedMap. … … 779 779 ///The type of the map that indicates which nodes are processed. 780 780 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 781 ///By default it is a NullMap.781 ///By default, it is a NullMap. 782 782 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 783 783 ///Instantiates a ProcessedMap. -
lemon/dijkstra.h
r786 r788 207 207 208 208 ///The type of the arc lengths. 209 typedef typename TR:: LengthMap::Value Value;209 typedef typename TR::Value Value; 210 210 ///The type of the map that stores the arc lengths. 211 211 typedef typename TR::LengthMap LengthMap; -
lemon/dijkstra.h
r787 r788 133 133 ///The type of the map that indicates which nodes are processed. 134 134 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 135 ///By default it is a NullMap.135 ///By default, it is a NullMap. 136 136 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 137 137 ///Instantiates a \c ProcessedMap. … … 427 427 ///passed to the constructor of the cross reference and the cross 428 428 ///reference should be passed to the constructor of the heap). 429 ///However external heap and cross reference objects could also be429 ///However, external heap and cross reference objects could also be 430 430 ///passed to the algorithm using the \ref heap() function before 431 431 ///calling \ref run(Node) "run()" or \ref init(). … … 448 448 ///\ref named-templ-param "Named parameter" for setting 449 449 ///\c OperationTraits type. 450 /// For more information see \ref DijkstraDefaultOperationTraits.450 /// For more information, see \ref DijkstraDefaultOperationTraits. 451 451 template <class T> 452 452 struct SetOperationTraits … … 997 997 ///The type of the map that indicates which nodes are processed. 998 998 ///It must conform to the \ref concepts::WriteMap "WriteMap" concept. 999 ///By default it is a NullMap.999 ///By default, it is a NullMap. 1000 1000 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 1001 1001 ///Instantiates a ProcessedMap. -
lemon/hypercube_graph.h
r786 r788 263 263 } 264 264 265 int index(Node node) const{265 static int index(Node node) { 266 266 return node._id; 267 267 } … … 295 295 /// only in the concept class. 296 296 /// 297 /// This class provides constant time counting for nodes, edges and arcs. 298 /// 297 299 /// \note The type of the indices is chosen to \c int for efficiency 298 300 /// reasons. Thus the maximum dimension of this implementation is 26 … … 357 359 /// Gives back the index of the given node. 358 360 /// The lower bits of the integer describes the node. 359 int index(Node node) const{361 static int index(Node node) { 360 362 return Parent::index(node); 361 363 } -
lemon/hypercube_graph.h
r787 r788 288 288 /// differ only on one position in the binary form. 289 289 /// This class is completely static and it needs constant memory space. 290 /// Thus you can neither add nor delete nodes or edges, however 290 /// Thus you can neither add nor delete nodes or edges, however, 291 291 /// the structure can be resized using resize(). 292 292 /// -
lemon/list_graph.h
r786 r788 325 325 ///only in the concept class. 326 326 /// 327 ///This class provides only linear time counting for nodes and arcs. 328 /// 327 329 ///\sa concepts::Digraph 328 330 ///\sa ListGraph … … 361 363 ///\brief Erase a node from the digraph. 362 364 /// 363 ///This function erases the given node from the digraph. 365 ///This function erases the given node along with its outgoing and 366 ///incoming arcs from the digraph. 367 /// 368 ///\note All iterators referencing the removed node or the connected 369 ///arcs are invalidated, of course. 364 370 void erase(Node n) { Parent::erase(n); } 365 371 … … 367 373 /// 368 374 ///This function erases the given arc from the digraph. 375 /// 376 ///\note All iterators referencing the removed arc are invalidated, 377 ///of course. 369 378 void erase(Arc a) { Parent::erase(a); } 370 379 … … 511 520 ///This function erases all nodes and arcs from the digraph. 512 521 /// 522 ///\note All iterators of the digraph are invalidated, of course. 513 523 void clear() { 514 524 Parent::clear(); … … 1180 1190 ///only in the concept class. 1181 1191 /// 1192 ///This class provides only linear time counting for nodes, edges and arcs. 1193 /// 1182 1194 ///\sa concepts::Graph 1183 1195 ///\sa ListDigraph … … 1218 1230 ///\brief Erase a node from the graph. 1219 1231 /// 1220 /// This function erases the given node from the graph. 1232 /// This function erases the given node along with its incident arcs 1233 /// from the graph. 1234 /// 1235 /// \note All iterators referencing the removed node or the incident 1236 /// edges are invalidated, of course. 1221 1237 void erase(Node n) { Parent::erase(n); } 1222 1238 … … 1224 1240 /// 1225 1241 /// This function erases the given edge from the graph. 1242 /// 1243 /// \note All iterators referencing the removed edge are invalidated, 1244 /// of course. 1226 1245 void erase(Edge e) { Parent::erase(e); } 1227 1246 /// Node validity check … … 1313 1332 ///This function erases all nodes and arcs from the graph. 1314 1333 /// 1334 ///\note All iterators of the graph are invalidated, of course. 1315 1335 void clear() { 1316 1336 Parent::clear(); -
lemon/list_graph.h
r787 r788 401 401 /// 402 402 ///\note \c ArcIt and \c OutArcIt iterators referencing the changed 403 ///arc remain valid, however\c InArcIt iterators are invalidated.403 ///arc remain valid, but \c InArcIt iterators are invalidated. 404 404 /// 405 405 ///\warning This functionality cannot be used together with the Snapshot … … 413 413 /// 414 414 ///\note \c InArcIt iterators referencing the changed arc remain 415 ///valid, however\c ArcIt and \c OutArcIt iterators are invalidated.415 ///valid, but \c ArcIt and \c OutArcIt iterators are invalidated. 416 416 /// 417 417 ///\warning This functionality cannot be used together with the Snapshot … … 560 560 /// reversing, contracting, splitting arcs or nodes) cannot be 561 561 /// restored. These events invalidate the snapshot. 562 /// However the arcs and nodes that were added to the digraph after562 /// However, the arcs and nodes that were added to the digraph after 563 563 /// making the current snapshot can be removed without invalidating it. 564 564 class Snapshot { … … 1287 1287 /// 1288 1288 ///\note \c EdgeIt iterators referencing the changed edge remain 1289 ///valid, however\c ArcIt iterators referencing the changed edge and1289 ///valid, but \c ArcIt iterators referencing the changed edge and 1290 1290 ///all other iterators whose base node is the changed node are also 1291 1291 ///invalidated. … … 1372 1372 /// (e.g. changing the end-nodes of edges or contracting nodes) 1373 1373 /// cannot be restored. These events invalidate the snapshot. 1374 /// However the edges and nodes that were added to the graph after1374 /// However, the edges and nodes that were added to the graph after 1375 1375 /// making the current snapshot can be removed without invalidating it. 1376 1376 class Snapshot { -
lemon/network_simplex.h
r786 r788 41 41 /// 42 42 /// \ref NetworkSimplex implements the primal Network Simplex algorithm 43 /// for finding a \ref min_cost_flow "minimum cost flow". 43 /// for finding a \ref min_cost_flow "minimum cost flow" 44 /// \ref amo93networkflows, \ref dantzig63linearprog, 45 /// \ref kellyoneill91netsimplex. 44 46 /// This algorithm is a specialized version of the linear programming 45 47 /// simplex method directly for the minimum cost flow problem. -
lemon/network_simplex.h
r755 r788 51 51 /// in LEMON for the minimum cost flow problem. 52 52 /// Moreover it supports both directions of the supply/demand inequality 53 /// constraints. For more information see \ref SupplyType.53 /// constraints. For more information, see \ref SupplyType. 54 54 /// 55 55 /// Most of the parameters of the problem (except for the digraph) … … 60 60 /// \tparam GR The digraph type the algorithm runs on. 61 61 /// \tparam V The value type used for flow amounts, capacity bounds 62 /// and supply values in the algorithm. By default it is \c int.62 /// and supply values in the algorithm. By default, it is \c int. 63 63 /// \tparam C The value type used for costs and potentials in the 64 /// algorithm. By default it is the same as \c V.64 /// algorithm. By default, it is the same as \c V. 65 65 /// 66 66 /// \warning Both value types must be signed and all input data must … … 69 69 /// \note %NetworkSimplex provides five different pivot rule 70 70 /// implementations, from which the most efficient one is used 71 /// by default. For more information see \ref PivotRule.71 /// by default. For more information, see \ref PivotRule. 72 72 template <typename GR, typename V = int, typename C = V> 73 73 class NetworkSimplex … … 125 125 /// implementations that significantly affect the running time 126 126 /// of the algorithm. 127 /// By default \ref BLOCK_SEARCH "Block Search" is used, which127 /// By default, \ref BLOCK_SEARCH "Block Search" is used, which 128 128 /// proved to be the most efficient and the most robust on various 129 129 /// test inputs according to our benchmark tests. 130 /// However another pivot rule can be selected using the \ref run()130 /// However, another pivot rule can be selected using the \ref run() 131 131 /// function with the proper parameter. 132 132 enum PivotRule { 133 133 134 /// The FirstEligible pivot rule.134 /// The \e First \e Eligible pivot rule. 135 135 /// The next eligible arc is selected in a wraparound fashion 136 136 /// in every iteration. 137 137 FIRST_ELIGIBLE, 138 138 139 /// The BestEligible pivot rule.139 /// The \e Best \e Eligible pivot rule. 140 140 /// The best eligible arc is selected in every iteration. 141 141 BEST_ELIGIBLE, 142 142 143 /// The BlockSearch pivot rule.143 /// The \e Block \e Search pivot rule. 144 144 /// A specified number of arcs are examined in every iteration 145 145 /// in a wraparound fashion and the best eligible arc is selected … … 147 147 BLOCK_SEARCH, 148 148 149 /// The Candidate List pivot rule.149 /// The \e Candidate \e List pivot rule. 150 150 /// In a major iteration a candidate list is built from eligible arcs 151 151 /// in a wraparound fashion and in the following minor iterations … … 153 153 CANDIDATE_LIST, 154 154 155 /// The Altering Candidate List pivot rule.155 /// The \e Altering \e Candidate \e List pivot rule. 156 156 /// It is a modified version of the Candidate List method. 157 157 /// It keeps only the several best eligible arcs from the former … … 813 813 /// type will be used. 814 814 /// 815 /// For more information see \ref SupplyType.815 /// For more information, see \ref SupplyType. 816 816 /// 817 817 /// \return <tt>(*this)</tt> … … 845 845 /// \ref reset() is called, thus only the modified parameters 846 846 /// have to be set again. See \ref reset() for examples. 847 /// However the underlying digraph must not be modified after this847 /// However, the underlying digraph must not be modified after this 848 848 /// class have been constructed, since it copies and extends the graph. 849 849 /// 850 850 /// \param pivot_rule The pivot rule that will be used during the 851 /// algorithm. For more information see \ref PivotRule.851 /// algorithm. For more information, see \ref PivotRule. 852 852 /// 853 853 /// \return \c INFEASIBLE if no feasible flow exists, … … 874 874 /// used, all the parameters given before are kept for the next 875 875 /// \ref run() call. 876 /// However the underlying digraph must not be modified after this876 /// However, the underlying digraph must not be modified after this 877 877 /// class have been constructed, since it copies and extends the graph. 878 878 /// -
lemon/preflow.h
r786 r788 103 103 /// This class provides an implementation of Goldberg-Tarjan's \e preflow 104 104 /// \e push-relabel algorithm producing a \ref max_flow 105 /// "flow of maximum value" in a digraph. 105 /// "flow of maximum value" in a digraph \ref clrs01algorithms, 106 /// \ref amo93networkflows, \ref goldberg88newapproach. 106 107 /// The preflow algorithms are the fastest known maximum 107 108 /// flow algorithms. The current implementation uses a mixture of the -
lemon/preflow.h
r755 r788 266 266 /// able to automatically created by the algorithm (i.e. the 267 267 /// digraph and the maximum level should be passed to it). 268 /// However an external elevator object could also be passed to the268 /// However, an external elevator object could also be passed to the 269 269 /// algorithm with the \ref elevator(Elevator&) "elevator()" function 270 270 /// before calling \ref run() or \ref init().
Note: See TracChangeset
for help on using the changeset viewer.