Changeset 851:209c9d53e195 in lemon-0.x for src/hugo/minlengthpaths.h
- Timestamp:
- 09/14/04 12:29:47 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/minlengthpaths.h
r788 r851 67 67 ///Runs the algorithm. 68 68 ///Returns k if there are at least k edge-disjoint paths from s to t. 69 ///Otherwise it returns the number of found edge-disjoint paths from s to t.69 ///Otherwise it returns the number of found edge-disjoint paths from s to t. 70 70 int run(Node s, Node t, int k) { 71 71 … … 112 112 113 113 114 ///Total length of the paths 115 114 116 ///This function gives back the total length of the found paths. 115 ///Assumes that \c run() has been run and nothing changed since then. 117 ///\pre \ref run() must 118 ///be called before using this function. 116 119 Length totalLength(){ 117 120 return mincost_flow.totalLength(); 118 121 } 119 122 120 ///Returns a const reference to the EdgeMap \c flow. \pre \ref run() must 123 ///Return the found flow. 124 125 ///This function returns a const reference to the EdgeMap \c flow. 126 ///\pre \ref run() must 121 127 ///be called before using this function. 122 128 const EdgeIntMap &getFlow() const { return mincost_flow.flow;} 123 129 124 ///Returns a const reference to the NodeMap \c potential (the dual solution). 130 /// Return the optimal dual solution 131 132 ///This function returns a const reference to the NodeMap 133 ///\c potential (the dual solution). 125 134 /// \pre \ref run() must be called before using this function. 126 135 const EdgeIntMap &getPotential() const { return mincost_flow.potential;} 127 136 137 ///Checks whether the complementary slackness holds. 138 128 139 ///This function checks, whether the given solution is optimal 129 140 ///Running after a \c run() should return with true 130 ///In this "state of the art" this only checks optimality, doesn't bother with feasibility 141 ///Currently this function only checks optimality, 142 ///doesn't bother with feasibility 131 143 /// 132 144 ///\todo Is this OK here? … … 135 147 } 136 148 149 ///Read the found paths. 150 137 151 ///This function gives back the \c j-th path in argument p. 138 152 ///Assumes that \c run() has been run and nothing changed since then. 139 /// \warning It is assumed that \c p is constructed to be a path of graph \c G. If \c j is not less than the result of previous \c run, then the result here will be an empty path (\c j can be 0 as well). 140 template<typename DirPath> 141 void getPath(DirPath& p, size_t j){ 153 /// \warning It is assumed that \c p is constructed to 154 ///be a path of graph \c G. 155 ///If \c j is not less than the result of previous \c run, 156 ///then the result here will be an empty path (\c j can be 0 as well). 157 template<typename Path> 158 void getPath(Path& p, size_t j){ 142 159 143 160 p.clear();
Note: See TracChangeset
for help on using the changeset viewer.