mirror of
https://github.com/boostorg/graph.git
synced 2025-05-09 15:03:59 +00:00
Applied clang-format and stripped all trailing whitespace.
This commit is contained in:
parent
b3f9fa1284
commit
8747675e12
@ -177,7 +177,7 @@ matrix:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
|
||||
# Fails to compile std lib headers (toolset issue):
|
||||
#- os: linux
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||
|
10
README.md
10
README.md
@ -18,24 +18,24 @@ There is no mailing-list specific to Boost Graph, although you can use the gener
|
||||
|
||||
## Development ##
|
||||
|
||||
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
|
||||
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
|
||||
|
||||
git clone https://github.com/boostorg/boost
|
||||
cd boost
|
||||
git submodule update --init
|
||||
|
||||
The Boost Graph Library is located in `libs/graph/`.
|
||||
The Boost Graph Library is located in `libs/graph/`.
|
||||
|
||||
Boost Graph Library is mostly made of headers but also contains some compiled components. Here are the build commands:
|
||||
|
||||
./bootstrap.sh <- compile b2
|
||||
|
||||
./bootstrap.sh <- compile b2
|
||||
./b2 headers <- just installs headers
|
||||
./b2 <- build compiled components
|
||||
|
||||
**Note:** The Boost Graph Library cannot currently be built outside of Boost itself.
|
||||
|
||||
### Running tests ###
|
||||
First, make sure you are in `libs/graph/test`.
|
||||
First, make sure you are in `libs/graph/test`.
|
||||
You can either run all the 300+ tests listed in `Jamfile.v2` or run a single test:
|
||||
|
||||
../../../b2 <- run all tests
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004 Kris Beevers
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: AStarHeuristic</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -135,4 +135,4 @@ HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004 Kris Beevers
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: AStarVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -210,4 +210,4 @@ HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,21 +1,21 @@
|
||||
<html>
|
||||
<head>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
-->
|
||||
<title>AddEdgeVisitor Concept</title>
|
||||
</head>
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
|
||||
<br clear="">
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
The AddEdgeVisitor concept exists to allow for some indirection in algorithms
|
||||
that modify graphs by adding edges. In such algorithms, it may be convenient
|
||||
to perform additional operations (such as updating an edge index map) at
|
||||
to perform additional operations (such as updating an edge index map) at
|
||||
points in the algorithm where an edge addition occurs. Replacing calls to
|
||||
to <tt>add_edge</tt> with calls to <tt>AddEdgeVisitor::visit_vertex_pair</tt>
|
||||
allows for such operations to be defined independently from the algorithm.
|
||||
@ -38,8 +38,8 @@ allows for such operations to be defined independently from the algorithm.
|
||||
<td> is a type that models the AddEdgeVisitor concept </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>vis</tt> </td>
|
||||
<tr>
|
||||
<td> <tt>vis</tt> </td>
|
||||
<td> is an object of type Visitor </td>
|
||||
</tr>
|
||||
|
||||
@ -48,15 +48,15 @@ allows for such operations to be defined independently from the algorithm.
|
||||
<td> is the type of a graph </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>u,v</tt> </td>
|
||||
<tr>
|
||||
<td> <tt>u,v</tt> </td>
|
||||
<td> are objects of type <tt>graph_traits<Graph>::vertex_descriptor</tt>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -66,7 +66,7 @@ allows for such operations to be defined independently from the algorithm.
|
||||
</td>
|
||||
|
||||
</tr><tr>
|
||||
<td>
|
||||
<td>
|
||||
|
||||
</td></tr></tbody></table>
|
||||
|
||||
@ -84,7 +84,7 @@ None
|
||||
<tbody><tr><th>Name</th><th>Expression</th><th>Return Type</th>
|
||||
<th>Description</th>
|
||||
|
||||
</tr><tr>
|
||||
</tr><tr>
|
||||
<td> Add an Edge </td>
|
||||
<td> <tt>vis.visit_vertex_pair(u, v, g)</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
@ -96,26 +96,26 @@ None
|
||||
|
||||
</p><h3>Models</h3>
|
||||
|
||||
Two models of this concept are defined in the file
|
||||
Two models of this concept are defined in the file
|
||||
<a href="../../../boost/graph/planar_detail/add_edge_visitors.hpp">
|
||||
<tt>add_edge_visitors.hpp</tt></a>:
|
||||
|
||||
<ul>
|
||||
<li><tt>default_add_edge_visitor</tt>: The constructor of this class takes
|
||||
no arguments.<tt>visit_vertex_pair(u, v, g)</tt> is just a dispatch to
|
||||
<tt>add_edge(u, v, g)</tt>.
|
||||
<tt>add_edge(u, v, g)</tt>.
|
||||
<li><tt>edge_index_update_visitor</tt>: The constructor of this class takes
|
||||
two arguments: the first, an EdgeIndexMap,
|
||||
is a <a href="../../property_map/doc/ReadWritePropertyMap.html">
|
||||
ReadWritePropertyMap</a> that maps each edge in the associated graph
|
||||
<tt>g</tt> to a distinct integer in the range <tt>[0, num_edges(g))</tt>.
|
||||
The second argument is the number of edges in the underlying graph, which
|
||||
ReadWritePropertyMap</a> that maps each edge in the associated graph
|
||||
<tt>g</tt> to a distinct integer in the range <tt>[0, num_edges(g))</tt>.
|
||||
The second argument is the number of edges in the underlying graph, which
|
||||
serves as the "next available index" counter within the visitor.
|
||||
For example, in the case the graph used has an initialized interior
|
||||
edge index, the <tt>edge_index_update_visitor</tt> constructor should be
|
||||
called with <tt>get(edge_index, g)</tt> as the edge index and
|
||||
<tt>num_edges(g)</tt> as the next available index. When
|
||||
<tt>visit_vertex_pair(u, v, g)</tt> is called, the
|
||||
For example, in the case the graph used has an initialized interior
|
||||
edge index, the <tt>edge_index_update_visitor</tt> constructor should be
|
||||
called with <tt>get(edge_index, g)</tt> as the edge index and
|
||||
<tt>num_edges(g)</tt> as the next available index. When
|
||||
<tt>visit_vertex_pair(u, v, g)</tt> is called, the
|
||||
<tt>edge_index_update_visitor</tt> will add the edge <i>(u,v)</i> to the graph
|
||||
and update the edge index for the newly created edge.
|
||||
</ul>
|
||||
@ -125,6 +125,6 @@ and update the edge index for the newly created edge.
|
||||
<br>
|
||||
</p><hr>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
aaron.windsor@gmail.com</a>)
|
||||
|
||||
</body></html>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>AdjacencyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -164,4 +164,4 @@ experience with graph algorithm implementations.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>AdjacencyMatrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -100,4 +100,4 @@ The <TT>edge()</TT> function must return in constant time.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: BFSVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -142,7 +142,7 @@ edges for undirected graphs.
|
||||
<td>
|
||||
This is invoked on the subset of non-tree edges whose target vertex is
|
||||
colored gray at the time of examination. The color gray indicates
|
||||
that the vertex is currently in the queue.
|
||||
that the vertex is currently in the queue.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -217,4 +217,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>BasicMatrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -78,11 +78,11 @@ Element access is constant time.
|
||||
void constraints() {
|
||||
V& elt = A[i][j];
|
||||
const_constraints(A);
|
||||
ignore_unused_variable_warning(elt);
|
||||
ignore_unused_variable_warning(elt);
|
||||
}
|
||||
void const_constraints(const M& A) {
|
||||
const V& elt = A[i][j];
|
||||
ignore_unused_variable_warning(elt);
|
||||
ignore_unused_variable_warning(elt);
|
||||
}
|
||||
M A;
|
||||
I i, j;
|
||||
@ -100,4 +100,4 @@ HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bellman Ford Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -181,4 +181,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Bidirectional</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -177,4 +177,4 @@ undirected graphs).
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,10 +9,10 @@
|
||||
<Head>
|
||||
<Title>Buffer</Title>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -43,7 +43,7 @@ For a type to model the Buffer concept it must have the following members.
|
||||
|
||||
<tr> <td><b>Member</b></td> <td><b>Description</b></td> </tr>
|
||||
|
||||
<tr> <td> <tt>value_type</tt> </td>
|
||||
<tr> <td> <tt>value_type</tt> </td>
|
||||
<td> The type of object stored in the Buffer. The value type
|
||||
must be <A href="http://www.boost.org/sgi/stl/Assignable.html">Assignable</a>.</td>
|
||||
</tr>
|
||||
@ -70,7 +70,7 @@ For a type to model the Buffer concept it must have the following members.
|
||||
</tr>
|
||||
|
||||
<tr> <td> <tt>const T& top() const</tt> </td>
|
||||
<td> Returns a const reference to some object in the Buffer.
|
||||
<td> Returns a const reference to some object in the Buffer.
|
||||
Precondition: <tt>empty()</tt> is <tt>false</tt>.</td>
|
||||
</tr>
|
||||
|
||||
@ -114,5 +114,5 @@ most linear time complexity in the size of the Generalized Queue.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: ColorValue Concept</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -105,4 +105,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>DFS Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -150,15 +150,15 @@ undirected graph this method is never called.
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Finish Edge</td>
|
||||
<td><tt>vis.finish_edge(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on each non-tree edge as well as on each tree edge after
|
||||
<tt>finish_vertex</tt> has been called on its target vertex.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Finish Edge</td>
|
||||
<td><tt>vis.finish_edge(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on each non-tree edge as well as on each tree edge after
|
||||
<tt>finish_vertex</tt> has been called on its target vertex.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Finish Vertex</td>
|
||||
<td><tt>vis.finish_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
@ -218,4 +218,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Dijkstra Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -219,4 +219,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>EdgeListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -109,7 +109,7 @@ Return type: <TT>vertex_descriptor</TT>
|
||||
<tr>
|
||||
<TD><TT>target(e, g)</TT></TD>
|
||||
<TD>
|
||||
Returns the vertex descriptor for
|
||||
Returns the vertex descriptor for
|
||||
<i>v</i> of the edge <i>(u,v)</i> represented by <TT>e</TT>.<br>
|
||||
Return type: <TT>vertex_descriptor</TT>
|
||||
</TD>
|
||||
@ -143,7 +143,7 @@ must all return in constant time.
|
||||
template <class G>
|
||||
struct EdgeListGraphConcept
|
||||
{
|
||||
typedef typename boost::graph_traits<G>::edge_iterator
|
||||
typedef typename boost::graph_traits<G>::edge_iterator
|
||||
edge_iterator;
|
||||
void constraints() {
|
||||
BOOST_CONCEPT_ASSERT(( GraphConcept<G> ));
|
||||
@ -181,4 +181,4 @@ must all return in constant time.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Edge Mutable Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -35,7 +35,7 @@ No additional associated types.
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a name="sec:add_edge"><TT>add_edge(u, v, g)</TT></a>
|
||||
<li><a name="sec:add_edge"><TT>add_edge(u, v, g)</TT></a>
|
||||
<b>returns</b> <TT>std::pair<edge_descriptor, bool></TT>
|
||||
<br><br>
|
||||
|
||||
@ -105,4 +105,4 @@ UNDER CONSTRUCTION
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: EventVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -158,4 +158,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: EventVisitorList</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -124,4 +124,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -85,8 +85,8 @@ are <TT>allow_parallel_edge_tag</TT> and <TT>disallow_parallel_edge_tag</TT>.
|
||||
<td><pre>boost::graph_traits<G>::traversal_category</pre>
|
||||
This describes the ways in which the vertices and edges of the
|
||||
graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
|
||||
<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
|
||||
<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
|
||||
<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
|
||||
<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
|
||||
<TT>adjacency_matrix_tag</TT>.
|
||||
</td>
|
||||
</tr>
|
||||
@ -145,4 +145,4 @@ any vertex of graph object which type is <tt>G</tt>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>IncidenceGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -199,4 +199,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>IteratorConstructibleGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -51,13 +51,13 @@ and can therefore be used to construct a graph.
|
||||
typedef ... IteratorConstructibleGraph;
|
||||
typedef boost::graph_traits<IteratorConstructibleGraph> Traits;
|
||||
|
||||
typedef std::pair<Traits::vertices_size_type,
|
||||
typedef std::pair<Traits::vertices_size_type,
|
||||
Traits::vertices_size_type> Edge;
|
||||
Edge edge_array[] =
|
||||
{ Edge(0,1), Edge(0,2), Edge(0,3), Edge(0,4), Edge(0,5),
|
||||
Edge(1, 2), Edge(1,5), Edge(1,3),
|
||||
Edge(2, 4), Edge(2,5),
|
||||
Edge(3, 2),
|
||||
Edge(3, 2),
|
||||
Edge(4, 3), Edge(4,1),
|
||||
Edge(5, 4) };
|
||||
Edge* first = edge_array,
|
||||
@ -65,7 +65,7 @@ and can therefore be used to construct a graph.
|
||||
|
||||
IteratorConstructibleGraph G1(first, last);
|
||||
// do something with G1 ...
|
||||
|
||||
|
||||
Traits::vertices_size_type size_V = 6;
|
||||
Traits::edges_size_type size_E = sizeof(edge_array)/sizeof(Edge);
|
||||
IteratorConstructibleGraph G2(first, last, size_V, size_E);
|
||||
@ -158,4 +158,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<head>
|
||||
<title>KeyedUpdatableQueue</title>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<img src="../../../boost.png" alt="C++ Boost">
|
||||
|
||||
<h2><a name="concept:KeyedUpdatableQueue">KeyedUpdatableQueue</a></h2>
|
||||
@ -28,7 +28,7 @@ values are mapped via a read/write key map.
|
||||
|
||||
<h3>Members</h3>
|
||||
|
||||
For a type to model the KeyedUpdatableQueue concept it must have the following members
|
||||
For a type to model the KeyedUpdatableQueue concept it must have the following members
|
||||
in addition to the members that are required of types that model <a href="./UpdatableQueue.html">UpdatableQueue</a>:
|
||||
|
||||
<p>
|
||||
@ -61,17 +61,17 @@ in addition to the members that are required of types that model <a href="./Upda
|
||||
{
|
||||
typedef typename Q::key_type key_type;
|
||||
typedef typename Q::key_map key_map;
|
||||
|
||||
|
||||
void constraints() {
|
||||
BOOST_CONCEPT_ASSERT(( UpdatableQueue<Q> ));
|
||||
BOOST_CONCEPT_ASSERT(( ReadWritePropertyMap< key_map, typename Buffer<Q>::value_type > ));
|
||||
}
|
||||
|
||||
|
||||
void const_constraints(const Q& cq) {
|
||||
km = cq.keys();
|
||||
k = get(km, g_ct);
|
||||
}
|
||||
|
||||
|
||||
static const typename Buffer<Q>::value_type g_ct;
|
||||
key_type k;
|
||||
key_map km;
|
||||
|
@ -41,7 +41,7 @@ RESULT = pdf
|
||||
epstopdf $*.eps
|
||||
|
||||
.dot.eps:
|
||||
dot -Tps -o $*.eps $*.dot
|
||||
dot -Tps -o $*.eps $*.dot
|
||||
|
||||
.w.tex: /afs/nd.edu/user11/jsiek/.jweb
|
||||
jweb -np $*.w
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Monoid</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -119,4 +119,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>MutableGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -59,7 +59,7 @@ edges and vertices.
|
||||
<TD><tt>p</tt></TD>
|
||||
<TD>is an object of a type that models <a
|
||||
href="http://www.boost.org/sgi/stl/Predicate.html">Predicate</a>
|
||||
and whose argument type matches the <tt>edge_descriptor</tt> type.
|
||||
and whose argument type matches the <tt>edge_descriptor</tt> type.
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
@ -296,4 +296,4 @@ is no longer a valid vertex descriptor.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>MutablePropertyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -147,4 +147,4 @@ Return type: <TT>vertex_descriptor</TT>
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,18 +1,18 @@
|
||||
<html><head><!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
-->
|
||||
<title>Planar Embedding Concept</title>
|
||||
</head>
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
|
||||
<br clear="">
|
||||
|
||||
@ -21,12 +21,12 @@
|
||||
|
||||
A planar embedding is an important intermediate representation of a drawing
|
||||
of a planar graph. Instead of specifying the absolute positions of the vertices
|
||||
and edges in the plane, a planar embedding specifies their positions relative
|
||||
to one another. A planar embedding consists of a sequence, for each vertex in
|
||||
the graph, of all of the edges incident on that vertex in the order in which
|
||||
and edges in the plane, a planar embedding specifies their positions relative
|
||||
to one another. A planar embedding consists of a sequence, for each vertex in
|
||||
the graph, of all of the edges incident on that vertex in the order in which
|
||||
they are to be drawn around that vertex.
|
||||
<p>
|
||||
A planar embedding is a refinement of
|
||||
A planar embedding is a refinement of
|
||||
<a href="../../property_map/doc/LvaluePropertyMap.html">LValuePropertyMap</a> that
|
||||
places additional restrictions the <tt>value_type</tt> used in the property
|
||||
map.
|
||||
@ -36,24 +36,24 @@ map.
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Embedding</tt> </td>
|
||||
<tr>
|
||||
<td> <tt>Embedding</tt> </td>
|
||||
<td> is a type that models the Planar Embedding concept.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
<td> <tt>embedding</tt> </td>
|
||||
<td> is an object of type <tt>Embedding</tt>. </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Graph</tt> </td>
|
||||
<tr>
|
||||
<td> <tt>Graph</tt> </td>
|
||||
<td> is the type of the underlying graph.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>.
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -63,7 +63,7 @@ map.
|
||||
</tt>.</td>
|
||||
|
||||
</tr><tr>
|
||||
<td>
|
||||
<td>
|
||||
|
||||
</td></tr></tbody></table>
|
||||
|
||||
@ -72,12 +72,12 @@ map.
|
||||
|
||||
<table border="1">
|
||||
|
||||
<tbody><tr>
|
||||
<tbody><tr>
|
||||
<td> Const Iterator </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt>
|
||||
</td>
|
||||
<td> The iterator type used to iterate over the ordering of the edges in the
|
||||
<td> The iterator type used to iterate over the ordering of the edges in the
|
||||
planar embedding of a particular vertex
|
||||
</td>
|
||||
</tr>
|
||||
@ -92,32 +92,32 @@ planar embedding of a particular vertex
|
||||
|
||||
<tbody><tr><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
|
||||
</tr><tr>
|
||||
</tr><tr>
|
||||
<td> <tt>embedding[v].begin()</tt> </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt></td>
|
||||
<td> Returns an iterator to the beginning of the range of edges in the
|
||||
<td> Returns an iterator to the beginning of the range of edges in the
|
||||
embedding around vertex v</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
<td> <tt>embedding[v].end()</tt> </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt></td>
|
||||
<td> Returns an iterator to the end of the range of edges in the
|
||||
<td> Returns an iterator to the end of the range of edges in the
|
||||
embedding around vertex v</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
<td> <tt>embedding[v].clear()</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
<td> Clears all edges in the embedding around a vertex <tt>v</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
<td> <tt>embedding[v].push_back(e)</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
<td> Adds an edge <tt>e</tt> to the end of the sequence of embedded edges
|
||||
<td> Adds an edge <tt>e</tt> to the end of the sequence of embedded edges
|
||||
around the vertex <tt>v</tt> </td>
|
||||
</tr>
|
||||
|
||||
@ -126,12 +126,12 @@ planar embedding of a particular vertex
|
||||
</p><h3>Complexity Guarantees</h3>
|
||||
|
||||
Starting with an empty embedding, any mixed sequence of <i>n</i> calls to a
|
||||
particular vertex's <tt>push_back</tt> and <tt>clear</tt> should take
|
||||
particular vertex's <tt>push_back</tt> and <tt>clear</tt> should take
|
||||
<i>O(n)</i> time.
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
Any LValue property map that maps vertices to a <tt>std::vector</tt>,
|
||||
Any LValue property map that maps vertices to a <tt>std::vector</tt>,
|
||||
<tt>std::list</tt>, or <tt>std::deque</tt> models this
|
||||
concept. Below is an example of using this approach to create a model of
|
||||
PlanarEmbedding:
|
||||
@ -146,7 +146,7 @@ PlanarEmbedding:
|
||||
// an instance of Graph in a variable g.
|
||||
|
||||
// A typedef for the storage - a vector of vectors of edge descriptors
|
||||
typedef
|
||||
typedef
|
||||
std::vector< std::vector< graph_traits<Graph>::edge_descriptor > >
|
||||
planar_embedding_storage_t;
|
||||
|
||||
@ -173,6 +173,6 @@ planar_embedding_t planar_embedding(planar_embedding_storage.begin(),
|
||||
<br>
|
||||
</p><hr>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
aaron.windsor@gmail.com</a>)
|
||||
|
||||
</body></html>
|
||||
|
@ -1,28 +1,28 @@
|
||||
<HTML>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
-->
|
||||
<HEAD>
|
||||
<TITLE>Planar Face Visitor Concept</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>Planar Face Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for
|
||||
<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a>.
|
||||
Users can define a class with the Planar Face Visitor interface and pass an
|
||||
object of the class to <tt>planar_face_traversal</tt>, thereby augmenting the
|
||||
actions taken during the traversal. Note that objects passed to
|
||||
This concept defines the visitor interface for
|
||||
<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a>.
|
||||
Users can define a class with the Planar Face Visitor interface and pass an
|
||||
object of the class to <tt>planar_face_traversal</tt>, thereby augmenting the
|
||||
actions taken during the traversal. Note that objects passed to
|
||||
<tt>planar_face_traversal</tt> are passed by reference.
|
||||
|
||||
<h3>Notation</h3>
|
||||
@ -79,8 +79,8 @@ This is invoked once per traversal, before the traversal begins.
|
||||
<td><tt>vis.begin_face()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once for each face, before any vertices or edges on the face
|
||||
are visited.
|
||||
This is invoked once for each face, before any vertices or edges on the face
|
||||
are visited.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -108,7 +108,7 @@ This is invoked when an edge is encountered while traversing a face.
|
||||
<td><tt>vis.end_face()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once for each face, after all vertices and edges on the face
|
||||
This is invoked once for each face, after all vertices and edges on the face
|
||||
are visited.
|
||||
</td>
|
||||
</tr>
|
||||
@ -129,13 +129,13 @@ This is invoked once per traversal, after the traversal ends.
|
||||
|
||||
<ul>
|
||||
<li> The file <a href="../../../boost/graph/planar_face_traversal.hpp">
|
||||
<tt>planar_face_traversal.hpp</tt></a> contains a class
|
||||
<tt>planar_face_traversal.hpp</tt></a> contains a class
|
||||
<tt>planar_face_traversal_visitor</tt> that implements empty actions for
|
||||
all event points of a Planar Face Visitor. In the case where only a few of the
|
||||
all event points of a Planar Face Visitor. In the case where only a few of the
|
||||
event points of Planar Face Visitor need to be implemented, one can derive from
|
||||
<tt>planar_face_traversal_visitor</tt> and only implement the necessary event
|
||||
<tt>planar_face_traversal_visitor</tt> and only implement the necessary event
|
||||
points. <li> The implementation of <a href="./make_maximal_planar.html">
|
||||
<tt>make_maximal_planar</tt></a> uses a <tt>triangulation_visitor</tt> that is
|
||||
<tt>make_maximal_planar</tt></a> uses a <tt>triangulation_visitor</tt> that is
|
||||
a model of Planar Face Visitor.
|
||||
</li>
|
||||
</ul>
|
||||
@ -145,4 +145,4 @@ a model of Planar Face Visitor.
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>PropertyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -90,7 +90,7 @@ function which returns a property map object.
|
||||
<td><pre>boost::property_map<G, PropertyTag>::type</pre>
|
||||
The type of the property map for the property specified by
|
||||
<TT>PropertyTag</TT>. This type must be a model of <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
|
||||
with a key type the same as the graph's vertex or edge descriptor type.
|
||||
</td>
|
||||
</tr>
|
||||
@ -207,4 +207,4 @@ The <tt>get()</tt> property map function must be constant time.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Property</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -67,7 +67,7 @@ href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></
|
||||
<h3>Refinement of</h3>
|
||||
|
||||
<a
|
||||
href="http://www.boost.org/sgi/stl/DefaultConstructible.html">Default Constructible</a>
|
||||
href="http://www.boost.org/sgi/stl/DefaultConstructible.html">Default Constructible</a>
|
||||
|
||||
|
||||
<h3>Models</h3>
|
||||
@ -114,4 +114,4 @@ type is also required to specialize
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<head>
|
||||
<title>UpdatableQueue</title>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<img src="../../../boost.png" alt="C++ Boost">
|
||||
|
||||
<h2><a name="concept:UpdatableQueue">UpdatableQueue</a></h2>
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
<h3>Members</h3>
|
||||
|
||||
For a type to model the UpdatableQueue concept it must have the following members
|
||||
For a type to model the UpdatableQueue concept it must have the following members
|
||||
in addition to the members that are required of types that model <a href="./Buffer.html">Buffer</a>:
|
||||
|
||||
<p>
|
||||
@ -59,14 +59,14 @@ in addition to the members that are required of types that model <a href="./Buff
|
||||
{
|
||||
void constraints() {
|
||||
BOOST_CONCEPT_ASSERT(( Buffer<Q> ));
|
||||
|
||||
|
||||
q.update(g_ct);
|
||||
}
|
||||
|
||||
|
||||
void const_constraints(const Q& cq) {
|
||||
if (cq.contains(g_ct));
|
||||
}
|
||||
|
||||
|
||||
static const typename Buffer<Q>::value_type g_ct;
|
||||
Q q;
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>VertexAndEdgeListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -27,7 +27,7 @@ requirements are added.
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
<a href="./VertexListGraph.html">VertexListGraph</a>,
|
||||
<a href="./VertexListGraph.html">VertexListGraph</a>,
|
||||
<a href="./EdgeListGraph.html">EdgeListGraph</a>
|
||||
|
||||
|
||||
@ -67,4 +67,4 @@ requirements are added.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>VertexListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -118,7 +118,7 @@ groups these requirements together, hence the VertexListGraph concept.
|
||||
template <class G>
|
||||
struct VertexListGraphConcept
|
||||
{
|
||||
typedef typename boost::graph_traits<G>::vertex_iterator
|
||||
typedef typename boost::graph_traits<G>::vertex_iterator
|
||||
vertex_iterator;
|
||||
void constraints() {
|
||||
BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<G> ));
|
||||
@ -151,4 +151,4 @@ groups these requirements together, hence the VertexListGraph concept.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Vertex Mutable Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -37,7 +37,7 @@ No additional associated types.
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<ul>
|
||||
<li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a>
|
||||
<li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a>
|
||||
<b>returns</b> <TT>vertex_descriptor</TT>
|
||||
<br><br>
|
||||
|
||||
@ -56,7 +56,7 @@ No additional associated types.
|
||||
<br>
|
||||
<b> Postconditions: </b> <TT>num_vertices(g)</TT> is one less; <i>u</i>
|
||||
no longer appears in the vertex set of the graph and it
|
||||
is no longer a valid vertex descriptor.
|
||||
is no longer a valid vertex descriptor.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -64,7 +64,7 @@ No additional associated types.
|
||||
<H3>Complexity guarantees</H3>
|
||||
<ul>
|
||||
<li> Vertex insertion is guaranteed to be amortized constant time.
|
||||
|
||||
|
||||
<li> Vertex removal is at most <TT>O(|E| + |V|)</TT>.
|
||||
</ul>
|
||||
|
||||
@ -79,5 +79,5 @@ No additional associated types.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Acknowledgements</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -73,4 +73,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<html>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Graph Traits</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -155,4 +155,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,23 +1,23 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Adjacency Matrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:adjacency-matrix-class"></A>
|
||||
<pre>
|
||||
adjacency_matrix<Directed, VertexProperty,
|
||||
adjacency_matrix<Directed, VertexProperty,
|
||||
EdgeProperty, GraphProperty,
|
||||
Allocator>
|
||||
</pre>
|
||||
@ -61,7 +61,7 @@ href="adjacency_list.html"><tt>adjacency_list</tt></a>. These may be
|
||||
<a
|
||||
href="using_adjacency_list.html#sec:adjacency-list-properties">interior
|
||||
properties</a>. The types of all property values must be
|
||||
Copy Constructible, Assignable and Default Constructible.
|
||||
Copy Constructible, Assignable and Default Constructible.
|
||||
|
||||
In the case of an undirected graph, the
|
||||
<tt>adjacency_matrix</tt>. class does not use a full <i>V x V</i>
|
||||
@ -83,11 +83,11 @@ matrix representation of an undirected graph.
|
||||
|
||||
<h3>Example</h3>
|
||||
|
||||
Creating the graph of <a href="#fig:adj-matrix-graph">Figure 1</a>.
|
||||
Creating the graph of <a href="#fig:adj-matrix-graph">Figure 1</a>.
|
||||
<pre>
|
||||
enum { A, B, C, D, E, F, N };
|
||||
const char* name = "ABCDEF";
|
||||
|
||||
|
||||
typedef boost::adjacency_matrix<boost::directedS> Graph;
|
||||
Graph g(N);
|
||||
add_edge(B, C, g);
|
||||
@ -112,17 +112,17 @@ Creating the graph of <a href="#fig:adj-matrix-graph">Figure 1</a>.
|
||||
</pre>
|
||||
The output is:
|
||||
<pre>
|
||||
vertex set: A B C D E F
|
||||
vertex set: A B C D E F
|
||||
|
||||
edge set: (B,C) (B,F) (C,A) (C,C) (D,E) (E,D) (F,A)
|
||||
edge set: (B,C) (B,F) (C,A) (C,C) (D,E) (E,D) (F,A)
|
||||
|
||||
out-edges:
|
||||
A -->
|
||||
B --> C F
|
||||
C --> A C
|
||||
D --> E
|
||||
E --> D
|
||||
F --> A
|
||||
out-edges:
|
||||
A -->
|
||||
B --> C F
|
||||
C --> A C
|
||||
D --> E
|
||||
E --> D
|
||||
F --> A
|
||||
</pre>
|
||||
|
||||
Creating the graph of <a href="#fig:undir-adj-matrix-graph">Figure 2</a>.
|
||||
@ -152,17 +152,17 @@ Creating the graph of <a href="#fig:undir-adj-matrix-graph">Figure 2</a>.
|
||||
</pre>
|
||||
The output is:
|
||||
<pre>
|
||||
vertex set: A B C D E F
|
||||
vertex set: A B C D E F
|
||||
|
||||
edge set: (C,A) (C,B) (E,D) (F,A) (F,B)
|
||||
edge set: (C,A) (C,B) (E,D) (F,A) (F,B)
|
||||
|
||||
incident edges:
|
||||
A <--> C F
|
||||
B <--> C F
|
||||
C <--> A B
|
||||
D <--> E
|
||||
E <--> D
|
||||
F <--> A B
|
||||
incident edges:
|
||||
A <--> C F
|
||||
B <--> C F
|
||||
C <--> A B
|
||||
D <--> E
|
||||
E <--> D
|
||||
F <--> A B
|
||||
</pre>
|
||||
|
||||
|
||||
@ -205,7 +205,7 @@ The output is:
|
||||
|
||||
<h3>Model Of</h3>
|
||||
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./IncidenceGraph.html">Incidence Graph</a>,
|
||||
<a href="./BidirectionalGraph.html">Bidirectional Graph</a>,
|
||||
<a
|
||||
@ -236,7 +236,7 @@ The type for the edge descriptors associated with the
|
||||
<hr>
|
||||
<tt>graph_traits<adjacency_matrix>::vertex_iterator</tt>
|
||||
<br><br>
|
||||
The type for the iterators returned by <tt>vertices()</tt>.
|
||||
The type for the iterators returned by <tt>vertices()</tt>.
|
||||
The vertex iterator models <a href="http://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>. <br>
|
||||
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
|
||||
|
||||
@ -420,7 +420,7 @@ degree_size_type
|
||||
out_degree(vertex_descriptor u, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the number of edges leaving vertex <tt>u</tt>.<br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
<hr>
|
||||
|
||||
<hr>
|
||||
@ -440,7 +440,7 @@ degree_size_type
|
||||
in_degree(vertex_descriptor u, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the number of edges entering vertex <tt>u</tt>.<br>
|
||||
(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)
|
||||
(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)
|
||||
<hr>
|
||||
|
||||
<hr>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004 Kris Beevers
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: astar_heuristic</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -93,4 +93,4 @@ HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004 Kris Beevers
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: A* Heuristic Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -309,7 +309,7 @@ IN: <tt>const VertexListGraph& g</tt>
|
||||
IN: <tt>const IncidenceGraph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied for <tt>astar_search_no_init()</tt>. The type
|
||||
<tt>IncidenceGraph</tt> must be a model of the
|
||||
<tt>IncidenceGraph</tt> must be a model of the
|
||||
<a href="IncidenceGraph.html">Incidence Graph</a>
|
||||
concept.
|
||||
</blockquote>
|
||||
@ -586,4 +586,4 @@ HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004 Kris Beevers
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: astar_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -105,4 +105,4 @@ HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bandwidth</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -90,4 +90,4 @@ of the i-th bandwidths <i>B<sub>i</sub>(G)</i>.<br>
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<!--
|
||||
Copyright (c) 2004 Trustees of Indiana University
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="titlepage"></div>
|
||||
<div class="refnamediv">
|
||||
|
||||
<IMG SRC="../../../boost.png"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<h1><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function
|
||||
@ -36,23 +36,23 @@ clustering based on edge betweenness centrality.</p>
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done, <span class=
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap,
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap,
|
||||
<span class=
|
||||
"bold"><b>typename</b></span> VertexIndexMap>
|
||||
"bold"><b>typename</b></span> VertexIndexMap>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
VertexIndexMap vertex_index);
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done, <span class=
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap>
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
EdgeCentralityMap edge_centrality);
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done>
|
||||
"bold"><b>typename</b></span> Done>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done);
|
||||
</pre></div>
|
||||
@ -108,7 +108,7 @@ OUT/UTIL: <tt>EdgeCentralityMap edge_centrality_map</tt>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>VertexIndexMap vertex_index</tt>
|
||||
IN: <tt>VertexIndexMap vertex_index</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Bellman Ford Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
<PRE>
|
||||
<i>// named paramter version</i>
|
||||
template <class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class P, class T, class R>
|
||||
bool bellman_ford_shortest_paths(const EdgeListGraph& g, Size N,
|
||||
bool bellman_ford_shortest_paths(const EdgeListGraph& g, Size N,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>);
|
||||
|
||||
template <class <a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, class P, class T, class R>
|
||||
@ -36,8 +36,8 @@ template <class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size,
|
||||
class PredecessorMap, class DistanceMap,
|
||||
class <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">BinaryFunction</a>, class <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>,
|
||||
class <a href="./BellmanFordVisitor.html">BellmanFordVisitor</a>>
|
||||
bool bellman_ford_shortest_paths(EdgeListGraph& g, Size N,
|
||||
WeightMap weight, PredecessorMap pred, DistanceMap distance,
|
||||
bool bellman_ford_shortest_paths(EdgeListGraph& g, Size N,
|
||||
WeightMap weight, PredecessorMap pred, DistanceMap distance,
|
||||
BinaryFunction combine, BinaryPredicate compare, BellmanFordVisitor v)
|
||||
</PRE>
|
||||
|
||||
@ -51,7 +51,7 @@ shortest paths problem for a graph with both positive and negative
|
||||
edge weights. For the definition of the shortest paths problem see
|
||||
Section <A
|
||||
HREF="./graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
|
||||
Algorithms</A>.
|
||||
Algorithms</A>.
|
||||
If you only need to solve the shortest paths problem for positive edge
|
||||
weights, Dijkstra's algorithm provides a more efficient
|
||||
alternative. If all the edge weights are all equal to one then breadth-first
|
||||
@ -77,7 +77,7 @@ ultimately be the parent in the shortest paths tree
|
||||
<td valign="top">
|
||||
<pre>
|
||||
RELAX(<i>u</i>, <i>v</i>, <i>w</i>, <i>d</i>, <i>p</i>)
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<i>d[v] := w(u,v) + d[u]</i>
|
||||
<i>p[v] := u</i>
|
||||
<b>else</b>
|
||||
@ -91,7 +91,7 @@ RELAX(<i>u</i>, <i>v</i>, <i>w</i>, <i>d</i>, <i>p</i>)
|
||||
relax edge <i>(u,v)</i>
|
||||
|
||||
|
||||
edge <i>(u,v)</i> is not relaxed
|
||||
edge <i>(u,v)</i> is not relaxed
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
@ -115,19 +115,19 @@ otherwise.
|
||||
<pre>
|
||||
BELLMAN-FORD(<i>G</i>)
|
||||
<i>// Optional initialization</i>
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<i>p[u] := u</i>
|
||||
<b>end for</b>
|
||||
<b>for</b> <i>i := 1</i> <b>to</b> <i>|V|-1</i>
|
||||
<b>for</b> each edge <i>(u,v) in E</i>
|
||||
<b>for</b> <i>i := 1</i> <b>to</b> <i>|V|-1</i>
|
||||
<b>for</b> each edge <i>(u,v) in E</i>
|
||||
RELAX(<i>u</i>, <i>v</i>, <i>w</i>, <i>d</i>, <i>p</i>)
|
||||
<b>end for</b>
|
||||
<b>end for</b>
|
||||
<b>for</b> each edge <i>(u,v) in E</i>
|
||||
<b>for</b> each edge <i>(u,v) in E</i>
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<b>return</b> (false, , )
|
||||
<b>else</b>
|
||||
<b>else</b>
|
||||
...
|
||||
<b>end for</b>
|
||||
<b>return</b> (true, <i>p</i>, <i>d</i>)
|
||||
@ -148,9 +148,9 @@ examine edge <i>(u,v)</i>
|
||||
|
||||
|
||||
|
||||
edge <i>(u,v)</i> was not minimized
|
||||
edge <i>(u,v)</i> was not minimized
|
||||
|
||||
edge <i>(u,v)</i> was minimized
|
||||
edge <i>(u,v)</i> was minimized
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
@ -175,7 +175,7 @@ algorithm's event points.
|
||||
<h3>Parameters</h3>
|
||||
|
||||
|
||||
IN: <tt>EdgeListGraph& g</tt>
|
||||
IN: <tt>EdgeListGraph& g</tt>
|
||||
<blockquote>
|
||||
A directed or undirected graph whose type must be a model of
|
||||
<a href="./EdgeListGraph.html">Edge List Graph</a>. If a root vertex is
|
||||
@ -211,7 +211,7 @@ IN: <tt>weight_map(WeightMap w)</tt>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("weight")</tt>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the edges in the minimum spanning
|
||||
tree. Upon completion of the algorithm, the edges <i>(p[u],u)</i>
|
||||
@ -227,7 +227,7 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN/OUT: <tt>distance_map(DistanceMap d)</tt>
|
||||
IN/OUT: <tt>distance_map(DistanceMap d)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex to each vertex in
|
||||
the graph <tt>g</tt> is recorded in this property map. The type
|
||||
@ -307,11 +307,11 @@ The time complexity is <i>O(V E)</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every edge in
|
||||
the graph <i>|V|</i> times.
|
||||
<li><b><tt>vis.edge_relaxed(e, g)</tt></b> is invoked when the distance
|
||||
label for the target vertex is decreased. The edge <i>(u,v)</i> that
|
||||
label for the target vertex is decreased. The edge <i>(u,v)</i> that
|
||||
participated in the last relaxation for vertex <i>v</i> is an edge in the
|
||||
shortest paths tree.
|
||||
shortest paths tree.
|
||||
<li><b><tt>vis.edge_not_relaxed(e, g)</tt></b> is invoked if the distance label
|
||||
for the target vertex is not decreased.
|
||||
for the target vertex is not decreased.
|
||||
<li><b><tt>vis.edge_minimized(e, g)</tt></b> is invoked during the
|
||||
second stage of the algorithm, during the test of whether each edge
|
||||
was minimized. If the edge is minimized then this function
|
||||
@ -330,7 +330,7 @@ href="../example/bellman-example.cpp"><TT>examples/bellman-example.cpp</TT></a>.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -346,4 +346,4 @@ href="../example/bellman-example.cpp"><TT>examples/bellman-example.cpp</TT></a>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: bellman_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -108,4 +108,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<!--
|
||||
Copyright (c) 2004 Trustees of Indiana University
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -12,54 +12,54 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<h1><img src="figs/python.gif" alt="(Python)"/><tt>brandes_betweenness_centrality</tt></h1>
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
<em>// named parameter versions</em>
|
||||
template<typename Graph, typename Param, typename Tag, typename Rest>
|
||||
void
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g,
|
||||
const bgl_named_params<Param,Tag,Rest>& params);
|
||||
|
||||
template<typename Graph, typename CentralityMap>
|
||||
void
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map);
|
||||
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap>
|
||||
void
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality);
|
||||
|
||||
<em>// non-named parameter versions</em>
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap,
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename PathCountMap, typename VertexIndexMap>
|
||||
void
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
IncomingMap incoming,
|
||||
DistanceMap distance, DependencyMap dependency,
|
||||
PathCountMap path_count,
|
||||
PathCountMap path_count,
|
||||
VertexIndexMap vertex_index);
|
||||
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap,
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename PathCountMap, typename VertexIndexMap, typename WeightMap>
|
||||
void
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename PathCountMap, typename VertexIndexMap, typename WeightMap>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
IncomingMap incoming,
|
||||
IncomingMap incoming,
|
||||
DistanceMap distance, DependencyMap dependency,
|
||||
PathCountMap path_count,
|
||||
PathCountMap path_count,
|
||||
VertexIndexMap vertex_index,
|
||||
WeightMap weight_map);
|
||||
|
||||
<em>// helper functions</em>
|
||||
template<typename Graph, typename CentralityMap>
|
||||
void
|
||||
void
|
||||
relative_betweenness_centrality(const Graph& g, CentralityMap centrality_map);
|
||||
|
||||
template<typename Graph, typename CentralityMap>
|
||||
@ -137,8 +137,8 @@ IN: <tt>const Graph& g</tt>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>IncomingMap incoming</tt>
|
||||
|
||||
UTIL: <tt>IncomingMap incoming</tt>
|
||||
<blockquote>
|
||||
This property map records the set of edges incoming to each vertex that comprise a shortest path from a particular source vertex through this vertex, and is used internally by the algorithm.The <tt>IncomingMap</tt> type must be a <a
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property
|
||||
@ -155,7 +155,7 @@ UTIL: <tt>IncomingMap incoming</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>DistanceMap distance_map</tt>
|
||||
UTIL: <tt>DistanceMap distance_map</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from each source vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map, but
|
||||
@ -178,7 +178,7 @@ UTIL: <tt>DistanceMap distance_map</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>DependencyMap dependency</tt>
|
||||
UTIL: <tt>DependencyMap dependency</tt>
|
||||
<blockquote>
|
||||
Property map used internally to accumulate partial betweenness
|
||||
centrality results. The type <tt>DependencyMap</tt> must be a model
|
||||
@ -198,7 +198,7 @@ UTIL: <tt>DependencyMap dependency</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>PathCountMap path_count</tt>
|
||||
UTIL: <tt>PathCountMap path_count</tt>
|
||||
<blockquote>
|
||||
Property map used internally to accumulate the number of paths that
|
||||
pass through each particular vertex. The type <tt>PathCountMap</tt>
|
||||
@ -254,7 +254,7 @@ OUT/UTIL: <tt>EdgeCentralityMap edge_centrality_map</tt>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap vertex_index)</tt>
|
||||
IN: <tt>vertex_index_map(VertexIndexMap vertex_index)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
@ -271,11 +271,11 @@ IN: <tt>vertex_index_map(VertexIndexMap vertex_index)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative, and the algorithm will throw a
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
exception is one of the edges is negative.
|
||||
The type <tt>WeightMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
|
||||
@ -286,7 +286,7 @@ IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<b>Python</b>: If supplied, must be an <tt>edge_double_map</tt> for the graph.
|
||||
</blockquote>
|
||||
|
||||
<h3>Complexity</h3>
|
||||
<h3>Complexity</h3>
|
||||
The time complexity is <em>O(VE)</em> for unweighted graphs and
|
||||
<em>O(VE + V(V+E) log V)</em> for weighted graphs. The space complexity
|
||||
is <em>O(VE)</em>.
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: bfs_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -38,10 +38,10 @@ visitor.
|
||||
<pre>
|
||||
// Construct graph G and obtain the source vertex s ...
|
||||
|
||||
boost::breadth_first_search(G, s,
|
||||
boost::breadth_first_search(G, s,
|
||||
boost::make_bfs_visitor(
|
||||
std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
|
||||
std::make_pair(boost::record_predecessors(p.begin(),
|
||||
std::make_pair(boost::record_predecessors(p.begin(),
|
||||
boost::on_tree_edge()),
|
||||
copy_graph(G_copy, boost::on_examine_edge())))) );
|
||||
</pre>
|
||||
@ -125,4 +125,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Named Parameters</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -38,7 +38,7 @@ reasons:
|
||||
he or she has to resort to providing all the parameters.
|
||||
|
||||
<li>Since the list of parameters is long, it is easy to forget
|
||||
the ordering.
|
||||
the ordering.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@ -54,7 +54,7 @@ indicates which parameter the argument is for. Each of the named
|
||||
parameters is separated by a <b>period</b>, not a comma.
|
||||
|
||||
<pre>
|
||||
bool r = boost::bellman_ford_shortest_paths(g, int(N),
|
||||
bool r = boost::bellman_ford_shortest_paths(g, int(N),
|
||||
boost::weight_map(weight).
|
||||
distance_map(&distance[0]).
|
||||
predecessor_map(&parent[0]));
|
||||
@ -66,7 +66,7 @@ an call to <tt>bellman_ford_shortest_paths</tt> that is equivalent to
|
||||
the one above.
|
||||
|
||||
<pre>
|
||||
bool r = boost::bellman_ford_shortest_paths(g, int(N),
|
||||
bool r = boost::bellman_ford_shortest_paths(g, int(N),
|
||||
boost::predecessor_map(&parent[0]).
|
||||
distance_map(&distance[0]).
|
||||
weight_map(weight));
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bibliography</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -264,7 +264,7 @@ SIAM Journal on Computing, 1(2):146-160, 1972
|
||||
<P></P><DT><A NAME="eppstein97:dynamic_graph">42</a>
|
||||
<DD>David Eppstein, Zvi Galil, and Giuseppe F. Italiano<BR>
|
||||
<EM>Dynamic Graph Algorithms.</EM><br>
|
||||
Chapter 22, CRC Handbook of Algorithms and Theory of Computation, 1997.
|
||||
Chapter 22, CRC Handbook of Algorithms and Theory of Computation, 1997.
|
||||
|
||||
<P></P><DT><A NAME="cuthill69:reducing_bandwith">43</a>
|
||||
<DD>E. Cuthill and J. McKee<BR>
|
||||
@ -330,7 +330,7 @@ BIT, 10, 1970, pp. 76-94.
|
||||
|
||||
<p></p><dt><a name="brandes01">54</a>
|
||||
<dd>Ulrik Brandes<br>
|
||||
<em><a href="http://ella.slis.indiana.edu/~katy/L579/brandes.pdf">A
|
||||
<em><a href="http://ella.slis.indiana.edu/~katy/L579/brandes.pdf">A
|
||||
Faster Algorithm for Betweenness Centrality</a></em><br>
|
||||
Journal of Mathematical Sociology 25 (2):163-177, 2001.
|
||||
|
||||
@ -347,7 +347,7 @@ Technical Report BN9/71, Stichting Mahtematisch Centrum, Amsterdam, 1971.
|
||||
<p></p><dt><a name="kamada89">57</a>
|
||||
<dd>T. Kamada and S. Kawai<br>
|
||||
<em>An algorithm for drawing general undirected graphs.</em><br>
|
||||
Information Processing Letters, 31, pp. 7-15, 1989.
|
||||
Information Processing Letters, 31, pp. 7-15, 1989.
|
||||
|
||||
<p></p><dt><a name="fruchterman91">58</a>
|
||||
<dd>T. Fruchterman and E. Reingold<br>
|
||||
@ -454,7 +454,7 @@ Journal of the ACM (JACM), 23(2): 221-234, 1976.
|
||||
Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 434-443, 1990.
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
@ -464,4 +464,4 @@ Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 4
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,21 +1,21 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright 2001-2004 The Trustees of Indiana University.
|
||||
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
Authors: Douglas Gregor
|
||||
Jeremy Siek
|
||||
Andrew Lumsdaine
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Biconnected Components and Articulation Points</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<A NAME="sec:biconnected-components">biconnected_components
|
||||
</A>
|
||||
</TT>
|
||||
and
|
||||
and
|
||||
<tt>articulation_points</tt>
|
||||
</h1>
|
||||
|
||||
@ -34,25 +34,25 @@ and
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator,
|
||||
typename P, typename T, typename R>
|
||||
std::pair<std::size_t, OutputIterator>
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
template <typename Graph, typename ComponentMap,
|
||||
typename P, typename T, typename R>
|
||||
std::size_t
|
||||
biconnected_components(const Graph& g, ComponentMap comp,
|
||||
biconnected_components(const Graph& g, ComponentMap comp,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
template <typename Graph, typename OutputIterator,
|
||||
template <typename Graph, typename OutputIterator,
|
||||
typename P, typename T, typename R>
|
||||
OutputIterator articulation_points(const Graph& g, OutputIterator out,
|
||||
OutputIterator articulation_points(const Graph& g, OutputIterator out,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator,
|
||||
typename DiscoverTimeMap, typename LowPointMap>
|
||||
std::pair<std::size_t, OutputIterator>
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
DiscoverTimeMap discover_time, LowPointMap lowpt);
|
||||
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator>
|
||||
@ -142,10 +142,10 @@ points.
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. The type
|
||||
num_vertices(g))</tt>. The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
@ -192,9 +192,9 @@ UTIL/OUT: <tt>lowpoint_map(LowPointMap lowpt)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
UTIL/OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the depth first search tree.
|
||||
The predecessor map records the depth first search tree.
|
||||
The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
@ -241,7 +241,7 @@ articulation points of an undirected graph.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -260,4 +260,4 @@ HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -5,7 +5,7 @@
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsthm}
|
||||
\usepackage{latexsym}
|
||||
\usepackage{latexsym}
|
||||
\usepackage{jweb}
|
||||
\usepackage{times}
|
||||
\usepackage{graphicx}
|
||||
@ -358,7 +358,7 @@ int main()
|
||||
|
||||
|
||||
|
||||
% \paragraph{Definition.} A \emph{palm tree} $P$ is a directed graph that
|
||||
% \paragraph{Definition.} A \emph{palm tree} $P$ is a directed graph that
|
||||
% consists of two disjoint sets of edges, denoted by $v \rightarrow w$
|
||||
% and $v \backedge w$ respectively, with the following properties:
|
||||
|
||||
|
@ -1,39 +1,39 @@
|
||||
<HTML>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Boyer-Myrvold Planarity Testing/Embedding</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>Boyer-Myrvold Planarity Testing/Embedding</H1>
|
||||
|
||||
<p>
|
||||
A graph is <a href="./planar_graphs.html#planar"><i>planar</i></a> if it can
|
||||
be drawn in two-dimensional space without any of its edges crossing. Such a
|
||||
drawing of a planar graph is called a
|
||||
<a href="./planar_graphs.html#plane_drawing"><i>plane drawing</i></a>. Each
|
||||
A graph is <a href="./planar_graphs.html#planar"><i>planar</i></a> if it can
|
||||
be drawn in two-dimensional space without any of its edges crossing. Such a
|
||||
drawing of a planar graph is called a
|
||||
<a href="./planar_graphs.html#plane_drawing"><i>plane drawing</i></a>. Each
|
||||
plane drawing belongs to an equivalence class called a <i>planar embedding</i>
|
||||
<a href="#1">[1]</a> that is defined by the clockwise ordering of adjacent
|
||||
edges around each vertex in the graph. A planar embedding is a convenient
|
||||
intermediate representation of an actual drawing of a planar graph, and many
|
||||
planar graph drawing algorithms are formulated as functions mapping a planar
|
||||
<a href="#1">[1]</a> that is defined by the clockwise ordering of adjacent
|
||||
edges around each vertex in the graph. A planar embedding is a convenient
|
||||
intermediate representation of an actual drawing of a planar graph, and many
|
||||
planar graph drawing algorithms are formulated as functions mapping a planar
|
||||
embedding to a plane drawing.
|
||||
<br>
|
||||
<br>
|
||||
<table align="center" class="image">
|
||||
<caption align="bottom"><h5>A planar graph (top left), along with a planar
|
||||
embedding of that graph (bottom left) can be used to create a plane drawing
|
||||
(right) by embedding edges around each vertex in the order in which they
|
||||
<caption align="bottom"><h5>A planar graph (top left), along with a planar
|
||||
embedding of that graph (bottom left) can be used to create a plane drawing
|
||||
(right) by embedding edges around each vertex in the order in which they
|
||||
appear in the planar embedding.
|
||||
</h5></caption>
|
||||
<tr><td>
|
||||
@ -44,16 +44,16 @@ appear in the planar embedding.
|
||||
</table>
|
||||
<br>
|
||||
<p>
|
||||
The function <tt>boyer_myrvold_planarity_test</tt> implements the planarity
|
||||
testing/embedding algorithm of Boyer and Myrvold
|
||||
The function <tt>boyer_myrvold_planarity_test</tt> implements the planarity
|
||||
testing/embedding algorithm of Boyer and Myrvold
|
||||
[<a href="./bibliography.html#boyermyrvold04">70</a>].
|
||||
<tt>boyer_myrvold_planarity_test</tt> returns <tt>true</tt> if the input graph
|
||||
<tt>boyer_myrvold_planarity_test</tt> returns <tt>true</tt> if the input graph
|
||||
is planar and <tt>false</tt> otherwise. As a side-effect of this test, a planar
|
||||
embedding can be constructed if the graph is planar or a minimal set of edges
|
||||
that form a <a href = "./planar_graphs.html#kuratowskisubgraphs">Kuratowski
|
||||
embedding can be constructed if the graph is planar or a minimal set of edges
|
||||
that form a <a href = "./planar_graphs.html#kuratowskisubgraphs">Kuratowski
|
||||
subgraph</a> can be found if the graph is not planar.
|
||||
<tt>boyer_myrvold_planarity_test</tt> uses named parameter arguments (courtesy
|
||||
of the <a href="../../parameter/doc/html/index.html">Boost.Parameter</a>
|
||||
<tt>boyer_myrvold_planarity_test</tt> uses named parameter arguments (courtesy
|
||||
of the <a href="../../parameter/doc/html/index.html">Boost.Parameter</a>
|
||||
library) to specify what the function actually does. Some examples are:
|
||||
|
||||
<ul>
|
||||
@ -65,8 +65,8 @@ bool is_planar = boyer_myrvold_planarity_test(g);
|
||||
<li>Computing a planar embedding for a graph if it is planar, otherwise finding
|
||||
a set of edges that forms an obstructing Kuratowski subgraph:
|
||||
<pre>
|
||||
if (boyer_myrvold_planarity_test(boyer_myrvold_params::graph = g,
|
||||
boyer_myrvold_params::embedding = embedding_pmap,
|
||||
if (boyer_myrvold_planarity_test(boyer_myrvold_params::graph = g,
|
||||
boyer_myrvold_params::embedding = embedding_pmap,
|
||||
boyer_myrvold_params::kuratowski_subgraph = out_itr
|
||||
)
|
||||
)
|
||||
@ -81,81 +81,81 @@ else
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The parameters passed to <tt>boyer_myrvold_planarity_test</tt> in the examples
|
||||
above do more than just carry the data structures used for input and output -
|
||||
the algorithm is optimized at compile time based on which parameters are
|
||||
present. A complete list of parameters accepted and their interactions are
|
||||
described below.
|
||||
The parameters passed to <tt>boyer_myrvold_planarity_test</tt> in the examples
|
||||
above do more than just carry the data structures used for input and output -
|
||||
the algorithm is optimized at compile time based on which parameters are
|
||||
present. A complete list of parameters accepted and their interactions are
|
||||
described below.
|
||||
<p>
|
||||
<tt>boyer_myrvold_planarity_test</tt> accepts as input any undirected graph,
|
||||
even those with self-loops and multiple edges.
|
||||
However, many planar graph drawing algorithms make additional restrictions
|
||||
on the structure of the input graph - for example, requiring that the input
|
||||
However, many planar graph drawing algorithms make additional restrictions
|
||||
on the structure of the input graph - for example, requiring that the input
|
||||
graph is connected, biconnected, or even maximal planar (triangulated.)
|
||||
Fortunately, any planar graph on <i>n</i> vertices that lacks one of these
|
||||
properties can be augmented with additional edges so that it satisfies that
|
||||
property in <i>O(n)</i> time - the functions
|
||||
Fortunately, any planar graph on <i>n</i> vertices that lacks one of these
|
||||
properties can be augmented with additional edges so that it satisfies that
|
||||
property in <i>O(n)</i> time - the functions
|
||||
<tt><a href="./make_connected.html">make_connected</a></tt>,
|
||||
<tt><a href="./make_biconnected_planar.html">make_biconnected_planar</a></tt>,
|
||||
and <tt><a href="./make_maximal_planar.html">make_maximal_planar</a></tt>
|
||||
exist for this purpose. If the graph drawing algorithm you're using requires,
|
||||
say, a biconnected graph, then you must make your input graph biconnected
|
||||
<tt><a href="./make_biconnected_planar.html">make_biconnected_planar</a></tt>,
|
||||
and <tt><a href="./make_maximal_planar.html">make_maximal_planar</a></tt>
|
||||
exist for this purpose. If the graph drawing algorithm you're using requires,
|
||||
say, a biconnected graph, then you must make your input graph biconnected
|
||||
<i>before</i> passing it into <tt>boyer_myrvold_planarity_test</tt> so that the
|
||||
computed planar embedding includes these additional edges. This may require
|
||||
more than one call to <tt>boyer_myrvold_planarity_test</tt> depending on the
|
||||
structure of the graph you begin with, since both
|
||||
<tt>make_biconnected_planar</tt> and <tt>make_maximal_planar</tt> require a
|
||||
computed planar embedding includes these additional edges. This may require
|
||||
more than one call to <tt>boyer_myrvold_planarity_test</tt> depending on the
|
||||
structure of the graph you begin with, since both
|
||||
<tt>make_biconnected_planar</tt> and <tt>make_maximal_planar</tt> require a
|
||||
planar embedding of the existing graph as an input parameter.
|
||||
|
||||
<p><p>
|
||||
The named parameters accepted by <tt>boyer_myrvold_planarity_test</tt> are:
|
||||
|
||||
<ul>
|
||||
<li><b><tt>graph</tt></b> : The input graph - this is the only required
|
||||
<li><b><tt>graph</tt></b> : The input graph - this is the only required
|
||||
parameter.
|
||||
<li><b><tt>vertex_index_map</tt></b> : A mapping from vertices of the input
|
||||
graph to indexes in the range <tt>[0..num_vertices(g))</tt>. If this parameter
|
||||
<li><b><tt>vertex_index_map</tt></b> : A mapping from vertices of the input
|
||||
graph to indexes in the range <tt>[0..num_vertices(g))</tt>. If this parameter
|
||||
is not provided, the vertex index map is assumed to be available as an interior
|
||||
property of the graph, accessible by calling <tt>get(vertex_index, g)</tt>.
|
||||
<li><b><tt>edge_index_map</tt></b>: A mapping from the edges of the input graph
|
||||
to indexes in the range <tt>[0..num_edges(g))</tt>. This parameter is only
|
||||
needed if the <tt>kuratowski_subgraph</tt> argument is provided. If the
|
||||
to indexes in the range <tt>[0..num_edges(g))</tt>. This parameter is only
|
||||
needed if the <tt>kuratowski_subgraph</tt> argument is provided. If the
|
||||
<tt>kuratowski_subgraph</tt> argument is provided and this parameter is not
|
||||
provided, the EdgeIndexMap is assumed to be available as an interior property
|
||||
provided, the EdgeIndexMap is assumed to be available as an interior property
|
||||
accessible by calling <tt>get(edge_index, g)</tt>.
|
||||
<li><b><tt>embedding</tt></b> : If the graph is planar, this will be populated
|
||||
with a mapping from vertices to the clockwise order of neighbors in the planar
|
||||
<li><b><tt>embedding</tt></b> : If the graph is planar, this will be populated
|
||||
with a mapping from vertices to the clockwise order of neighbors in the planar
|
||||
embedding.
|
||||
<li><b><tt>kuratowski_subgraph</tt></b> : If the graph is not planar, a minimal
|
||||
set of edges that form the obstructing Kuratowski subgraph will be written to
|
||||
set of edges that form the obstructing Kuratowski subgraph will be written to
|
||||
this iterator.
|
||||
</ul>
|
||||
|
||||
These named parameters all belong to the namespace
|
||||
<tt>boyer_myrvold_params</tt>. See below for more information on the concepts
|
||||
required for these arguments.
|
||||
These named parameters all belong to the namespace
|
||||
<tt>boyer_myrvold_params</tt>. See below for more information on the concepts
|
||||
required for these arguments.
|
||||
|
||||
<H3>Verifying the output</H3>
|
||||
|
||||
Whether or not the input graph is planar, <tt>boyer_myrvold_planarity_test</tt>
|
||||
can produce a certificate that can be automatically checked to verify that the
|
||||
function is working properly.
|
||||
can produce a certificate that can be automatically checked to verify that the
|
||||
function is working properly.
|
||||
<p>
|
||||
If the graph is planar, a planar embedding can be produced. The
|
||||
planar embedding can be verified by passing it to a plane drawing routine
|
||||
planar embedding can be verified by passing it to a plane drawing routine
|
||||
(such as <tt><a href="straight_line_drawing.html">
|
||||
chrobak_payne_straight_line_drawing</a></tt>) and using the function
|
||||
<tt><a href="is_straight_line_drawing.html">is_straight_line_drawing</a></tt>
|
||||
chrobak_payne_straight_line_drawing</a></tt>) and using the function
|
||||
<tt><a href="is_straight_line_drawing.html">is_straight_line_drawing</a></tt>
|
||||
to verify that the resulting graph is planar.
|
||||
<p>
|
||||
If the graph is not planar, a set of edges that forms a Kuratowski subgraph in
|
||||
the original graph can be produced. This set of edges can be passed to the
|
||||
If the graph is not planar, a set of edges that forms a Kuratowski subgraph in
|
||||
the original graph can be produced. This set of edges can be passed to the
|
||||
function <tt><a href="is_kuratowski_subgraph.html">is_kuratowski_subgraph</a>
|
||||
</tt> to verify that they can be contracted into a <i>K<sub>5</sub></i> or
|
||||
<i>K<sub>3,3</sub></i>. <tt>boyer_myrvold_planarity_test</tt> chooses the set
|
||||
of edges forming the Kuratowski subgraph in such a way that the contraction to
|
||||
a <i>K<sub>5</sub></i> or <i>K<sub>3,3</sub></i> can be done by a simple
|
||||
deterministic process which is described in the documentation to
|
||||
</tt> to verify that they can be contracted into a <i>K<sub>5</sub></i> or
|
||||
<i>K<sub>3,3</sub></i>. <tt>boyer_myrvold_planarity_test</tt> chooses the set
|
||||
of edges forming the Kuratowski subgraph in such a way that the contraction to
|
||||
a <i>K<sub>5</sub></i> or <i>K<sub>3,3</sub></i> can be done by a simple
|
||||
deterministic process which is described in the documentation to
|
||||
<tt>is_kuratowski_subgraph</tt>.
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
@ -170,8 +170,8 @@ deterministic process which is described in the documentation to
|
||||
IN: <tt>Graph& g</tt>
|
||||
|
||||
<blockquote>
|
||||
Any undirected graph. The graph type must be a model of
|
||||
<a href="VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a> and
|
||||
Any undirected graph. The graph type must be a model of
|
||||
<a href="VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a> and
|
||||
<a href="IncidenceGraph.html">IncidenceGraph</a>.
|
||||
</blockquote>
|
||||
|
||||
@ -184,7 +184,7 @@ Must model the <a href="PlanarEmbedding.html">PlanarEmbedding</a> concept.
|
||||
IN <tt>OutputIterator kuratowski_subgraph</tt>
|
||||
|
||||
<blockquote>
|
||||
An OutputIterator which accepts values of the type
|
||||
An OutputIterator which accepts values of the type
|
||||
<tt>graph_traits<Graph>::edge_descriptor</tt>
|
||||
</blockquote>
|
||||
|
||||
@ -192,7 +192,7 @@ IN <tt>VertexIndexMap vm</tt>
|
||||
|
||||
<blockquote>
|
||||
A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
|
||||
</a> that maps vertices from <tt>g</tt> to distinct integers in the range
|
||||
</a> that maps vertices from <tt>g</tt> to distinct integers in the range
|
||||
<tt>[0, num_vertices(g) )</tt><br>
|
||||
<b>Default</b>: <tt>get(vertex_index,g)</tt><br>
|
||||
</blockquote>
|
||||
@ -201,21 +201,21 @@ IN <tt>EdgeIndexMap em</tt>
|
||||
|
||||
<blockquote>
|
||||
A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
|
||||
</a> that maps edges from <tt>g</tt> to distinct integers in the range
|
||||
</a> that maps edges from <tt>g</tt> to distinct integers in the range
|
||||
<tt>[0, num_edges(g) )</tt><br>
|
||||
<b>Default</b>: <tt>get(edge_index,g)</tt>, but this parameter is only used if
|
||||
<b>Default</b>: <tt>get(edge_index,g)</tt>, but this parameter is only used if
|
||||
the <tt>kuratowski_subgraph_iterator</tt> is provided.<br>
|
||||
</blockquote>
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
Assuming that both the vertex index and edge index supplied take time
|
||||
<i>O(1)</i> to return an index and there are <i>O(n)</i>
|
||||
total self-loops and parallel edges in the graph, most combinations of
|
||||
arguments given to
|
||||
<tt>boyer_myrvold_planarity_test</tt> result in an algorithm that runs in time
|
||||
<i>O(n)</i> for a graph with <i>n</i> vertices and <i>m</i> edges. The only
|
||||
exception is when Kuratowski subgraph isolation is requested for a dense graph
|
||||
Assuming that both the vertex index and edge index supplied take time
|
||||
<i>O(1)</i> to return an index and there are <i>O(n)</i>
|
||||
total self-loops and parallel edges in the graph, most combinations of
|
||||
arguments given to
|
||||
<tt>boyer_myrvold_planarity_test</tt> result in an algorithm that runs in time
|
||||
<i>O(n)</i> for a graph with <i>n</i> vertices and <i>m</i> edges. The only
|
||||
exception is when Kuratowski subgraph isolation is requested for a dense graph
|
||||
(a graph with <i>n = o(m)</i>) - the running time will be <i>O(n+m)</i>
|
||||
<a href = "#2">[2]</a>.
|
||||
|
||||
@ -224,9 +224,9 @@ exception is when Kuratowski subgraph isolation is requested for a dense graph
|
||||
<P>
|
||||
<ul>
|
||||
<li><a href="../example/simple_planarity_test.cpp">A simple planarity test</a>
|
||||
<li><a href="../example/kuratowski_subgraph.cpp">Isolating a Kuratowski
|
||||
<li><a href="../example/kuratowski_subgraph.cpp">Isolating a Kuratowski
|
||||
Subgraph</a>
|
||||
<li><a href="../example/straight_line_drawing.cpp">Using a planar embedding to
|
||||
<li><a href="../example/straight_line_drawing.cpp">Using a planar embedding to
|
||||
create a straight line drawing</a>
|
||||
</ul>
|
||||
|
||||
@ -237,17 +237,17 @@ create a straight line drawing</a>
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1] A planar embedding is also called a <i>combinatorial
|
||||
<p><a name="1">[1] A planar embedding is also called a <i>combinatorial
|
||||
embedding</i>.
|
||||
|
||||
<p><a name="2">[2] The algorithm can still be made to run in time <i>O(n)</i>
|
||||
for this case, if needed. <a href="planar_graphs.html#EulersFormula">Euler's
|
||||
<p><a name="2">[2] The algorithm can still be made to run in time <i>O(n)</i>
|
||||
for this case, if needed. <a href="planar_graphs.html#EulersFormula">Euler's
|
||||
formula</a> implies that a planar graph with <i>n</i> vertices can have no more
|
||||
than <i>3n - 6</i> edges, which means that any non-planar graph on <i>n</i>
|
||||
vertices has a subgraph of only <i>3n - 5</i> edges that contains a Kuratowski
|
||||
subgraph. So, if you need to find a Kuratowski subgraph of a graph with more
|
||||
than <i>3n - 5</i> edges in time <i>O(n)</i>, you can create a subgraph of the
|
||||
original graph consisting of any arbitrary <i>3n - 5</i> edges and pass that
|
||||
than <i>3n - 6</i> edges, which means that any non-planar graph on <i>n</i>
|
||||
vertices has a subgraph of only <i>3n - 5</i> edges that contains a Kuratowski
|
||||
subgraph. So, if you need to find a Kuratowski subgraph of a graph with more
|
||||
than <i>3n - 5</i> edges in time <i>O(n)</i>, you can create a subgraph of the
|
||||
original graph consisting of any arbitrary <i>3n - 5</i> edges and pass that
|
||||
graph to <tt>boyer_myrvold_planarity_test</tt>.
|
||||
|
||||
|
||||
@ -256,4 +256,4 @@ graph to <tt>boyer_myrvold_planarity_test</tt>.
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000, 2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Breadth-First Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -24,15 +24,15 @@
|
||||
<PRE>
|
||||
<i>// named parameter version</i>
|
||||
template <class Graph, class P, class T, class R>
|
||||
void breadth_first_search(Graph& G,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
void breadth_first_search(Graph& G,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class Graph, class Buffer, class BFSVisitor,
|
||||
template <class Graph, class Buffer, class BFSVisitor,
|
||||
class ColorMap>
|
||||
void breadth_first_search(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
void breadth_first_search(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
Buffer& Q, BFSVisitor vis, ColorMap color);
|
||||
</PRE>
|
||||
|
||||
@ -70,25 +70,25 @@ BFS algorithm is a listed below.
|
||||
<pre>
|
||||
BFS(<i>G</i>, <i>s</i>)
|
||||
<b>for</b> each vertex <i>u in V[G]</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<b>end for</b>
|
||||
<i>color[s] :=</i> GRAY
|
||||
<i>d[s] := 0</i>
|
||||
<i>color[s] :=</i> GRAY
|
||||
<i>d[s] := 0</i>
|
||||
ENQUEUE(<i>Q</i>, <i>s</i>)
|
||||
<b>while</b> (<i>Q != Ø</i>)
|
||||
<b>while</b> (<i>Q != Ø</i>)
|
||||
<i>u :=</i> DEQUEUE(Q)
|
||||
<b>for</b> each vertex <i>v in Adj[u]</i>
|
||||
<b>if</b> (<i>color[v] =</i> WHITE)
|
||||
<i>color[v] :=</i> GRAY
|
||||
<i>d[v] := d[u] + 1</i>
|
||||
<i>p[v] := u</i>
|
||||
<i>color[v] :=</i> GRAY
|
||||
<i>d[v] := d[u] + 1</i>
|
||||
<i>p[v] := u</i>
|
||||
ENQUEUE(<i>Q</i>, <i>v</i>)
|
||||
<b>else</b>
|
||||
<b>if</b> (<i>color[v] =</i> GRAY)
|
||||
<b>if</b> (<i>color[v] =</i> GRAY)
|
||||
...
|
||||
<b>else</b>
|
||||
<b>else</b>
|
||||
...
|
||||
<b>end for</b>
|
||||
<i>color[u] :=</i> BLACK
|
||||
@ -99,29 +99,29 @@ BFS(<i>G</i>, <i>s</i>)
|
||||
<td valign="top">
|
||||
<pre>
|
||||
|
||||
initialize vertex <i>u</i>
|
||||
initialize vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
discover vertex <i>s</i>
|
||||
discover vertex <i>s</i>
|
||||
|
||||
examine vertex <i>u</i>
|
||||
examine vertex <i>u</i>
|
||||
examine edge <i>(u,v)</i>
|
||||
<i>(u,v)</i> is a tree edge
|
||||
<i>(u,v)</i> is a tree edge
|
||||
|
||||
|
||||
|
||||
discover vertex <i>v</i>
|
||||
discover vertex <i>v</i>
|
||||
<i>(u,v)</i> is a non-tree edge
|
||||
|
||||
<i>(u,v)</i> has a gray target
|
||||
<i>(u,v)</i> has a gray target
|
||||
|
||||
<i>(u,v)</i> has a black target
|
||||
<i>(u,v)</i> has a black target
|
||||
|
||||
finish vertex <i>u</i>
|
||||
finish vertex <i>u</i>
|
||||
</pre>
|
||||
</tr>
|
||||
</table>
|
||||
@ -244,7 +244,7 @@ UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
<b>Python</b>: The buffer must derive from the <a
|
||||
href="./Buffer.html">Buffer</a> type for the graph.
|
||||
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<H3><A NAME="SECTION001330300000000000000">
|
||||
@ -252,7 +252,7 @@ Complexity</A>
|
||||
</H3>
|
||||
|
||||
<P>
|
||||
The time complexity is <i>O(E + V)</i>.
|
||||
The time complexity is <i>O(E + V)</i>.
|
||||
|
||||
<P>
|
||||
|
||||
@ -260,13 +260,13 @@ The time complexity is <i>O(E + V)</i>.
|
||||
|
||||
<ul>
|
||||
<li><b><tt>vis.initialize_vertex(v, g)</tt></b> is invoked on every vertex
|
||||
before the start of the search.
|
||||
before the start of the search.
|
||||
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>r is invoked in each
|
||||
vertex as it is removed from the queue.
|
||||
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
|
||||
of each vertex immediately after the vertex is removed from the queue.
|
||||
of each vertex immediately after the vertex is removed from the queue.
|
||||
|
||||
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>examine_edge()</tt>) if the edge is a tree edge. The
|
||||
@ -275,20 +275,20 @@ The time complexity is <i>O(E + V)</i>.
|
||||
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked the first time the
|
||||
algorithm encounters vertex <i>u</i>. All vertices closer to the
|
||||
source vertex have been discovered, and vertices further from the
|
||||
source have not yet been discovered.
|
||||
source have not yet been discovered.
|
||||
|
||||
<li><b><tt>vis.non_tree_edge(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>examine_edge()</tt>) if the edge is not a tree edge.
|
||||
<tt>examine_edge()</tt>) if the edge is not a tree edge.
|
||||
|
||||
<li><b><tt>vis.gray_target(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>non_tree_edge()</tt>) if the target vertex is colored gray at the
|
||||
time of examination. The color gray indicates that
|
||||
the vertex is currently in the queue.
|
||||
the vertex is currently in the queue.
|
||||
|
||||
<li><b><tt>vis.black_target(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>non_tree_edge()</tt>) if the target vertex is colored black at the
|
||||
time of examination. The color black indicates that the
|
||||
vertex is no longer in the queue.
|
||||
vertex is no longer in the queue.
|
||||
|
||||
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is invoked after all of the out
|
||||
edges of <i>u</i> have been examined and all of the adjacent vertices
|
||||
@ -319,7 +319,7 @@ to <tt>listS</tt>.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -335,4 +335,4 @@ to <tt>listS</tt>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000, 2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Breadth-First Visit</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -22,14 +22,14 @@
|
||||
<P>
|
||||
<PRE>
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class P, class T, class R>
|
||||
void breadth_first_visit(IncidenceGraph& G,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
void breadth_first_visit(IncidenceGraph& G,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./Buffer.html">Buffer</a>, class <a href="./BFSVisitor.html">BFSVisitor</a>, class ColorMap>
|
||||
void breadth_first_visit
|
||||
(const IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
(const IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
Buffer& Q, BFSVisitor vis, ColorMap color)
|
||||
</PRE>
|
||||
|
||||
@ -110,7 +110,7 @@ UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
|
||||
<b>Python</b>: The buffer must derive from the <a
|
||||
href="./Buffer.html">Buffer</a> type for the graph.
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<H3><A NAME="SECTION001330300000000000000">
|
||||
@ -118,7 +118,7 @@ Complexity</A>
|
||||
</H3>
|
||||
|
||||
<P>
|
||||
The time complexity is <i>O(E)</i>.
|
||||
The time complexity is <i>O(E)</i>.
|
||||
|
||||
<P>
|
||||
|
||||
@ -129,7 +129,7 @@ The time complexity is <i>O(E)</i>.
|
||||
vertex as it is removed from the queue.
|
||||
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
|
||||
of each vertex immediately after the vertex is removed from the queue.
|
||||
of each vertex immediately after the vertex is removed from the queue.
|
||||
|
||||
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>examine_edge()</tt>) if the edge is a tree edge. The
|
||||
@ -138,20 +138,20 @@ The time complexity is <i>O(E)</i>.
|
||||
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked the first time the
|
||||
algorithm encounters vertex <i>u</i>. All vertices closer to the
|
||||
source vertex have been discovered, and vertices further from the
|
||||
source have not yet been discovered.
|
||||
source have not yet been discovered.
|
||||
|
||||
<li><b><tt>vis.non_tree_edge(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>examine_edge()</tt>) if the edge is not a tree edge.
|
||||
<tt>examine_edge()</tt>) if the edge is not a tree edge.
|
||||
|
||||
<li><b><tt>vis.gray_target(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>non_tree_edge()</tt>) if the target vertex is colored gray at the
|
||||
time of examination. The color gray indicates that
|
||||
the vertex is currently in the queue.
|
||||
the vertex is currently in the queue.
|
||||
|
||||
<li><b><tt>vis.black_target(e, g)</tt></b> is invoked (in addition to
|
||||
<tt>non_tree_edge()</tt>) if the target vertex is colored black at the
|
||||
time of examination. The color black indicates that the
|
||||
vertex is no longer in the queue.
|
||||
vertex is no longer in the queue.
|
||||
|
||||
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is invoked after all of the out
|
||||
edges of <i>u</i> have been examined and all of the adjacent vertices
|
||||
@ -167,7 +167,7 @@ The time complexity is <i>O(E)</i>.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -183,4 +183,4 @@ The time complexity is <i>O(E)</i>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Challenge</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -43,12 +43,12 @@ review. The pending items are:</li>
|
||||
<li>Construct a set of planar graph algorithms.</li>
|
||||
<ul>
|
||||
<li> Is the graph planar?</li>
|
||||
<li> "Walk around the block" and similar open and closed neighborhood
|
||||
traversals. Note that edge traversals need to resolve to particular ends
|
||||
<li> "Walk around the block" and similar open and closed neighborhood
|
||||
traversals. Note that edge traversals need to resolve to particular ends
|
||||
and sides (see below), not just to the edge as a whole.</li>
|
||||
<li> Given a point, find the nearest vertex, edge, or bounded polygon.
|
||||
<li> Given a point, find the nearest vertex, edge, or bounded polygon.
|
||||
Again, edges are viewed as having left and right sides.</li>
|
||||
<li> Given a line segment, find intersecting vertices, edges, or bounded
|
||||
<li> Given a line segment, find intersecting vertices, edges, or bounded
|
||||
polygons.</li>
|
||||
<li> Given a polygon, find intersecting whatever...</li>
|
||||
<li> Various minimum bounding rectangle and clipping problems.</li>
|
||||
@ -117,4 +117,4 @@ It is currently difficult to use from a C++ program.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<html><!--
|
||||
Copyright (c) 2004 Trustees of Indiana University
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Function template circle_graph_layout</title></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table cellpadding="2" width="100%"><td valign="top"><img src="../../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86"></td><td align="center"><a href="../../../index.htm">Home</a></td><td align="center"><a href="../../libraries.htm">Libraries</a></td><td align="center"><a href="http://www.boost.org/people/people.htm">People</a></td><td align="center"><a href="http://www.boost.org/more/faq.htm">FAQ</a></td><td align="center"><a href="../../../more/index.htm">More</a></td></table><hr><div class="refentry" lang="en"><a name="id103562-bb"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function template circle_graph_layout</span></h2><p>boost::circle_graph_layout — Layout the graph with the vertices at the points of a regular n-polygon. </p></div><h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2><div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
|
||||
<span class="bold"><b>template</b></span><<span class="bold"><b>typename</b></span> VertexListGraph, <span class="bold"><b>typename</b></span> PositionMap, <span class="bold"><b>typename</b></span> Radius>
|
||||
<span class="type"><span class="bold"><b>void</b></span></span> circle_graph_layout(<span class="bold"><b>const</b></span> VertexListGraph & g, PositionMap position,
|
||||
Radius radius);</pre></div><div class="refsect1" lang="en"><a name="id821794"></a><h2>Where Defined</h2><a href="../../../boost/graph/circle_layout.hpp">boost/graph/circle_layout.hpp</a><h2>Description</h2><p>The distance from the center of the polygon to each point is determined by the <tt class="computeroutput">radius</tt> parameter. The <tt class="computeroutput">position</tt> parameter must be an Lvalue Property Map whose value type is a class type containing <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> members that will be set to the <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> coordinates.
|
||||
<span class="bold"><b>template</b></span><<span class="bold"><b>typename</b></span> VertexListGraph, <span class="bold"><b>typename</b></span> PositionMap, <span class="bold"><b>typename</b></span> Radius>
|
||||
<span class="type"><span class="bold"><b>void</b></span></span> circle_graph_layout(<span class="bold"><b>const</b></span> VertexListGraph & g, PositionMap position,
|
||||
Radius radius);</pre></div><div class="refsect1" lang="en"><a name="id821794"></a><h2>Where Defined</h2><a href="../../../boost/graph/circle_layout.hpp">boost/graph/circle_layout.hpp</a><h2>Description</h2><p>The distance from the center of the polygon to each point is determined by the <tt class="computeroutput">radius</tt> parameter. The <tt class="computeroutput">position</tt> parameter must be an Lvalue Property Map whose value type is a class type containing <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> members that will be set to the <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> coordinates.
|
||||
|
||||
<h2>Parameters</h2>
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
|
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<!--
|
||||
Copyright (c) 2005-2009 Trustees of Indiana University
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -32,12 +32,12 @@ function address(host, user) {
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<IMG SRC="../../../boost.png"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86"></img>
|
||||
<h1>Compressed Sparse Row Graph</h1>
|
||||
|
||||
|
||||
<p>The class template <code>compressed_sparse_row_graph</code> is
|
||||
a graph class that uses the compact Compressed Sparse Row (CSR)
|
||||
format to store directed (and bidirectional) graphs. While CSR graphs have
|
||||
@ -101,8 +101,8 @@ function address(host, user) {
|
||||
<pre>
|
||||
namespace boost {
|
||||
|
||||
template<typename <a href="#Directed">Directed</a> = directedS, typename <a href="#VertexProperty">VertexProperty</a> = no_property,
|
||||
typename <a href="#EdgeProperty">EdgeProperty</a> = no_property, typename <a href="#GraphProperty">GraphProperty</a> = no_property,
|
||||
template<typename <a href="#Directed">Directed</a> = directedS, typename <a href="#VertexProperty">VertexProperty</a> = no_property,
|
||||
typename <a href="#EdgeProperty">EdgeProperty</a> = no_property, typename <a href="#GraphProperty">GraphProperty</a> = no_property,
|
||||
typename <a href="#Vertex">Vertex</a> = std::size_t, typename <a href="#EdgeIndex">EdgeIndex</a> = Vertex>
|
||||
class compressed_sparse_row_graph
|
||||
{
|
||||
@ -173,7 +173,7 @@ public:
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
<a href="#graph-const">compressed_sparse_row_graph</a>(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges);
|
||||
edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi);
|
||||
@ -202,17 +202,17 @@ public:
|
||||
<i>// <a href="IncidenceGraph.html">Incidence Graph requirements</a></i>
|
||||
vertex_descriptor source(edge_descriptor, const compressed_sparse_row_graph&);
|
||||
vertex_descriptor target(edge_descriptor, const compressed_sparse_row_graph&);
|
||||
std::pair<out_edge_iterator, out_edge_iterator>
|
||||
std::pair<out_edge_iterator, out_edge_iterator>
|
||||
out_edges(vertex_descriptor, const compressed_sparse_row_graph&);
|
||||
degree_size_type out_degree(vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="BidirectionalGraph.html">Bidirectional Graph requirements <b>(bidirectional only)</b></a></i>
|
||||
std::pair<in_edge_iterator, in_edge_iterator>
|
||||
std::pair<in_edge_iterator, in_edge_iterator>
|
||||
in_edges(vertex_descriptor, const compressed_sparse_row_graph&);
|
||||
degree_size_type in_degree(vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="AdjacencyGraph.html">Adjacency Graph requirements</a></i>
|
||||
std::pair<adjacency_iterator, adjacency_iterator>
|
||||
std::pair<adjacency_iterator, adjacency_iterator>
|
||||
adjacent_vertices(vertex_descriptor, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="VertexListGraph.html">Vertex List Graph requirements</a></i>
|
||||
@ -227,7 +227,7 @@ edges_size_type num_edges(const compressed_sparse_row_graph&);
|
||||
vertex_descriptor <a href="#vertex-lookup">vertex</a>(vertices_size_type i, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="#edge-access">Edge access</a></i>
|
||||
std::pair<edge_descriptor, bool>
|
||||
std::pair<edge_descriptor, bool>
|
||||
<a href="#edge">edge</a>(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
edge_descriptor <a href="#edge_from_index">edge_from_index</a>(edges_size_type i, const compressed_sparse_row_graph&);
|
||||
|
||||
@ -283,7 +283,7 @@ void <a href="#add_edges_sorted_prop">add_edges_sorted</a>(BidirectionalIterator
|
||||
<p><code><<a href="../../../boost/graph/compressed_sparse_row_graph.hpp">boost/graph/compressed_sparse_row_graph.hpp</a>></code></p>
|
||||
|
||||
<a name="models"></a><h2>Models</h2>
|
||||
|
||||
|
||||
<p>The <tt>compressed_sparse_row_graph</tt> class template models
|
||||
(i.e., implements the requirements of) many of the
|
||||
BGL <a href="graph_concepts.html">graph concepts</a>, allowing it
|
||||
@ -628,7 +628,7 @@ void <a href="#add_edges_sorted_prop">add_edges_sorted</a>(BidirectionalIterator
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges);
|
||||
edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi);
|
||||
@ -666,14 +666,14 @@ void <a href="#add_edges_sorted_prop">add_edges_sorted</a>(BidirectionalIterator
|
||||
|
||||
<ul>
|
||||
<li><tt>g</tt>: The incoming graph.</li>
|
||||
|
||||
|
||||
<li><tt>vi</tt>: A map from vertices to indices. If not
|
||||
provided, <tt>get(vertex_index, g)</tt> will be used.</li>
|
||||
|
||||
|
||||
<li><tt>numverts</tt>: The number of vertices in the graph
|
||||
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
|
||||
<a href="VertexListGraph.html">VertexListGraph</a>.</li>
|
||||
|
||||
|
||||
<li><tt>numedges</tt>: The number of edges in the graph
|
||||
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
|
||||
<a href="EdgeListGraph.html">EdgeListGraph</a>.</li>
|
||||
@ -726,7 +726,7 @@ void <a href="#add_edges_sorted_prop">add_edges_sorted</a>(BidirectionalIterator
|
||||
<a name="edge-access"></a><h3>Edge access</h3>
|
||||
|
||||
<pre><a name="edge"></a>
|
||||
std::pair<edge_descriptor, bool>
|
||||
std::pair<edge_descriptor, bool>
|
||||
edge(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
</pre>
|
||||
|
||||
@ -766,7 +766,7 @@ template<typename <a href="./PropertyTag.html">PropertyTag</a>>
|
||||
property_map<compressed_sparse_row_graph, Tag>::const_type
|
||||
get(PropertyTag, const compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
|
||||
<p class="indent">
|
||||
Returns the property map object for the vertex property
|
||||
specified by <TT>PropertyTag</TT>. The <TT>PropertyTag</TT> must
|
||||
@ -816,7 +816,7 @@ get_property(const compressed_sparse_row_graph& g, GraphPropertyTag);
|
||||
|
||||
<p class="indent">
|
||||
Return the property specified by <tt>GraphPropertyTag</tt> that
|
||||
is attached to the graph object <tt>g</tt>.
|
||||
is attached to the graph object <tt>g</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
@ -840,7 +840,7 @@ void set_property(const compressed_sparse_row_graph& g, GraphPropertyTag,
|
||||
template<typename InputIterator>
|
||||
void add_edges(InputIterator first, InputIterator last, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
|
||||
<p class="indent">
|
||||
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
|
||||
The <tt>InputIterator</tt> must be a model of <a
|
||||
@ -856,7 +856,7 @@ void add_edges(InputIterator first, InputIterator last, compressed_sparse_row_gr
|
||||
template<typename InputIterator, typename EPIter>
|
||||
void add_edges(InputIterator first, InputIterator last, EPIter ep_first, EPIter ep_last, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
|
||||
<p class="indent">
|
||||
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) with
|
||||
corresponding edge properties (from <tt>ep_first</tt> to
|
||||
@ -876,7 +876,7 @@ void add_edges(InputIterator first, InputIterator last, EPIter ep_first, EPIter
|
||||
template<typename BidirectionalIterator>
|
||||
void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
|
||||
<p class="indent">
|
||||
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
|
||||
The <tt>BidirectionalIterator</tt> must be a model of <a
|
||||
@ -893,7 +893,7 @@ void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, c
|
||||
template<typename BidirectionalIterator, typename EPIter>
|
||||
void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, EPIter ep_iter, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
|
||||
<p class="indent">
|
||||
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
|
||||
The <tt>BidirectionalIterator</tt> and <tt>EPIter</tt> must be models of
|
||||
@ -950,7 +950,7 @@ BGL_FORALL_VERTICES(v, g, WebGraph)
|
||||
// Output each of the links
|
||||
std::cout << "The web graph:" << std::endl;
|
||||
BGL_FORALL_EDGES(e, g, WebGraph)
|
||||
std::cout << " " << g[source(e, g)].url << " -> " << g[target(e, g)].url
|
||||
std::cout << " " << g[source(e, g)].url << " -> " << g[target(e, g)].url
|
||||
<< std::endl;
|
||||
</pre>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000-2001
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Connected Components</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -154,4 +154,4 @@ undirected graph.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Constructing Graph Algorithms</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -113,7 +113,7 @@ color of all the vertices to "uncolored."
|
||||
namespace boost {
|
||||
template <class VertexListGraph, class Order, class Color>
|
||||
typename graph_traits<VertexListGraph>::vertices_size_type
|
||||
sequential_vertex_color_ting(const VertexListGraph& G,
|
||||
sequential_vertex_color_ting(const VertexListGraph& G,
|
||||
Order order, Color color)
|
||||
{
|
||||
typedef graph_traits<VertexListGraph> GraphTraits;
|
||||
@ -127,27 +127,27 @@ namespace boost {
|
||||
BOOST_CONCEPT_ASSERT(( IntegerConcept<ColorType> ));
|
||||
BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept<Order, size_type> ));
|
||||
BOOST_STATIC_ASSERT((is_same<OrderType, vertex_descriptor>::value));
|
||||
|
||||
|
||||
size_type max_color = 0;
|
||||
const size_type V = num_vertices(G);
|
||||
std::vector<size_type>
|
||||
std::vector<size_type>
|
||||
mark(V, numeric_limits_max(max_color));
|
||||
|
||||
|
||||
typename GraphTraits::vertex_iterator v, vend;
|
||||
for (boost::tie(v, vend) = vertices(G); v != vend; ++v)
|
||||
color[*v] = V - 1; // which means "not colored"
|
||||
|
||||
|
||||
for (size_type i = 0; i < V; i++) {
|
||||
vertex_descriptor current = order[i];
|
||||
|
||||
// mark all the colors of the adjacent vertices
|
||||
typename GraphTraits::adjacency_iterator ai, aend;
|
||||
for (boost::tie(ai, aend) = adjacent_vertices(current, G); ai != aend; ++ai)
|
||||
mark[color[*ai]] = i;
|
||||
mark[color[*ai]] = i;
|
||||
|
||||
// find the smallest color unused by the adjacent vertices
|
||||
size_type smallest_color = 0;
|
||||
while (smallest_color < max_color && mark[smallest_color] == i)
|
||||
while (smallest_color < max_color && mark[smallest_color] == i)
|
||||
++smallest_color;
|
||||
|
||||
// if all the colors are used up, increase the number of colors
|
||||
@ -180,4 +180,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,24 +1,24 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Copy Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><TT>copy_graph</TT></H1>
|
||||
|
||||
<PRE>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./MutableGraph.html">MutableGraph</a>>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./MutableGraph.html">MutableGraph</a>>
|
||||
void copy_graph(const VertexListGraph& G, MutableGraph& G_copy,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
</PRE>
|
||||
@ -113,4 +113,4 @@ The time complexity is <i>O(V + E)</i>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,19 +1,19 @@
|
||||
<HTML>
|
||||
|
||||
<!-- Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
|
||||
<Head>
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Cuthill-Mckee Ordering</Title>
|
||||
</Head>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -46,25 +46,25 @@
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
OutputIterator inverse_permutation,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
|
||||
(2)
|
||||
template <class VertexListGraph, class OutputIterator>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation);
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator, class VertexIndexMap>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation,
|
||||
VertexIndexMap index_map);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator,
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation,
|
||||
VertexIndexMap index_map);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation,
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
|
||||
|
||||
(3)
|
||||
template <class IncidenceGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
@ -72,7 +72,7 @@
|
||||
cuthill_mckee_ordering(const IncidenceGraph& g,
|
||||
std::deque< typename
|
||||
graph_traits<IncidenceGraph>::vertex_descriptor > vertex_queue,
|
||||
OutputIterator inverse_permutation,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
</pre>
|
||||
|
||||
@ -92,10 +92,10 @@ increasing degree.
|
||||
<p>
|
||||
Version 1 of the algorithm lets the user choose the ``starting
|
||||
vertex'', version 2 finds a good starting vertex using the
|
||||
pseudo-peripheral pair heuristic (among each component), while version 3
|
||||
contains the starting nodes for each vertex in the deque. The choice of the
|
||||
``starting vertex'' can have a significant effect on the quality of the
|
||||
ordering. For versions 2 and 3, <tt>find_starting_vertex</tt> will be called
|
||||
pseudo-peripheral pair heuristic (among each component), while version 3
|
||||
contains the starting nodes for each vertex in the deque. The choice of the
|
||||
``starting vertex'' can have a significant effect on the quality of the
|
||||
ordering. For versions 2 and 3, <tt>find_starting_vertex</tt> will be called
|
||||
for each component in the graph, increasing run time significantly.
|
||||
</p>
|
||||
|
||||
@ -140,7 +140,7 @@ For version 1:
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
@ -149,13 +149,13 @@ For version 1:
|
||||
The starting vertex.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the <a
|
||||
href="http://www.boost.org/sgi/stl/OutputIterator.html">output
|
||||
iterator</a> in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
ordering is returned as a Python <tt>list</tt>.
|
||||
|
||||
|
||||
<li> <tt>ColorMap color_map</tt>  (WORK) <br>
|
||||
Used internally to keep track of the progress of the algorithm
|
||||
(to avoid visiting the same vertex twice).<br>
|
||||
@ -171,13 +171,13 @@ For version 2:
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <tt>VertexListGraph& g</tt> (IN) <br>
|
||||
<li> <tt>VertexListGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./VertexListGraph.html">VertexListGraph</a> and <a href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
|
||||
<li> <tt><a href="http://www.boost.org/sgi/stl/OutputIterator.html">
|
||||
OutputIterator</a> inverse_permutation</tt>  (OUT) <br>
|
||||
OutputIterator</a> inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the
|
||||
output iterator in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
@ -198,7 +198,7 @@ For version 3:
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
@ -207,13 +207,13 @@ For version 3:
|
||||
The deque containing the starting vertices for each component.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the <a
|
||||
href="http://www.boost.org/sgi/stl/OutputIterator.html">output
|
||||
iterator</a> in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
ordering is returned as a Python <tt>list</tt>.
|
||||
|
||||
|
||||
<li> <tt>ColorMap color_map</tt>  (WORK) <br>
|
||||
Used internally to keep track of the progress of the algorithm
|
||||
(to avoid visiting the same vertex twice).<br>
|
||||
@ -245,4 +245,4 @@ and <tt>degree_property_map</tt> in <tt>boost/graph/properties.hpp</tt>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Piotr Wygocki 2013
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Cycle Canceling for Min Cost Max Flow</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -23,25 +23,25 @@
|
||||
<i>// named parameter version</i>
|
||||
template <class <a href="./Graph.html">Graph</a>, class P, class T, class R>
|
||||
void cycle_canceling(
|
||||
Graph &g,
|
||||
Graph &g,
|
||||
const bgl_named_params<P, T, R> & params = <i>all defaults</i>)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class <a href="./Graph.html">Graph</a>, class Pred, class Distance, class Reversed, class ResidualCapacity, class Weight>
|
||||
void cycle_canceling(const Graph & g, Weight weight, Reversed rev, ResidualCapacity residual_capacity, Pred pred, Distance distance)
|
||||
void cycle_canceling(const Graph & g, Weight weight, Reversed rev, ResidualCapacity residual_capacity, Pred pred, Distance distance)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The <tt>cycle_canceling()</tt> function calculates the minimum cost flow of a network with given flow. See Section <a
|
||||
href="./graph_theory_review.html#sec:network-flow-algorithms">Network
|
||||
Flow Algorithms</a> for a description of maximum flow.
|
||||
Flow Algorithms</a> for a description of maximum flow.
|
||||
For given flow values <i> f(u,v)</i> function minimizes flow cost in such a way, that for each <i>v in V</i> the
|
||||
<i> sum<sub> u in V</sub> f(v,u) </i> is preserved. Particularly if the input flow was the maximum flow, the function produces min cost max flow.
|
||||
|
||||
|
||||
|
||||
The function calculates the flow values <i>f(u,v)</i> for all <i>(u,v)</i> in
|
||||
<i>E</i>, which are returned in the form of the residual capacity
|
||||
<i>r(u,v) = c(u,v) - f(u,v)</i>.
|
||||
<i>r(u,v) = c(u,v) - f(u,v)</i>.
|
||||
|
||||
<p>
|
||||
There are several special requirements on the input graph and property
|
||||
@ -51,12 +51,12 @@ include the reverse edge for every edge in <i>E</i>. That is, the
|
||||
input graph should be <i>G<sub>in</sub> = (V,{E U
|
||||
E<sup>T</sup>})</i>. The <tt>ReverseEdgeMap</tt> argument <tt>rev</tt>
|
||||
must map each edge in the original graph to its reverse edge, that is
|
||||
<i>(u,v) -> (v,u)</i> for all <i>(u,v)</i> in <i>E</i>.
|
||||
<i>(u,v) -> (v,u)</i> for all <i>(u,v)</i> in <i>E</i>.
|
||||
The <tt>WeightMap</tt> has to map each edge from <i>E<sup>T</sup></i> to <i>-weight</i> of its reversed edge.
|
||||
Note that edges from <i>E</i> can have negative weights.
|
||||
Note that edges from <i>E</i> can have negative weights.
|
||||
<p>
|
||||
If weights in the graph are nonnegative, the
|
||||
<a href="./successive_shortest_path_nonnegative_weights.html"><tt>successive_shortest_path_nonnegative_weights()</tt></a>
|
||||
If weights in the graph are nonnegative, the
|
||||
<a href="./successive_shortest_path_nonnegative_weights.html"><tt>successive_shortest_path_nonnegative_weights()</tt></a>
|
||||
might be better choice for min cost max flow.
|
||||
|
||||
<p>
|
||||
@ -70,7 +70,7 @@ If there is no negative cycle in the network, the cost is optimized.
|
||||
<p>
|
||||
Note that, although we mention capacity in the problem description, the actual algorithm doesn't have to now it.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
In order to find the cost of the result flow use:
|
||||
<a href="./find_flow_cost.html"><tt>find_flow_cost()</tt></a>.
|
||||
|
||||
@ -92,10 +92,10 @@ IN: <tt>Graph& g</tt>
|
||||
<i>(u,v)</i> in the graph, the reverse edge <i>(v,u)</i> must also
|
||||
be in the graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
|
||||
|
||||
IN/OUT: <tt>residual_capacity_map(ResidualCapacityEdgeMap res)</tt>
|
||||
<blockquote>
|
||||
This maps edges to their residual capacity. The type must be a model
|
||||
@ -142,7 +142,7 @@ UTIL: <tt>predecessor_map(PredEdgeMap pred)</tt>
|
||||
using the <tt>i_map</tt> for the index map.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
UTIL: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map. The
|
||||
@ -150,7 +150,7 @@ UTIL: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the distance map.
|
||||
be usable as the key type of the distance map.
|
||||
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/doc/iterator_property_map.html">
|
||||
@ -178,8 +178,8 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
</blockquote>
|
||||
|
||||
<h3>Complexity</h3>
|
||||
In the integer capacity and weight case, if <i>C</i> is the initial cost of the flow, then the complexity is <i> O(C * |V| * |E|)</i>,
|
||||
where <i>O(|E|* |V|)</i> is the complexity of the bellman ford shortest paths algorithm and <i>C</i> is upper bound on number of iteration.
|
||||
In the integer capacity and weight case, if <i>C</i> is the initial cost of the flow, then the complexity is <i> O(C * |V| * |E|)</i>,
|
||||
where <i>O(|E|* |V|)</i> is the complexity of the bellman ford shortest paths algorithm and <i>C</i> is upper bound on number of iteration.
|
||||
In many real world cases number of iterations is much smaller than <i>C</i>.
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@ Piotr Wygocki, University of Warsaw (<A HREF="mailto:wygos@mimuw.edu.pl">wygos a
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
<!-- LocalWords: HTML Siek Edmonds BGCOLOR ffffff ee VLINK ALINK ff IMG SRC
|
||||
-->
|
||||
<!-- LocalWords: gif ALT BR sec edmonds karp TT DIV CELLPADDING TR TD PRE lt
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Directed Acyclic Graph Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -30,21 +30,21 @@ void dag_shortest_paths(const VertexListGraph& g,
|
||||
const bgl_named_params<Param,Tag,Rest>& params)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class VertexListGraph, class DijkstraVisitor,
|
||||
class DistanceMap, class WeightMap, class ColorMap,
|
||||
template <class VertexListGraph, class DijkstraVisitor,
|
||||
class DistanceMap, class WeightMap, class ColorMap,
|
||||
class PredecessorMap,
|
||||
class Compare, class Combine,
|
||||
class Compare, class Combine,
|
||||
class DistInf, class DistZero>
|
||||
void dag_shortest_paths(const VertexListGraph& g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
DistanceMap distance, WeightMap weight, ColorMap color,
|
||||
PredecessorMap pred, DijkstraVisitor vis,
|
||||
PredecessorMap pred, DijkstraVisitor vis,
|
||||
Compare compare, Combine combine, DistInf inf, DistZero zero)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
This algorithm [<A HREF="bibliography.html#clr90">8</A>] solves
|
||||
the single-source shortest-paths problem on a weighted, directed
|
||||
the single-source shortest-paths problem on a weighted, directed
|
||||
acyclic graph (DAG). This algorithm is more efficient for DAG's
|
||||
than either the Dijkstra or Bellman-Ford algorithm.
|
||||
Use breadth-first search instead of this algorithm
|
||||
@ -74,7 +74,7 @@ algorithm's event points.</P>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>VertexListGraph</tt> must be a model of \concept{VertexListGraph}.<br>
|
||||
@ -82,7 +82,7 @@ IN: <tt>const VertexListGraph& g</tt>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
@ -92,7 +92,7 @@ IN: <tt>vertex_descriptor s</tt>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph.
|
||||
The type <tt>WeightMap</tt> must be a model of
|
||||
@ -106,7 +106,7 @@ IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
@ -124,7 +124,7 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the edges in the minimum spanning
|
||||
tree. Upon completion of the algorithm, the edges <i>(p[u],u)</i>
|
||||
@ -139,7 +139,7 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map. The
|
||||
@ -147,7 +147,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the distance map.
|
||||
be usable as the key type of the distance map.
|
||||
|
||||
The value type of the distance map is the element type of a <a
|
||||
href="./Monoid.html">Monoid</tt> formed with the <tt>combine</tt>
|
||||
@ -166,7 +166,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<blockquote>
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the source vertex. The <tt>CompareFunction</tt> type
|
||||
@ -182,7 +182,7 @@ IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<blockquote>
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path. The <tt>CombineFunction</tt> type must be a model of <a
|
||||
@ -199,7 +199,7 @@ IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
<blockquote>
|
||||
The <tt>inf</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>compare(d, inf) == true</tt> for any <tt>d != inf</tt>.
|
||||
@ -209,7 +209,7 @@ IN: <tt>distance_inf(D inf)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
<blockquote>
|
||||
The <tt>zero</tt> value must be the identity element for the
|
||||
<a href="./Monoid.html">Monoid</a> formed by the distance values
|
||||
@ -220,7 +220,7 @@ IN: <tt>distance_zero(D zero)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
<blockquote>
|
||||
This is used during the execution of the algorithm to mark the
|
||||
vertices. The vertices start out white and become gray when they are
|
||||
@ -242,13 +242,13 @@ UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
the graph.
|
||||
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.<br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt><br>
|
||||
@ -272,21 +272,21 @@ The time complexity is <i>O(V + E)</i>.
|
||||
is invoked on each vertex in the graph before the start of the
|
||||
algorithm.
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex as it is added to set <i>S</i>.
|
||||
is invoked on a vertex as it is added to set <i>S</i>.
|
||||
At this point we know that <i>(p[u],u)</i>
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
of the examined vertices is monotonically increasing
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it has
|
||||
been added to set <i>S</i>.
|
||||
been added to set <i>S</i>.
|
||||
<li><b><tt>vis.edge_relaxed(e, g)</tt></b>
|
||||
is invoked on edge <i>(u,v)</i> if <i>d[u] + w(u,v) < d[v]</i>.
|
||||
The edge <i>(u,v)</i> that participated in the last
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
<i>(u,v)</i> is examined and <i>v</i> is WHITE. Since
|
||||
a vertex is colored GRAY when it is discovered,
|
||||
each reacable vertex is discovered exactly once.
|
||||
@ -306,7 +306,7 @@ algorithm.
|
||||
|
||||
<H3>Notes</H3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -322,5 +322,5 @@ algorithm.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Depth-First Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -31,7 +31,7 @@ template <class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class
|
||||
void depth_first_search(const Graph& g, DFSVisitor vis, ColorMap color)
|
||||
|
||||
template <class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class ColorMap>
|
||||
void depth_first_search(const Graph& g, DFSVisitor vis, ColorMap color,
|
||||
void depth_first_search(const Graph& g, DFSVisitor vis, ColorMap color,
|
||||
typename graph_traits<Graph>::vertex_descriptor start)
|
||||
|
||||
</PRE>
|
||||
@ -84,33 +84,33 @@ be used to do this.
|
||||
<td valign="top">
|
||||
<pre>
|
||||
DFS(<i>G</i>)
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
<i>p[u] = u</i>
|
||||
<i>p[u] = u</i>
|
||||
<b>end for</b>
|
||||
<i>time := 0</i>
|
||||
<b>if</b> there is a starting vertex <i>s</i>
|
||||
<b>call</b> DFS-VISIT(<i>G</i>, <i>s</i>)
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>if</b> <i>color[u] =</i> WHITE
|
||||
<b>call</b> DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
<b>end for</b>
|
||||
return (<i>p</i>,<i>d_time</i>,<i>f_time</i>) <br>
|
||||
DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
<i>color[u] :=</i> GRAY
|
||||
<i>d_time[u] := time := time + 1</i>
|
||||
<b>for</b> each <i>v in Adj[u]</i>
|
||||
<i>d_time[u] := time := time + 1</i>
|
||||
<b>for</b> each <i>v in Adj[u]</i>
|
||||
<b>if</b> (<i>color[v] =</i> WHITE)
|
||||
<i>p[v] = u</i>
|
||||
<i>p[v] = u</i>
|
||||
<b>call</b> DFS-VISIT(<i>G</i>, <i>v</i>)
|
||||
<b>else if</b> (<i>color[v] =</i> GRAY)
|
||||
<b>else if</b> (<i>color[v] =</i> GRAY)
|
||||
<i>...</i>
|
||||
<b>else if</b> (<i>color[v] =</i> BLACK)
|
||||
<b>else if</b> (<i>color[v] =</i> BLACK)
|
||||
<i>...</i>
|
||||
<i>...</i>
|
||||
<b>end for</b>
|
||||
<i>color[u] :=</i> BLACK
|
||||
<i>f_time[u] := time := time + 1</i>
|
||||
<i>f_time[u] := time := time + 1</i>
|
||||
<pre>
|
||||
</td>
|
||||
<td valign="top">
|
||||
@ -252,27 +252,27 @@ The time complexity is <i>O(E + V)</i>.
|
||||
|
||||
<li><b><tt>vis.start_vertex(s, g)</tt></b> is invoked on the source
|
||||
vertex once before the start of the search.
|
||||
|
||||
|
||||
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked when a vertex
|
||||
is encountered for the first time.
|
||||
|
||||
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
|
||||
of each vertex after it is discovered.
|
||||
|
||||
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked on each edge as it
|
||||
becomes a member of the edges that form the search tree. If you
|
||||
wish to record predecessors, do so at this event point.
|
||||
|
||||
|
||||
<li><b><tt>vis.back_edge(e, g)</tt></b> is invoked on the back edges in
|
||||
the graph.
|
||||
|
||||
|
||||
<li><b><tt>vis.forward_or_cross_edge(e, g)</tt></b> is invoked on
|
||||
forward or cross edges in the graph. In an undirected graph this
|
||||
method is never called.
|
||||
|
||||
<li><b><tt>vis.finish_edge(e, g)</tt></b> is invoked on the non-tree edges in
|
||||
the graph as well as on each tree edge after its target vertex is finished.
|
||||
|
||||
<li><b><tt>vis.finish_edge(e, g)</tt></b> is invoked on the non-tree edges in
|
||||
the graph as well as on each tree edge after its target vertex is finished.
|
||||
|
||||
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is invoked on a vertex after
|
||||
all of its out edges have been added to the search tree and all of
|
||||
the adjacent vertices have been discovered (but before their
|
||||
@ -295,7 +295,7 @@ The example in <a href="../example/dfs-example.cpp">
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -317,4 +317,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Depth-First Visit</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -25,13 +25,13 @@
|
||||
<PRE>
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap>
|
||||
void depth_first_visit(IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
DFSVisitor& vis, ColorMap color)
|
||||
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap,
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap,
|
||||
class TerminatorFunc>
|
||||
void depth_first_visit(IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
DFSVisitor& vis, ColorMap color, TerminatorFunc func = TerminatorFunc())
|
||||
</PRE>
|
||||
|
||||
@ -41,7 +41,7 @@ component as the source vertex <tt>s</tt>, using the <a
|
||||
href="./graph_theory_review.html#sec:dfs-algorithm">depth-first
|
||||
pattern</a>. The main purpose of the function is for the
|
||||
implementation of <TT>depth_first_search()</TT> though sometimes it is
|
||||
useful on its own.
|
||||
useful on its own.
|
||||
|
||||
<p>
|
||||
The <tt>DFSVisitor</tt> supplied by the user determines what
|
||||
@ -124,7 +124,7 @@ Time complexity is <i>O(E)</i>.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
<p><a name="1">[1]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -141,4 +141,4 @@ Time complexity is <i>O(E)</i>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: dfs_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -108,4 +108,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Dijkstra's Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -29,14 +29,14 @@ dijkstra_shortest_paths(Graph& g,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
typename PredecessorMap, typename DistanceMap,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">CompareFunction</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">CombineFunction</a>,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">CompareFunction</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">CombineFunction</a>,
|
||||
typename DistInf, typename DistZero, typename ColorMap = <i>default</i>>
|
||||
void dijkstra_shortest_paths
|
||||
(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
PredecessorMap predecessor, DistanceMap distance, WeightMap weight,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
PredecessorMap predecessor, DistanceMap distance, WeightMap weight,
|
||||
VertexIndexMap index_map,
|
||||
CompareFunction compare, CombineFunction combine, DistInf inf, DistZero zero,
|
||||
DijkstraVisitor vis, ColorMap color = <i>default</i>)
|
||||
@ -123,12 +123,12 @@ indicated by the labels on the right.
|
||||
<pre>
|
||||
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
|
||||
<b>for</b> each vertex <i>u in V</i> <b>(This loop is not run in dijkstra_shortest_paths_no_init)</b>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
<b>end for</b>
|
||||
<i>color[s] := </i>GRAY
|
||||
<i>d[s] := 0</i>
|
||||
<i>color[s] := </i>GRAY
|
||||
<i>d[s] := 0</i>
|
||||
INSERT(<i>Q</i>, <i>s</i>)
|
||||
<b>while</b> (<i>Q != Ø</i>)
|
||||
<i>u :=</i> EXTRACT-MIN(<i>Q</i>)
|
||||
@ -136,10 +136,10 @@ DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
|
||||
<b>for</b> each vertex <i>v in Adj[u]</i>
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<i>d[v] := w(u,v) + d[u]</i>
|
||||
<i>p[v] := u</i>
|
||||
<b>if</b> (<i>color[v] =</i> WHITE)
|
||||
<i>p[v] := u</i>
|
||||
<b>if</b> (<i>color[v] =</i> WHITE)
|
||||
<i>color[v] :=</i> GRAY
|
||||
INSERT(<i>Q</i>, <i>v</i>)
|
||||
INSERT(<i>Q</i>, <i>v</i>)
|
||||
<b>else if</b> (<i>color[v] =</i> GRAY)
|
||||
DECREASE-KEY(<i>Q</i>, <i>v</i>)
|
||||
<b>else</b>
|
||||
@ -188,17 +188,17 @@ finish vertex <i>u</i>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const Graph& g</tt>
|
||||
IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
<a href="./VertexListGraph.html">Vertex List Graph</a>
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
@ -208,11 +208,11 @@ IN: <tt>vertex_descriptor s</tt>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative, and the algorithm will throw a
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
exception is one of the edges is negative.
|
||||
The type <tt>WeightMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
|
||||
@ -225,13 +225,13 @@ IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("weight")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
heap data structure [<A
|
||||
HREF="bibliography.html#driscoll88">61</A>] when an edge is relaxed.
|
||||
The type
|
||||
The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
@ -246,10 +246,10 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the edges in the shortest path tree, the tree computed
|
||||
by the traversal of the graph. Upon completion of the algorithm, the edges
|
||||
by the traversal of the graph. Upon completion of the algorithm, the edges
|
||||
<i>(p[u],u)</i> for all <i>u in V</i> are in the tree. The shortest path
|
||||
from vertex <i>s</i> to each vertex <i>v</i> in the graph consists of the
|
||||
vertices <i>v</i>, <i>p[v]</i>, <i>p[p[v]]</i>, and so on until <i>s</i> is
|
||||
@ -266,7 +266,7 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map. The
|
||||
@ -274,7 +274,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the distance map.
|
||||
be usable as the key type of the distance map.
|
||||
|
||||
The value type of the distance map is the element type of a <a
|
||||
href="./Monoid.html">Monoid</a> formed with the <tt>combine</tt>
|
||||
@ -293,7 +293,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<blockquote>
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the source vertex. The <tt>CompareFunction</tt> type
|
||||
@ -309,7 +309,7 @@ IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<blockquote>
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path. The <tt>CombineFunction</tt> type must be a model of <a
|
||||
@ -326,7 +326,7 @@ IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
<blockquote>
|
||||
The <tt>inf</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>compare(d, inf) == true</tt> for any <tt>d != inf</tt>.
|
||||
@ -338,7 +338,7 @@ IN: <tt>distance_inf(D inf)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
<blockquote>
|
||||
The <tt>zero</tt> value must be the identity element for the
|
||||
<a href="./Monoid.html">Monoid</a> formed by the distance values
|
||||
@ -350,7 +350,7 @@ IN: <tt>distance_zero(D zero)</tt>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
<blockquote>
|
||||
This is used during the execution of the algorithm to mark the
|
||||
vertices. The vertices start out white and become gray when they are
|
||||
@ -371,13 +371,13 @@ UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
The visitor object is passed by value <a
|
||||
href="#2">[2]</a>.<br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt><br>
|
||||
@ -404,19 +404,19 @@ The time complexity is <i>O(V log V + E)</i>.
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex as it is removed from the priority queue
|
||||
and added to set <i>S</i>. At this point we know that <i>(p[u],u)</i>
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
of the examined vertices is monotonically increasing
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it has
|
||||
been added to set <i>S</i>.
|
||||
been added to set <i>S</i>.
|
||||
<li><b><tt>vis.edge_relaxed(e, g)</tt></b>
|
||||
is invoked on edge <i>(u,v)</i> if <i>d[u] + w(u,v) < d[v]</i>.
|
||||
The edge <i>(u,v)</i> that participated in the last
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
<i>(u,v)</i> is examined and <i>v</i> is WHITE. Since
|
||||
a vertex is colored GRAY when it is discovered,
|
||||
each reachable vertex is discovered exactly once. This
|
||||
@ -445,7 +445,7 @@ S</i> vertices in the priority queue at once, but instead only those
|
||||
vertices in <i>V - S</i> that are discovered and therefore have a
|
||||
distance less than infinity.
|
||||
|
||||
<p><a name="2">[2]</a>
|
||||
<p><a name="2">[2]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
@ -461,4 +461,4 @@ distance less than infinity.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Michael Hansen 2009
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Dijkstra's Shortest Paths (No Color Map)</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -27,29 +27,29 @@ void dijkstra_shortest_paths_no_color_map
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
const bgl_named_params<Param,Tag,Rest>& params);
|
||||
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
typename PredecessorMap, typename DistanceMap,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">DistanceCompare</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">DistanceCompare</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename DistanceInfinity, typename DistanceZero>
|
||||
void dijkstra_shortest_paths_no_color_map
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
VertexIndexMap index_map,
|
||||
DistanceCompare distance_compare, DistanceWeightCombine distance_weight_combine,
|
||||
DistanceInfinity distance_infinity, DistanceZero distance_zero);
|
||||
|
||||
<i>// version that does not initialize the property maps</i>
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
typename PredecessorMap, typename DistanceMap,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">DistanceCompare</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.boost.org/sgi/stl/BinaryPredicate.html">DistanceCompare</a>, typename <a href="http://www.boost.org/sgi/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename DistanceInfinity, typename DistanceZero>
|
||||
void dijkstra_shortest_paths_no_color_map_no_init
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
VertexIndexMap index_map,
|
||||
DistanceCompare distance_compare, DistanceWeightCombine distance_weight_combine,
|
||||
DistanceInfinity distance_infinity, DistanceZero distance_zero);
|
||||
@ -116,16 +116,16 @@ indicated by the labels on the right.
|
||||
<td valign="top">
|
||||
<pre>
|
||||
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
|
||||
<i>d[s] := 0</i>
|
||||
<i>d[s] := 0</i>
|
||||
INSERT(<i>Q</i>, <i>s</i>)
|
||||
<b>while</b> (<i>Q != Ø</i>)
|
||||
<i>u :=</i> EXTRACT-MIN(<i>Q</i>)
|
||||
<b>for</b> each vertex <i>v in Adj[u]</i>
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<i>d[v] := w(u,v) + d[u]</i>
|
||||
<i>p[v] := u</i>
|
||||
<b>if</b> (<i>d[v]</i> was originally infinity)
|
||||
INSERT(<i>Q</i>, <i>v</i>)
|
||||
<i>p[v] := u</i>
|
||||
<b>if</b> (<i>d[v]</i> was originally infinity)
|
||||
INSERT(<i>Q</i>, <i>v</i>)
|
||||
<b>else</b>
|
||||
DECREASE-KEY(<i>Q</i>, <i>v</i>)
|
||||
<b>else</b>
|
||||
@ -164,15 +164,15 @@ finish vertex <i>u</i>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const Graph& graph</tt>
|
||||
IN: <tt>const Graph& graph</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
<a href="./VertexListGraph.html">Vertex List Graph</a>
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor start_vertex</tt>
|
||||
IN: <tt>vertex_descriptor start_vertex</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
@ -180,11 +180,11 @@ IN: <tt>vertex_descriptor start_vertex</tt>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>weight_map(WeightMap weight_map)</tt>
|
||||
IN: <tt>weight_map(WeightMap weight_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative and non-infinite <a href="#3">[3]</a>. The algorithm will throw a
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
exception is one of the edges is negative.
|
||||
The type <tt>WeightMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
|
||||
@ -194,13 +194,13 @@ IN: <tt>weight_map(WeightMap weight_map)</tt>
|
||||
<b>Default:</b> <tt>get(edge_weight, graph)</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>index_map(VertexIndexMap index_map)</tt>
|
||||
IN: <tt>index_map(VertexIndexMap index_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(graph))</tt>. This is necessary for efficient updates of the
|
||||
heap data structure [<A
|
||||
HREF="bibliography.html#driscoll88">61</A>] when an edge is relaxed.
|
||||
The type
|
||||
The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
@ -213,7 +213,7 @@ IN: <tt>index_map(VertexIndexMap index_map)</tt>
|
||||
<br>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap predecessor_map)</tt>
|
||||
OUT: <tt>predecessor_map(PredecessorMap predecessor_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the edges in the minimum spanning
|
||||
tree. Upon completion of the algorithm, the edges <i>(p[u],u)</i>
|
||||
@ -229,7 +229,7 @@ OUT: <tt>predecessor_map(PredecessorMap predecessor_map)</tt>
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap distance_map)</tt>
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap distance_map)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex <tt>start_vertex</tt> to each
|
||||
vertex in the graph <tt>graph</tt> is recorded in this property map. The
|
||||
@ -237,7 +237,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap distance_map)</tt>
|
||||
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the distance map.
|
||||
be usable as the key type of the distance map.
|
||||
|
||||
The value type of the distance map is the element type of a <a
|
||||
href="./Monoid.html">Monoid</a> formed with the <tt>distance_weight_combine</tt>
|
||||
@ -254,7 +254,7 @@ UTIL/OUT: <tt>distance_map(DistanceMap distance_map)</tt>
|
||||
map.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction distance_compare)</tt>
|
||||
IN: <tt>distance_compare(CompareFunction distance_compare)</tt>
|
||||
<blockquote>
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the source vertex. The <tt>DistanceCompareFunction</tt> type
|
||||
@ -268,7 +268,7 @@ IN: <tt>distance_compare(CompareFunction distance_compare)</tt>
|
||||
property_traits<DistanceMap>::value_type</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction distance_weight_combine)</tt>
|
||||
IN: <tt>distance_combine(CombineFunction distance_weight_combine)</tt>
|
||||
<blockquote>
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path. The <tt>DistanceWeightCombineFunction</tt> type must be a model of <a
|
||||
@ -283,7 +283,7 @@ IN: <tt>distance_combine(CombineFunction distance_weight_combine)</tt>
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D distance_infinity)</tt>
|
||||
IN: <tt>distance_inf(D distance_infinity)</tt>
|
||||
<blockquote>
|
||||
The <tt>distance_infinity</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>distance_compare(d, distance_infinity) == true</tt> for any <tt>d != distance_infinity</tt>.
|
||||
@ -293,7 +293,7 @@ IN: <tt>distance_inf(D distance_infinity)</tt>
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D distance_zero)</tt>
|
||||
IN: <tt>distance_zero(D distance_zero)</tt>
|
||||
<blockquote>
|
||||
The <tt>distance_zero</tt> value must be the identity element for the
|
||||
<a href="./Monoid.html">Monoid</a> formed by the distance values
|
||||
@ -302,13 +302,13 @@ IN: <tt>distance_zero(D distance_zero)</tt>
|
||||
<b>Default:</b> <tt>D()</tt>with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
The visitor object is passed by value <a
|
||||
href="#2">[2]</a>.<br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt><br>
|
||||
@ -330,19 +330,19 @@ The time complexity is <i>O(V log V + E)</i>.
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex as it is removed from the priority queue
|
||||
and added to set <i>S</i>. At this point we know that <i>(p[u],u)</i>
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
of the examined vertices is monotonically increasing
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it has
|
||||
been added to set <i>S</i>.
|
||||
been added to set <i>S</i>.
|
||||
<li><b><tt>vis.edge_relaxed(e, g)</tt></b>
|
||||
is invoked on edge <i>(u,v)</i> if <i>d[u] + w(u,v) < d[v]</i>.
|
||||
The edge <i>(u,v)</i> that participated in the last
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
<i>(u,v)</i> is examined and <i>v</i> has not yet been discovered (i.e. its distance was infinity before relaxation was attempted on the edge). This
|
||||
is also when the vertex is inserted into the priority queue.
|
||||
<li><b><tt>vis.edge_not_relaxed(e, g)</tt></b>
|
||||
@ -370,17 +370,17 @@ S</i> vertices in the priority queue at once, but instead only those
|
||||
vertices in <i>V - S</i> that are discovered and therefore have a
|
||||
distance less than infinity.
|
||||
|
||||
<p><a name="2">[2]</a>
|
||||
<p><a name="2">[2]</a>
|
||||
Since the visitor parameter is passed by value, if your visitor
|
||||
contains state then any changes to the state during the algorithm
|
||||
will be made to a copy of the visitor object, not the visitor object
|
||||
passed in. Therefore you may want the visitor to hold this state by
|
||||
pointer or reference.
|
||||
|
||||
<p><a name="3">[3]</a>
|
||||
|
||||
<p><a name="3">[3]</a>
|
||||
The algorithm will not work correctly if any of the edge weights are equal to infinity since the infinite distance value is used to determine if a vertex has been discovered.
|
||||
|
||||
<p><a name="4">[4]</a>
|
||||
|
||||
<p><a name="4">[4]</a>
|
||||
Calls to the visitor events occur in the same order as <tt>dijkstra_shortest_paths</tt> (i.e. <i>discover_vertex(u)</i> will always be called after <i>examine_vertex(u)</i> for an undiscovered vertex <i>u</i>). However, the vertices of the graph given to <i>dijkstra_shortest_paths_no_color_map</i> will <b>not</b> necessarily be visited in the same order as <i>dijkstra_shortest_paths</i>.
|
||||
|
||||
<br>
|
||||
@ -391,4 +391,4 @@ distance less than infinity.
|
||||
Trustees of Indiana University</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: dijkstra_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -37,7 +37,7 @@ by Dijkstra's algorithm.
|
||||
|
||||
<pre>
|
||||
boost::dijkstra_shortest_paths
|
||||
(G, vertex(a, G),
|
||||
(G, vertex(a, G),
|
||||
distance_map(make_iterator_property_map(distance.begin(), vertex_id, distance[0])).
|
||||
predecessor_map(make_iterator_property_map(parent.begin(), vertex_id, parent[0])).
|
||||
visitor(make_dijkstra_visitor(copy_graph(G_copy, on_examine_edge()))));
|
||||
@ -122,4 +122,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) David Doria 2012
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Directed Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -93,4 +93,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -73,7 +73,7 @@ disjoint_sets<Rank, Parent, FindCompress>
|
||||
<pre>
|
||||
...
|
||||
disjoint_sets<Rank, Parent, FindCompress> dsets(rank, p);
|
||||
|
||||
|
||||
for (ui = vertices(G).first; ui != vertices(G).second; ++ui)
|
||||
dsets.make_set(*ui);
|
||||
...
|
||||
@ -282,7 +282,7 @@ Element operator()(Parent p, Element x)
|
||||
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
|
||||
height="31" width="88"></a></p>
|
||||
|
||||
<p>Revised
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->01
|
||||
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38508" --></p>
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
|
||||
height="31" width="88"></a></p>
|
||||
|
||||
<p>Revised
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->01
|
||||
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38508" --></p>
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: distance_recorder</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -124,7 +124,7 @@ template <class Edge, class Graph><br>
|
||||
void operator()(Edge e, const Graph& g);
|
||||
</tt></td>
|
||||
<td>
|
||||
Given edge <i>e = (u,v)</i>, this records the distance of <i>v</i> as
|
||||
Given edge <i>e = (u,v)</i>, this records the distance of <i>v</i> as
|
||||
one plus the distance of <i>u</i>.
|
||||
</td>
|
||||
</tr>
|
||||
@ -173,7 +173,7 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
<!-- LocalWords: DistanceMap EventTag EventVisitor map bfs dfs const Siek
|
||||
-->
|
||||
<!-- LocalWords: EventVisitorList WritablePropertyMap Univ Quan
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Edge List Class</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -52,7 +52,7 @@ Applying the Bellman-Ford shortest paths algorithm to an
|
||||
E(x,y), E(x,v),
|
||||
E(y,v), E(y,z),
|
||||
E(z,u), E(z,x) };
|
||||
|
||||
|
||||
int weight[] = { -4, 8, 5,
|
||||
-2,
|
||||
9, -3,
|
||||
@ -61,16 +61,16 @@ Applying the Bellman-Ford shortest paths algorithm to an
|
||||
|
||||
typedef boost::edge_list<E*> Graph;
|
||||
Graph g(edges, edges + sizeof(edges) / sizeof(E));
|
||||
|
||||
|
||||
std::vector<int> distance(N, std::numeric_limits<short>::max());
|
||||
std::vector<int> parent(N,-1);
|
||||
|
||||
|
||||
distance[z] = 0;
|
||||
parent[z] = z;
|
||||
bool r = boost::bellman_ford_shortest_paths(g, int(N), weight,
|
||||
distance.begin(),
|
||||
parent.begin());
|
||||
if (r)
|
||||
if (r)
|
||||
for (int i = 0; i < N; ++i)
|
||||
std::cout << name[i] << ": " << distance[i]
|
||||
<< " " << name[parent[i]] << std::endl;
|
||||
@ -145,7 +145,7 @@ boost::graph_traits<edge_list>::edge_descriptor
|
||||
</tt>
|
||||
<br><br>
|
||||
The type for the edge descriptors associated with the
|
||||
<TT>edge_list</TT>.
|
||||
<TT>edge_list</TT>.
|
||||
|
||||
<hr>
|
||||
|
||||
@ -218,4 +218,4 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: edge_predecessor_recorder</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -188,7 +188,7 @@ HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
<!-- LocalWords: PredEdgeMap EventTag EventVisitor map bfs dfs const
|
||||
-->
|
||||
<!-- LocalWords: EventVisitorList WritablePropertyMap Siek Univ Quan
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Edmonds-Karp Maximum Flow</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -23,20 +23,20 @@
|
||||
<i>// named parameter version</i>
|
||||
template <class <a href="./Graph.html">Graph</a>, class P, class T, class R>
|
||||
typename detail::edge_capacity_value<Graph, P, T, R>::value_type
|
||||
edmonds_karp_max_flow(Graph& g,
|
||||
edmonds_karp_max_flow(Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor src,
|
||||
typename graph_traits<Graph>::vertex_descriptor sink,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class <a href="./Graph.html">Graph</a>,
|
||||
template <class <a href="./Graph.html">Graph</a>,
|
||||
class CapacityEdgeMap, class ResidualCapacityEdgeMap,
|
||||
class ReverseEdgeMap, class ColorMap, class PredEdgeMap>
|
||||
typename property_traits<CapacityEdgeMap>::value_type
|
||||
edmonds_karp_max_flow(Graph& g,
|
||||
edmonds_karp_max_flow(Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor src,
|
||||
typename graph_traits<Graph>::vertex_descriptor sink,
|
||||
CapacityEdgeMap cap, ResidualCapacityEdgeMap res, ReverseEdgeMap rev,
|
||||
CapacityEdgeMap cap, ResidualCapacityEdgeMap res, ReverseEdgeMap rev,
|
||||
ColorMap color, PredEdgeMap pred)
|
||||
</PRE>
|
||||
|
||||
@ -48,7 +48,7 @@ Flow Algorithms</a> for a description of maximum flow. The calculated
|
||||
maximum flow will be the return value of the function. The function
|
||||
also calculates the flow values <i>f(u,v)</i> for all <i>(u,v)</i> in
|
||||
<i>E</i>, which are returned in the form of the residual capacity
|
||||
<i>r(u,v) = c(u,v) - f(u,v)</i>.
|
||||
<i>r(u,v) = c(u,v) - f(u,v)</i>.
|
||||
|
||||
<p>
|
||||
There are several special requirements on the input graph and property
|
||||
@ -112,12 +112,12 @@ IN: <tt>vertex_descriptor src</tt>
|
||||
<blockquote>
|
||||
The source vertex for the flow network graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
IN: <tt>vertex_descriptor sink</tt>
|
||||
<blockquote>
|
||||
The sink vertex for the flow network graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ IN: <tt>capacity_map(CapacityEdgeMap cap)</tt>
|
||||
key type of the map must be the graph's edge descriptor type.<br>
|
||||
<b>Default:</b> <tt>get(edge_capacity, g)</tt>
|
||||
</blockquote>
|
||||
|
||||
|
||||
OUT: <tt>residual_capacity_map(ResidualCapacityEdgeMap res)</tt>
|
||||
<blockquote>
|
||||
This maps edges to their residual capacity. The type must be a model
|
||||
@ -228,7 +228,7 @@ from a file in the DIMACS format and computes the maximum flow.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
<!-- LocalWords: HTML Siek Edmonds BGCOLOR ffffff ee VLINK ALINK ff IMG SRC
|
||||
-->
|
||||
<!-- LocalWords: gif ALT BR sec edmonds karp TT DIV CELLPADDING TR TD PRE lt
|
||||
|
138
doc/eg1-iso.cpp
138
doc/eg1-iso.cpp
@ -30,77 +30,95 @@
|
||||
|
||||
using namespace boost;
|
||||
|
||||
|
||||
enum { a, b, c, d, e, f, g, h };
|
||||
enum { _1, _2, _3, _4, _5, _6, _7, _8 };
|
||||
|
||||
void test_isomorphism()
|
||||
enum
|
||||
{
|
||||
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphA;
|
||||
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphB;
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
e,
|
||||
f,
|
||||
g,
|
||||
h
|
||||
};
|
||||
enum
|
||||
{
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
_4,
|
||||
_5,
|
||||
_6,
|
||||
_7,
|
||||
_8
|
||||
};
|
||||
|
||||
char a_names[] = "abcdefgh";
|
||||
char b_names[] = "12345678";
|
||||
void test_isomorphism()
|
||||
{
|
||||
typedef adjacency_list< vecS, vecS, bidirectionalS > GraphA;
|
||||
typedef adjacency_list< vecS, vecS, bidirectionalS > GraphB;
|
||||
|
||||
GraphA Ga(8);
|
||||
add_edge(a, d, Ga);
|
||||
add_edge(a, h, Ga);
|
||||
add_edge(b, c, Ga);
|
||||
add_edge(b, e, Ga);
|
||||
add_edge(c, f, Ga);
|
||||
add_edge(d, a, Ga);
|
||||
add_edge(d, h, Ga);
|
||||
add_edge(e, b, Ga);
|
||||
add_edge(f, b, Ga);
|
||||
add_edge(f, e, Ga);
|
||||
add_edge(g, d, Ga);
|
||||
add_edge(g, f, Ga);
|
||||
add_edge(h, c, Ga);
|
||||
add_edge(h, g, Ga);
|
||||
char a_names[] = "abcdefgh";
|
||||
char b_names[] = "12345678";
|
||||
|
||||
GraphB Gb(8);
|
||||
add_edge(_1, _6, Gb);
|
||||
add_edge(_2, _1, Gb);
|
||||
add_edge(_2, _5, Gb);
|
||||
add_edge(_3, _2, Gb);
|
||||
add_edge(_3, _4, Gb);
|
||||
add_edge(_4, _2, Gb);
|
||||
add_edge(_4, _3, Gb);
|
||||
add_edge(_5, _4, Gb);
|
||||
add_edge(_5, _6, Gb);
|
||||
add_edge(_6, _7, Gb);
|
||||
add_edge(_6, _8, Gb);
|
||||
add_edge(_7, _8, Gb);
|
||||
add_edge(_8, _1, Gb);
|
||||
add_edge(_8, _7, Gb);
|
||||
|
||||
GraphA Ga(8);
|
||||
add_edge(a, d, Ga);
|
||||
add_edge(a, h, Ga);
|
||||
add_edge(b, c, Ga);
|
||||
add_edge(b, e, Ga);
|
||||
add_edge(c, f, Ga);
|
||||
add_edge(d, a, Ga);
|
||||
add_edge(d, h, Ga);
|
||||
add_edge(e, b, Ga);
|
||||
add_edge(f, b, Ga);
|
||||
add_edge(f, e, Ga);
|
||||
add_edge(g, d, Ga);
|
||||
add_edge(g, f, Ga);
|
||||
add_edge(h, c, Ga);
|
||||
add_edge(h, g, Ga);
|
||||
|
||||
std::vector<std::size_t> in_degree_A(num_vertices(Ga));
|
||||
boost::detail::compute_in_degree(Ga, &in_degree_A[0]);
|
||||
GraphB Gb(8);
|
||||
add_edge(_1, _6, Gb);
|
||||
add_edge(_2, _1, Gb);
|
||||
add_edge(_2, _5, Gb);
|
||||
add_edge(_3, _2, Gb);
|
||||
add_edge(_3, _4, Gb);
|
||||
add_edge(_4, _2, Gb);
|
||||
add_edge(_4, _3, Gb);
|
||||
add_edge(_5, _4, Gb);
|
||||
add_edge(_5, _6, Gb);
|
||||
add_edge(_6, _7, Gb);
|
||||
add_edge(_6, _8, Gb);
|
||||
add_edge(_7, _8, Gb);
|
||||
add_edge(_8, _1, Gb);
|
||||
add_edge(_8, _7, Gb);
|
||||
|
||||
std::vector<std::size_t> in_degree_B(num_vertices(Gb));
|
||||
boost::detail::compute_in_degree(Gb, &in_degree_B[0]);
|
||||
std::vector< std::size_t > in_degree_A(num_vertices(Ga));
|
||||
boost::detail::compute_in_degree(Ga, &in_degree_A[0]);
|
||||
|
||||
degree_vertex_invariant<std::size_t*, GraphA>
|
||||
invariantA(&in_degree_A[0], Ga);
|
||||
degree_vertex_invariant<std::size_t*, GraphB>
|
||||
invariantB(&in_degree_B[0], Gb);
|
||||
std::vector< std::size_t > in_degree_B(num_vertices(Gb));
|
||||
boost::detail::compute_in_degree(Gb, &in_degree_B[0]);
|
||||
|
||||
std::vector<graph_traits<GraphB>::vertex_descriptor> f(num_vertices(Ga));
|
||||
degree_vertex_invariant< std::size_t*, GraphA > invariantA(
|
||||
&in_degree_A[0], Ga);
|
||||
degree_vertex_invariant< std::size_t*, GraphB > invariantB(
|
||||
&in_degree_B[0], Gb);
|
||||
|
||||
bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB,
|
||||
(invariantB.max)(),
|
||||
get(vertex_index, Ga), get(vertex_index, Gb));
|
||||
assert(ret == true);
|
||||
std::vector< graph_traits< GraphB >::vertex_descriptor > f(
|
||||
num_vertices(Ga));
|
||||
|
||||
for (std::size_t i = 0; i < num_vertices(Ga); ++i)
|
||||
std::cout << "f(" << a_names[i] << ")=" << b_names[f[i]] << std::endl;
|
||||
|
||||
BOOST_TEST(verify_isomorphism(Ga, Gb, &f[0]));
|
||||
bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB,
|
||||
(invariantB.max)(), get(vertex_index, Ga), get(vertex_index, Gb));
|
||||
assert(ret == true);
|
||||
|
||||
for (std::size_t i = 0; i < num_vertices(Ga); ++i)
|
||||
std::cout << "f(" << a_names[i] << ")=" << b_names[f[i]] << std::endl;
|
||||
|
||||
BOOST_TEST(verify_isomorphism(Ga, Gb, &f[0]));
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
test_isomorphism();
|
||||
return boost::report_errors();
|
||||
test_isomorphism();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) 2004, 2005 The Trustees of Indiana University
|
||||
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
Authors: Douglas Gregor
|
||||
Jeremiah Willcock
|
||||
Andrew Lumsdaine
|
||||
@ -24,10 +24,10 @@ function address(host, user) {
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<tt>erdos_renyi_iterator</tt>
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
erdos_renyi_iterator operator++(int);
|
||||
bool operator==(const erdos_renyi_iterator& other) const;
|
||||
bool operator!=(const erdos_renyi_iterator& other) const;
|
||||
};
|
||||
};
|
||||
</PRE>
|
||||
|
||||
<p> This class template implements a generator for Erdös-Renyi
|
||||
@ -149,4 +149,4 @@ Indiana University (<script language="Javascript">address("osl.iu.edu", "lums")<
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</HTML>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2002
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Exceptions</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
|
18
doc/faq.html
18
doc/faq.html
@ -1,17 +1,17 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: FAQ</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@ -76,8 +76,8 @@ convenient. Granted, this is not a huge difference, but since there
|
||||
weren't other strong reasons, it was enough for us to choose free
|
||||
functions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
<p>
|
||||
Our religious reason for choosing free functions is to send the message
|
||||
that BGL is a generic library, and not a traditional object-oriented
|
||||
library. OO was hip in the 80s and 90s, but its time we moved beyond!
|
||||
@ -124,13 +124,13 @@ library. OO was hip in the 80s and 90s, but its time we moved beyond!
|
||||
not being found, such as:
|
||||
<pre>
|
||||
../../../boost/concept_check.hpp:209: no match for
|
||||
`boost::detail::error_property_not_found & ==
|
||||
`boost::detail::error_property_not_found & ==
|
||||
boost::detail::error_property_not_found &'
|
||||
</pre>
|
||||
or a message such as:
|
||||
<pre>
|
||||
../../..\boost/graph/depth_first_search.hpp(78) : error C2664: 'white'
|
||||
: cannot convert parameter 1 from
|
||||
: cannot convert parameter 1 from
|
||||
'struct boost::detail::error_property_not_found'
|
||||
to 'enum boost::default_color_type'
|
||||
</pre>
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Portrait
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
@ -2,7 +2,7 @@
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user