4 // Copyright (c) 2006, Stephan Diederich
6 // This code may be used under either of the following two licences:
8 // Permission is hereby granted, free of charge, to any person
9 // obtaining a copy of this software and associated documentation
10 // files (the "Software"), to deal in the Software without
11 // restriction, including without limitation the rights to use,
12 // copy, modify, merge, publish, distribute, sublicense, and/or
13 // sell copies of the Software, and to permit persons to whom the
14 // Software is furnished to do so, subject to the following
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22 // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 // OTHER DEALINGS IN THE SOFTWARE. OF SUCH DAMAGE.
31 // Distributed under the Boost Software License, Version 1.0.
32 // (See accompanying file LICENSE_1_0.txt or copy at
33 // http://www.boost.org/LICENSE_1_0.txt)
37 <Title>Boost Graph Library: write_dimacs_max_flow
</Title>
38 <BODY BGCOLOR=
"#ffffff" LINK=
"#0000ee" TEXT=
"#000000" VLINK=
"#551a8b"
40 <IMG SRC=
"../../../boost.png"
41 ALT=
"C++ Boost" width=
"277" height=
"86">
44 <H1><A NAME=
"sec:write_dimacs_max_flow">
45 <TT>write_dimacs_max_flow
</TT>
50 //outputs a graph with including edge_capacity properties to an std::ostream
51 template
< typename Graph, typename CapacityMap, typename IndexMap
>
52 void write_dimacs_max_flow(Graph& g,
55 typename graph_traits
<Graph>::vertex_descriptor& src,
56 typename graph_traits
<Graph>::vertex_descriptor& sink,
62 This method writes a BGL graph object as an max-flow problem into an output stream in extended dimacs format (see
<a href=
"http://www.avglab.com/andrew/CATS/maxflow_formats.htm"><TT>Goldbergs site
</TT></a> for more information).
63 The output can be read in again using the
<a href=
"../../../boost/graph/read_dimacs.hpp"><TT>boost/graph/read_dimacs.hpp
</TT></a> method.
65 <H3>Where Defined
</H3>
68 <a href=
"../../../boost/graph/write_dimacs.hpp"><TT>boost/graph/write_dimacs.hpp
</TT></a>
71 IN:
<tt>Graph
& g
</tt>
73 A directed or undirected graph. The graph's type must be a model of
74 <a href=
"./VertexListGraph.html">VertexListGraph
</a> and
<a href=
"./EdgeListGraph.html">EdgeListGraph
</a>, as num_vertices(Graph) and num_edges(Graph) is used inside.
<a href=
"#1">[
1]
</a>
77 IN:
<tt>CapacityMap capacity
</tt>
79 A property map that models
<a href=
"../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
</a> whose key type is the edge descriptor of the graph and whose value type can be written to a stream.
<br>
82 IN:
<tt>IndexMap epw
</tt>
84 A property map that models
<a href=
"../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
</a> whose key type is the vertex descriptor of the graph and whose value type can be written to a stream.
<br>
87 OUT:
<tt>std::ostream
& out
</tt>
89 A standard
<tt>std::ostream
</tt> object.
95 A short
<a href=
"../example/read_write_dimacs-eg.cpp">example
</a> which uses read_dimacs and write_dimacs is located in the examples directory.
99 <a href=
"./read_dimacs.html"><tt>read_dimacs
</tt></a>
102 <a name=
"1">[
1]
</a> As num_edges() and num_vertices() is used inside which returns values for the unfiltered graph (instead of the filtered), this method cannot be used with a
<a href=
"./filtered_graph.html">filtered_graph
</a>See
<a href=
"./filtered_graph.html#2">filtered_graph Note [
2]
</a> for the reason.