123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
- <title>GTL - Graph Template Library: maxflow_ff.h Source File</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <p class="links">
- <a href="../index.html">Home</a> |
- Documentation |
- <a href="../register.html">Download</a> |
- <a href="../platforms.html">Platforms</a> |
- <a href="../refer.html">Projects</a> |
- <a href="../lists.html">Mailing Lists</a> |
- <a href="../history.html">Version History</a>
- </p>
- <!-- Generated by Doxygen 1.5.3 -->
- <div class="tabs">
- <ul>
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="classes.html"><span>Classes</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- </ul>
- </div>
- <h1>maxflow_ff.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
- <a name="l00002"></a>00002 <span class="comment">//</span>
- <a name="l00003"></a>00003 <span class="comment">// maxflow_ff.h</span>
- <a name="l00004"></a>00004 <span class="comment">//</span>
- <a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
- <a name="l00006"></a>00006 <span class="comment">// $Id: maxflow_ff.h,v 1.5 2003/01/31 08:15:05 chris Exp $</span>
- <a name="l00007"></a>00007
- <a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_MAXFLOW_FF_H</span>
- <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_MAXFLOW_FF_H</span>
- <a name="l00010"></a>00010 <span class="preprocessor"></span>
- <a name="l00011"></a>00011 <span class="preprocessor">#include <GTL/GTL.h></span>
- <a name="l00012"></a>00012 <span class="preprocessor">#include <GTL/graph.h></span>
- <a name="l00013"></a>00013 <span class="preprocessor">#include <GTL/node_map.h></span>
- <a name="l00014"></a>00014 <span class="preprocessor">#include <GTL/edge_map.h></span>
- <a name="l00015"></a>00015 <span class="preprocessor">#include <GTL/algorithm.h></span>
- <a name="l00016"></a>00016
- <a name="l00017"></a>00017 <span class="preprocessor">#include <queue></span>
- <a name="l00018"></a>00018
- <a name="l00019"></a>00019 __GTL_BEGIN_NAMESPACE
- <a name="l00020"></a>00020
- <a name="l00024"></a><a class="code" href="a00015.html">00024</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00015.html" title="Maximum flow algorithm (Edmonds-Karp).">maxflow_ff</a> : <span class="keyword">public</span> <a class="code" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a>
- <a name="l00025"></a>00025 {
- <a name="l00026"></a>00026 <span class="keyword">public</span>:
- <a name="l00033"></a>00033 <a class="code" href="a00015.html" title="Maximum flow algorithm (Edmonds-Karp).">maxflow_ff</a>();
- <a name="l00034"></a>00034
- <a name="l00040"></a>00040 <span class="keyword">virtual</span> ~<a class="code" href="a00015.html" title="Maximum flow algorithm (Edmonds-Karp).">maxflow_ff</a>();
- <a name="l00041"></a>00041
- <a name="l00049"></a>00049 <span class="keywordtype">void</span> set_vars(<span class="keyword">const</span> <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<double></a>& edge_capacity);
- <a name="l00050"></a>00050
- <a name="l00058"></a>00058 <span class="keywordtype">void</span> set_vars(
- <a name="l00059"></a>00059 <span class="keyword">const</span> <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<double></a>& edge_capacity,
- <a name="l00060"></a>00060 <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>& net_source,
- <a name="l00061"></a>00061 <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>& net_target);
- <a name="l00062"></a>00062
- <a name="l00080"></a>00080 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00001.html#76361fb03ad1cf643affc51821e43bed" title="Checks whether all preconditions are satisfied.">check</a>(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00081"></a>00081
- <a name="l00090"></a>00090 <span class="keywordtype">int</span> <a class="code" href="a00001.html#734b189509a8d6b56b65f8ff772d43ca" title="Applies algorithm to graph g.">run</a>(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00091"></a>00091
- <a name="l00098"></a>00098 <span class="keywordtype">double</span> get_max_flow(<span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>& e) <span class="keyword">const</span>;
- <a name="l00099"></a>00099
- <a name="l00105"></a>00105 <span class="keywordtype">double</span> get_max_flow() <span class="keyword">const</span>;
- <a name="l00106"></a>00106
- <a name="l00113"></a>00113 <span class="keywordtype">double</span> get_rem_cap(<span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>& e) <span class="keyword">const</span>;
- <a name="l00114"></a>00114
- <a name="l00121"></a>00121 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00001.html#21aba63d066ae7897de6ca7d8425c408" title="Resets algorithm.">reset</a>();
- <a name="l00122"></a>00122 <span class="keyword">protected</span>:
- <a name="l00126"></a>00126 <span class="keyword">enum</span> {SP_FOUND = 2, NO_SP_FOUND = 3};
- <a name="l00127"></a>00127
- <a name="l00131"></a>00131 <span class="keywordtype">bool</span> artif_source_target;
- <a name="l00132"></a>00132
- <a name="l00136"></a>00136 <span class="keywordtype">bool</span> set_vars_executed;
- <a name="l00137"></a>00137
- <a name="l00141"></a>00141 <span class="keywordtype">double</span> max_graph_flow;
- <a name="l00142"></a>00142
- <a name="l00146"></a>00146 <a class="code" href="a00020.html" title="A node in a graph.">node</a> net_source;
- <a name="l00147"></a>00147
- <a name="l00151"></a>00151 <a class="code" href="a00020.html" title="A node in a graph.">node</a> net_target;
- <a name="l00152"></a>00152
- <a name="l00156"></a>00156 list<edge> edges_not_org;
- <a name="l00157"></a>00157
- <a name="l00161"></a>00161 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<bool></a> edge_org;
- <a name="l00162"></a>00162
- <a name="l00166"></a>00166 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<bool></a> back_edge_exists;
- <a name="l00167"></a>00167
- <a name="l00171"></a>00171 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<edge></a> back_edge;
- <a name="l00172"></a>00172
- <a name="l00176"></a>00176 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<double></a> edge_capacity;
- <a name="l00177"></a>00177
- <a name="l00181"></a>00181 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map<double></a> edge_max_flow;
- <a name="l00182"></a>00182
- <a name="l00186"></a>00186 <span class="keywordtype">void</span> create_artif_source_target(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00187"></a>00187
- <a name="l00191"></a>00191 <span class="keywordtype">void</span> prepare_run(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00192"></a>00192
- <a name="l00196"></a>00196 <span class="keywordtype">void</span> comp_single_flow(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G, <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map<edge></a>& last_edge);
- <a name="l00197"></a>00197
- <a name="l00201"></a>00201 <span class="keywordtype">int</span> get_sp(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G, <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map<edge></a>& last_edge);
- <a name="l00202"></a>00202
- <a name="l00206"></a>00206 <span class="keywordtype">int</span> comp_sp(
- <a name="l00207"></a>00207 <span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G,
- <a name="l00208"></a>00208 queue<node>& next_nodes,
- <a name="l00209"></a>00209 <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map<bool></a>& visited,
- <a name="l00210"></a>00210 <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map<edge></a>& last_edge);
- <a name="l00211"></a>00211
- <a name="l00215"></a>00215 <span class="keywordtype">double</span> extra_charge(<span class="keyword">const</span> <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map<edge></a>& last_edge) <span class="keyword">const</span>;
- <a name="l00216"></a>00216
- <a name="l00220"></a>00220 <span class="keywordtype">void</span> create_back_edge(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G, <span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>& org_edge);
- <a name="l00221"></a>00221
- <a name="l00225"></a>00225 <span class="keywordtype">void</span> comp_max_flow(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00226"></a>00226
- <a name="l00230"></a>00230 <span class="keywordtype">void</span> restore_graph(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>& G);
- <a name="l00231"></a>00231 };
- <a name="l00232"></a>00232
- <a name="l00233"></a>00233 __GTL_END_NAMESPACE
- <a name="l00234"></a>00234
- <a name="l00235"></a>00235 <span class="preprocessor">#endif // GTL_MAXFLOW_FF_H</span>
- <a name="l00236"></a>00236 <span class="preprocessor"></span>
- <a name="l00237"></a>00237 <span class="comment">//--------------------------------------------------------------------------</span>
- <a name="l00238"></a>00238 <span class="comment">// end of file</span>
- <a name="l00239"></a>00239 <span class="comment">//--------------------------------------------------------------------------</span>
- </pre></div> <p class="links">
- <a href="http://www.uni-passau.de/">University of Passau</a>
- -
- <a href="http://www.fmi.uni-passau.de/">FMI</a>
- -
- <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
- Computer Science</a>
- </p>
- <div class="copyright">
- Design © 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
- </div>
- </body>
- </html>
|