Compare commits

...

20 Commits

Author SHA1 Message Date
nobody f45a17ba41 This commit was manufactured by cvs2svn to create tag
'Version_1_33_1_beta'.

[SVN r31604]
2005-11-08 23:18:41 +00:00
Douglas Gregor 43c1f8a033 Reverse topological order
[SVN r31497]
2005-10-27 14:31:49 +00:00
Douglas Gregor 4063919a57 minimim_degree_ordering Python bindings
[SVN r31484]
2005-10-26 21:45:04 +00:00
Douglas Gregor 9a074a7e51 Do not crash when n == 0
[SVN r31468]
2005-10-25 19:56:20 +00:00
Douglas Gregor f027c1c895 Remove Python tags for Jeremy
[SVN r31443]
2005-10-24 15:07:04 +00:00
Rene Rivera 2e7f8349c5 Avoid duplicate specialization of hash<void*> when using STLport5. All graph, and python which uses graph, tests pass on MinGW+STLPort5 now.
[SVN r31324]
2005-10-14 15:57:10 +00:00
Rene Rivera e1e2b225b1 Fix compile failures on CodeWarrior, where free and malloc are correctly not in the global namespace.
[SVN r31201]
2005-10-05 18:57:33 +00:00
Douglas Gregor 97f5379094 Fix bug in enumerating grid-force pairs
[SVN r31006]
2005-09-16 04:39:52 +00:00
Douglas Gregor 41e0867907 Always use log2
[SVN r30916]
2005-09-12 14:58:37 +00:00
Douglas Gregor e62876d483 Use an integer log2 instead of the double version
[SVN r30892]
2005-09-09 22:15:05 +00:00
Douglas Gregor 70d4967318 Add bibliography link for PLOD algorithm
[SVN r30846]
2005-09-07 13:58:17 +00:00
Douglas Gregor 6777fb6f8f Fix handling of bundled properties
[SVN r30835]
2005-09-06 20:34:31 +00:00
Douglas Gregor 7a615168e2 Add support for reading/writing adjacency list format
[SVN r30833]
2005-09-06 19:55:40 +00:00
Douglas Gregor 85f275a7e0 Fix vertex_queue initialization
[SVN r30828]
2005-09-06 15:55:43 +00:00
Douglas Gregor 9d25102143 kFreeBSD support from Domenico Andreoli
[SVN r30687]
2005-08-26 15:00:14 +00:00
Jonathan Turkanis e341b7a672 fixed broken links
[SVN r30437]
2005-08-04 00:09:45 +00:00
Jonathan Turkanis 0452c06499 fixed broken links
[SVN r30436]
2005-08-04 00:03:47 +00:00
Jonathan Turkanis 8f1cebb377 fixed broken links
[SVN r30388]
2005-08-03 00:40:18 +00:00
Jonathan Turkanis 47da7dd548 fixed broken links
[SVN r30387]
2005-08-02 22:02:11 +00:00
nobody 2c69bbae8a This commit was manufactured by cvs2svn to create branch 'RC_1_33_0'.
[SVN r30300]
2005-07-28 18:22:24 +00:00
40 changed files with 347 additions and 103 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ extension bgl
../../src/python/digraph.cpp
# Graph I/O
../../src/python/graphviz.cpp
../../src/python/adjlist.cpp
# Graph algorithms
# Core Algorithm Patterns
../../src/python/breadth_first_search.cpp
@@ -47,7 +48,7 @@ extension bgl
# Sparse Matrix Ordering
../../src/python/cuthill_mckee_ordering.cpp
../../src/python/king_ordering.cpp
# ../../src/python/minimum_degree_ordering.cpp
../../src/python/minimum_degree_ordering.cpp
../../src/python/circle_layout.cpp
../../src/python/fruchterman_reingold.cpp
../../src/python/kamada_kawai_spring_layout.cpp
+1
View File
@@ -156,6 +156,7 @@ when there is a negative cycle in the graph.
<li><a href="./bellman_visitor.html"><tt>bellman_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>BellmanFordVisitor</tt> concept in Python,
+1
View File
@@ -174,6 +174,7 @@ all the out-edges of <tt>u</tt> have been examined.
<li><a href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>DFSVisitor</tt> concept in Python,
+1
View File
@@ -184,6 +184,7 @@ search tree and all of the adjacent vertices have been discovered
<li><a href="./dijkstra_visitor.html"><tt>dijkstra_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>DijkstraVisitor</tt> concept in Python,
+1 -1
View File
@@ -35,7 +35,7 @@ namespace boost {
template &lt;class Graph, class VertexDescriptor, class OutEdgeIter&gt;
class adjacency_iterator_generator {
public:
typedef <a href="../../utility/iterator_adaptors.htm#iterator_adaptor">iterator_adaptor</a>&lt;...&gt; type;
typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a>&lt;...&gt; type;
};
}
</pre>
+5
View File
@@ -380,6 +380,11 @@ Software--Practice & Experience, 21 (11), pp. 1129-1164, 1991.
<em>An automatic reordering scheme for simultaneous equations derived from network analysis.</em><br>
Int. J. Numer. Methods Engrg. 2, pp. 523-533, 1970.
<p></p><dt><a name="palmer2000">63</a>
<dd>C. Palmer and J. Steffan<br>
<em>Generating Network Topologies That Obey Power Laws</em><br>
Proceedings of GLOBECOM. November, 2000.
</dl>
<br>
+1 -1
View File
@@ -242,7 +242,7 @@ UTIL: <tt>buffer(Buffer&amp; Q)</tt>
<b>Default:</b> <tt>boost::queue</tt><br>
<b>Python</b>: The buffer must derive from the <a
href="./Buffer.html#python">Buffer</a> type for the graph.
href="./Buffer.html">Buffer</a> type for the graph.
</blockquote>
+1 -1
View File
@@ -113,7 +113,7 @@ UTIL: <tt>buffer(Buffer&amp; Q)</tt>
<b>Default:</b> <tt>boost::queue</tt><br>
<b>Python</b>: The buffer must derive from the <a
href="./Buffer.html#python">Buffer</a> type for the graph.
href="./Buffer.html">Buffer</a> type for the graph.
</blockquote>
+2 -2
View File
@@ -26,9 +26,9 @@
<ul>
<li>Dynamic graph algorithms such as described in <a
href="http://citeseer.nj.nec.com/eppstein99dynamic.html">Dynamic Graph
href="http://citeseer.ist.psu.edu/eppstein99dynamic.html">Dynamic Graph
Algorithms</a> and <a
href="http://citeseer.nj.nec.com/alberts98software.html">A Software
href="http://citeseer.ist.psu.edu/alberts98software.html">A Software
Library of Dynamic Graph Algorithms</a>.
<li>Polish up code/docs for pending items and champion the formal
+1 -1
View File
@@ -83,7 +83,7 @@ The goal of the Cuthill-Mckee (and reverse Cuthill-Mckee) ordering
algorithm[<A
HREF="bibliography.html#george81:__sparse_pos_def">14</A>, <A
HREF="bibliography.html#cuthill69:reducing_bandwith">43</A>, <a
href="bibliography.html#liu75:rcm">44</a>, <a
href="bibliography.html#liu75:anal_cm_rcm">44</a>, <a
href="bibliography.html#george71:fem">45</a> ] is to reduce the <a
href="./bandwidth.html">bandwidth</a> of a graph by reordering the
indices assigned to each vertex. The Cuthill-Mckee ordering algorithm
+1 -1
View File
@@ -54,7 +54,7 @@ than either the Dijkstra or Bellman-Ford algorithm.
Use breadth-first search instead of this algorithm
when all edge weights are equal to one. For the definition of the
shortest-path problem see Section <A
HREF="graph_theory_review.html#sec:shortest-path-algorithms">Shortest-Paths
HREF="graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
Algorithms</A> for some background to the shortest-path problem.
</P>
+2 -2
View File
@@ -27,12 +27,12 @@
<P>
<PRE>
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>&gt;
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap&gt;
void depth_first_visit(IncidenceGraph& g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
DFSVisitor&amp; vis, ColorMap color)
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>,
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap,
class TerminatorFunc&gt;
void depth_first_visit(IncidenceGraph& g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
+1 -1
View File
@@ -56,7 +56,7 @@ algorithm for the case when some edge weights are negative. Use
breadth-first search instead of Dijkstra's algorithm when all edge
weights are equal to one. For the definition of the shortest-path
problem see Section <A
HREF="graph_theory_review.html#sec:shortest-path-algorithms">Shortest-Paths
HREF="graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
Algorithms</A> for some background to the shortest-path problem.
</P>
+1 -1
View File
@@ -29,7 +29,7 @@ the reader has some previous acquaintance with graph algorithms, this
chapter should be enough to get started. If the reader has no
previous background in graph algorithms we suggest a more thorough
introduction such as <a
href="http://www.toc.lcs.mit.edu/~clr/">Introduction to Algorithms</a>
href="http://toc.lcs.mit.edu/~clr/">Introduction to Algorithms</a>
by Cormen, Leiserson, and Rivest.
<P>
+6
View File
@@ -80,6 +80,12 @@ September 27, 2000.
<h2>Changes by version</h2>
<a name="by-version">
<ul>
<li>Version 1.33.1<br><b>Bug Fixes</b>
<ul>
<li><a href="fruchterman_reingold.html"><TT>fruchterman_reingold_force_directed_layout</TT></A>: Fixed enumeration of grid-force pairs, which caused some odd graph formations along grid lines.</li>
<li><a href="king_ordering.html"><tt>king_ordering</tt></a> and <a
href="cuthill_mckee_ordering.html"><tt>cuthill_mckee_ordering</tt></a>: Fixed bug that caused failures with the multi-component version of these algorithms.</li>
</ul></li>
<li>Version 1.33.0<br><b>New algorithms and components</b>
<ul>
<li><a href="python.html">Experimental Python bindings</a>, from Doug Gregor and Indiana University.</li>
+1 -1
View File
@@ -35,7 +35,7 @@ the situation where edges are both added and removed from the graph,
hence it is called <b><i>incremental</i></b><a
href="bibliography.html#eppstein97:dynamic_graph">[42]</a> (and not
fully dynamic). The disjoint-sets class is described in Section <A
HREF="../../disjoint_sets/disjoint_sets.html">Disjoint Sets</A>.
HREF="../disjoint_sets/disjoint_sets.html">Disjoint Sets</A>.
<P>
The following five operations are the primary functions that you will
+1 -1
View File
@@ -37,7 +37,7 @@ namespace boost {
template &lt;class Graph, class VertexDescriptor, class InEdgeIter&gt;
class inv_adjacency_iterator_generator {
public:
typedef <a href="../../utility/iterator_adaptors.htm#iterator_adaptor">iterator_adaptor</a>&lt;...&gt; type;
typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a>&lt;...&gt; type;
};
}
</pre>
+1 -1
View File
@@ -95,7 +95,7 @@ IN: <tt>const Graph&amp; g</tt>
IN: <tt>OutputIterator spanning_tree_edges</tt>
<blockquote>
The edges of the minimum spanning tree are output to this <a
href="http:www.sgi.com/tech/stl/OutputIterator.html">Output
href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
Iterator</a>.<br>
<b>Python</b>: This parameter is not used in Python. Instead, a
+1 -1
View File
@@ -1,6 +1,6 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Struct template layout_tolerance</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="../../../people/people.htm">People</a></td><td align="center"><a href="../../../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="struct.boost.layout_tolerance"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Struct template layout_tolerance</span></h2><p>boost::layout_tolerance &#8212; Determines when to terminate layout of a particular graph based on a given relative tolerance. </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>&lt;<span class="bold"><b>typename</b></span> T = double&gt;
<span class="bold"><b>struct</b></span> layout_tolerance {
  <span class="emphasis"><em>// <a href="layout_tolerance.html#struct.boost.layout_toleranceconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <span class="emphasis"><em>// <a href="layout_tolerance.html#layout_toleranceconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="layout_tolerance.html#id103752-bb">layout_tolerance</a>(<span class="bold"><b>const</b></span> T &amp; = T(0.001));
  <span class="emphasis"><em>// <a href="layout_tolerance.html#id103692-bb">public member functions</a></em></span>
+1
View File
@@ -20,6 +20,7 @@
<BR Clear>
<H1><A NAME="sec:mmd">
<img src="figs/python.gif" alt="(Python)"/>
<TT>minimum_degree_ordering</TT>
</H1>
+2 -1
View File
@@ -57,7 +57,8 @@ public:
</PRE>
<p> This class template implements a generator for scale-free graphs
using the Power Law Out Degree (PLOD) algorithm, suitable for
using the Power Law Out Degree (PLOD) algorithm
[<a href="bibliography.html#palmer2000">63</a>], suitable for
initializing an <a
href="adjacency_list.html"><tt>adjacency_list</tt></a> or other graph
structure with iterator-based initialization. A scale-free graph
+2 -2
View File
@@ -26,8 +26,8 @@
<li><a href="http://www.ddj.com/articles/2000/0009/0009toc.htm">Dr. Dobb's Sept. 2000 Article</a></a></li>
<li><a href="http://www.acm.org/pubs/citations/proceedings/oops/320384/p399-siek/">OOPSLA'99 GGCL Paper</a></li>
<li>Lie-Quan Lee's Master's Thesis about GGCL<a href="http://www.lsc.nd.edu/downloads/research/ggcl/papers/thesis.ps">(ps)</a> <a href="http://www.lsc.nd.edu/downloads/research/ggcl/papers/thesis.pdf">(pdf)</a></li>
<li>Dietmar K&uuml;hl's Master's Thesis: <a href="ftp://ftp.informatik.uni-konstanz.de/pub/algo/personal/kuehl/da.ps.gz">Design Pattern for the Implementation of Graph Algorithms</a></li>
<li><a href="http://www.acl.lanl.gov/iscope99/">ISCOPE'99</a> Sparse Matrix Ordering <a href="./iscope99.pdf">(pdf)</a></li>
<li><a href="http://www.dietmar-kuehl.de/generic-graph-algorithms.pdf">Dietmar K&uuml;hl's Master's Thesis: Design Pattern for the Implementation of Graph Algorithms</a></li>
<li>ISCOPE'99 Sparse Matrix Ordering <a href="./iscope99.pdf">(pdf)</a></li>
<li><a href="http://www.oonumerics.org/tmpw00/">C++ Template Workshop 2000</a>, Concept Checking</li>
</ul>
+3 -3
View File
@@ -68,10 +68,10 @@ For version 1:
See <A
href="http://www.boost.org/libs/graph/example/cuthill_mckee_ordering.cpp"><TT>example/sloan_ordering.cpp</TT></A>.
<H3>See Also</H3>
<p><http://www.boost.org/libs/graph/doc/sloan_start_end_vertices.html><a href="http://www.boost.org/libs/graph/doc/sloan_start_end_vertices.html">sloan_start_end_vertices</a></http:>,
<p><a href="http://www.boost.org/libs/graph/doc/sloan_start_end_vertices.htm">sloan_start_end_vertices</a>,
<A
href="http://www.boost.org/libs/graph/doc/bandwidth.html">bandwidth</A>, <a href="http://www.boost.org/libs/graph/doc/profile.html">profile</a>,
<a href="http://www.boost.org/libs/graph/doc/wavefront.html">wavefront</a> and
href="http://www.boost.org/libs/graph/doc/bandwidth.html">bandwidth</A>, <a href="http://www.boost.org/libs/graph/doc/profile.htm">profile</a>,
<a href="http://www.boost.org/libs/graph/doc/wavefront.htm">wavefront</a> and
<TT>degree_property_map</TT> in <TT>boost/graph/properties.hpp</TT>. </p>
<p>[1] S. W. Sloan, <i>An algorithm for profile and wavefront reduction of sparse
matrices</i>, Int. j. numer. methods eng., <b>23</b>, 239 - 251 (1986)</p>
+29 -29
View File
@@ -70,10 +70,10 @@
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="python.html">Python bindings</a></li>
<li><a href="./visitor_concepts.html">Visitor Concepts</a>
<OL>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="./BFSVisitor.html">BFS Visitor</a>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="./DFSVisitor.html">DFS Visitor</a>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="./DFSVisitor.html"><a href="./DijkstraVisitor.html">Dijkstra Visitor</a>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="./BellmanFordVisitor.html">Bellman Ford Visitor</a>
<LI><a href="./BFSVisitor.html">BFS Visitor</a>
<LI><a href="./DFSVisitor.html">DFS Visitor</a>
<LI><a href="./DFSVisitor.html"><a href="./DijkstraVisitor.html">Dijkstra Visitor</a>
<LI><a href="./BellmanFordVisitor.html">Bellman Ford Visitor</a>
<LI><a href="AStarVisitor.html">A* Visitor</a></LI>
<LI><a href="./EventVisitor.html">Event Visitor</a>
</OL>
@@ -127,39 +127,39 @@
<LI><a href="./bgl_named_params.html"><tt>bgl_named_params</tt></a>
<LI>Core Algorithm Patterns
<OL>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./breadth_first_search.html"><tt>breadth_first_search</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./breadth_first_search.html"><A href="./breadth_first_visit.html"><tt>breadth_first_visit</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A href="./breadth_first_search.html"><tt>breadth_first_search</tt></A>
<LI><A href="./breadth_first_search.html"><A href="./breadth_first_visit.html"><tt>breadth_first_visit</tt></A>
<LI><A
href="./depth_first_search.html"><tt>depth_first_search</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./depth_first_visit.html"><tt>depth_first_visit</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A href="./depth_first_visit.html"><tt>depth_first_visit</tt></A>
<LI><A
href="./undirected_dfs.html"><tt>undirected_dfs</tt></A>
</OL>
<LI>Graph Algorithms
<OL>
<LI>Shortest Paths Algorithms
<OL>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./dag_shortest_paths.html"><tt>dag_shortest_paths</tt></A>
<LI><A href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths</tt></A>
<LI><A href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths</tt></A>
<LI><A href="./dag_shortest_paths.html"><tt>dag_shortest_paths</tt></A>
<LI><A
href="./johnson_all_pairs_shortest.html"><tt>johnson_all_pairs_shortest_paths</tt></A>
<li><a href="floyd_warshall_shortest.html"><tt>floyd_warshall_all_pairs_shortest_paths</tt></a></li>
</OL>
<LI>Minimum Spanning Tree Algorithms
<OL>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A
href="./kruskal_min_spanning_tree.html"><tt>kruskal_minimum_spanning_tree</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A
href="./prim_minimum_spanning_tree.html"><tt>prim_minimum_spanning_tree</tt></A>
</OL>
<LI>Connected Components Algorithms
<OL>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./connected_components.html"><tt>connected_components</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./strong_components.html"><tt>strong_components</tt></A>
<LI><A href="./connected_components.html"><tt>connected_components</tt></A>
<LI><A href="./strong_components.html"><tt>strong_components</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="biconnected_components.html"><tt>biconnected_components</tt></a>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><a href="biconnected_components.html#sec:articulation_points"><tt>articulation_points</tt></a>
<LI><a href="biconnected_components.html"><tt>biconnected_components</tt></a>
<LI><a href="biconnected_components.html#sec:articulation_points"><tt>articulation_points</tt></a>
<LI><a href="./incremental_components.html">Incremental Connected Components</a>
<OL>
<LI><A href="./incremental_components.html#sec:initialize-incremental-components"><tt>initialize_incremental_components</tt></A>
@@ -178,35 +178,35 @@
<li>Sparse Matrix Ordering Algorithms
<ol>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A
href="./cuthill_mckee_ordering.html"><tt>cuthill_mckee_ordering</tt></a>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="king_ordering.html"><tt>king_ordering</tt></a></li>
<li><a href="king_ordering.html"><tt>king_ordering</tt></a></li>
<LI><a href="./minimum_degree_ordering.html"><tt>minimum_degree_ordering</tt></a>
</ol>
</li>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./topological_sort.html"><tt>topological_sort</tt></A>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="./transitive_closure.html"><tt>transitive_closure</tt></a>
<LI><A href="./topological_sort.html"><tt>topological_sort</tt></A>
<li><a href="./transitive_closure.html"><tt>transitive_closure</tt></a>
<LI><A href="./copy_graph.html"><tt>copy_graph</tt></A>
<LI><A href="./transpose_graph.html"><tt>transpose_graph</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="./isomorphism.html"><tt>isomorphism</tt></A>
<LI><A href="./isomorphism.html"><tt>isomorphism</tt></A>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A
<LI><A
href="sequential_vertex_coloring.html"><tt>sequential_vertex_coloring</tt></A>
<li><a href="./sloan_ordering.htm"><tt>sloan_ordering</tt></a></li>
<LI><A href="./wavefront.htm"><tt>ith_wavefront</tt>, <tt>max_wavefront</tt>, <tt>aver_wavefront</tt>, and <tt>rms_wavefront</tt></A></LI>
<LI><img src="figs/python_ico.gif" alt="(Python)"/><A href="betweenness_centrality.html"><tt>brandes_betweenness_centrality</tt></A></LI>
<LI><A href="betweenness_centrality.html"><tt>brandes_betweenness_centrality</tt></A></LI>
<li>Layout algorithms
<ol>
<li><a href="random_layout.html"><tt>random_graph_layout</tt></a></li>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="circle_layout.html"><tt>circle_layout</tt></a></li>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="kamada_kawai_spring_layout.html"><tt>kamada_kawai_spring_layout</tt></a></li>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="fruchterman_reingold.html"><tt>fruchterman_reingold_force_directed_layout</tt></a></li>
<li><a href="circle_layout.html"><tt>circle_layout</tt></a></li>
<li><a href="kamada_kawai_spring_layout.html"><tt>kamada_kawai_spring_layout</tt></a></li>
<li><a href="fruchterman_reingold.html"><tt>fruchterman_reingold_force_directed_layout</tt></a></li>
<li><a href="gursoy_atun_layout.html"><tt>gursoy_atun_layout</tt></a></li>
</ol>
</li>
<li>Clustering algorithms
<ol>
<li><img src="figs/python_ico.gif" alt="(Python)"/><a href="bc_clustering.html"><tt>betweenness_centrality_clustering</tt></a></li>
<li><a href="bc_clustering.html"><tt>betweenness_centrality_clustering</tt></a></li>
</ol>
</li>
<li><a href="astar_search.html"><tt>astar_search</tt></a></li>
+1 -1
View File
@@ -59,7 +59,7 @@ IN: <tt>VertexListGraph&amp; g</tt>
OUT: <tt>OutputIterator result</tt>
<blockquote>
The vertex descriptors of the graph will be output to the
<TT>result</TT> output iterator in their topological order. The
<TT>result</TT> output iterator in <b>reverse</b> topological order. The
iterator type must model <a
href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
Iterator</a>.<br>
+2 -2
View File
@@ -386,7 +386,7 @@ namespace boost {
template <class EdgeIterator>
inline adjacency_list(EdgeIterator first, EdgeIterator last,
vertices_size_type n,
edges_size_type m = 0,
edges_size_type = 0,
const GraphProperty& p = GraphProperty())
: Base(n, first, last), m_property(p) { }
@@ -394,7 +394,7 @@ namespace boost {
inline adjacency_list(EdgeIterator first, EdgeIterator last,
EdgePropertyIterator ep_iter,
vertices_size_type n,
edges_size_type m = 0,
edges_size_type = 0,
const GraphProperty& p = GraphProperty())
: Base(n, first, last, ep_iter), m_property(p) { }
#endif
@@ -164,7 +164,7 @@ namespace boost {
// Find one vertex from each connected component
BGL_FORALL_VERTICES_T(v, G, Graph) {
if (get(color, v) != Color::white()) {
if (get(color, v) == Color::white()) {
depth_first_visit(G, v, dfs_visitor<>(), color);
vertex_queue.push_back(v);
}
@@ -13,6 +13,7 @@
#include <map> // for vertex_map in copy_impl
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/operators.hpp>
#include <boost/property_map.hpp>
#include <boost/pending/integer_range.hpp>
@@ -2669,12 +2670,16 @@ namespace boost {
#if !defined(BOOST_NO_HASH) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
namespace BOOST_STD_EXTENSION_NAMESPACE {
#if BOOST_WORKAROUND( _STLPORT_VERSION, >= 0x500 )
// STLport 5 already defines a hash<void*> specialization.
#else
template <>
struct hash< void* > // Need this when vertex_descriptor=void*
{
std::size_t
operator()(void* v) const { return (std::size_t)v; }
};
#endif
template <typename V>
struct hash< boost::detail::stored_edge<V> >
+2 -2
View File
@@ -201,12 +201,12 @@ namespace boost {
template<typename Descriptor>
typename graph::detail::bundled_result<Graph, Descriptor>::type&
operator[](Descriptor x)
{ return this->m_g[local_to_global(x)]; }
{ return const_cast<Graph&>(this->m_g)[x]; }
template<typename Descriptor>
typename graph::detail::bundled_result<Graph, Descriptor>::type const&
operator[](Descriptor x) const
{ return this->m_g[local_to_global(x)]; }
{ return this->m_g[x]; }
#endif // BOOST_GRAPH_NO_BUNDLED_PROPERTIES
//private:
+15 -35
View File
@@ -131,41 +131,21 @@ struct grid_force_pairs
apply_force(*v, *u);
}
// Repulse vertices in the bucket to the right
if (column < columns - 1) {
bucket_t& r_bucket = buckets[row * columns + column + 1];
for (v = r_bucket.begin(); v != r_bucket.end(); ++v) {
apply_force(*u, *v);
apply_force(*v, *u);
}
}
// Repulse vertices in bucket below
if (row < rows - 1) {
bucket_t& b_bucket = buckets[(row + 1) * columns + column];
for (v = b_bucket.begin(); v != b_bucket.end(); ++v) {
apply_force(*u, *v);
apply_force(*v, *u);
}
}
// Repulse vertices in bucket below and to the right
if (column < columns - 1 && row < rows - 1) {
bucket_t& br_bucket = buckets[(row + 1) * columns + column + 1];
for (v = br_bucket.begin(); v != br_bucket.end(); ++v) {
apply_force(*u, *v);
apply_force(*v, *u);
}
}
// Repulse vertices in bucket above and to the right
if (column < columns - 1 && row > 0) {
bucket_t& ur_bucket = buckets[(row - 1) * columns + column + 1];
for (v = ur_bucket.begin(); v != ur_bucket.end(); ++v) {
apply_force(*u, *v);
apply_force(*v, *u);
}
}
std::size_t adj_start_row = row == 0? 0 : row - 1;
std::size_t adj_end_row = row == rows - 1? row : row + 1;
std::size_t adj_start_column = column == 0? 0 : column - 1;
std::size_t adj_end_column = column == columns - 1? column : column + 1;
for (std::size_t other_row = adj_start_row; other_row <= adj_end_row;
++other_row)
for (std::size_t other_column = adj_start_column;
other_column <= adj_end_column; ++other_column)
if (other_row != row || other_column != column) {
// Repulse vertices in this bucket
bucket_t& other_bucket
= buckets[other_row * columns + other_column];
for (v = other_bucket.begin(); v != other_bucket.end(); ++v)
apply_force(*u, *v);
}
}
}
}
+1 -1
View File
@@ -294,7 +294,7 @@ namespace boost {
// Find one vertex from each connected component
BGL_FORALL_VERTICES_T(v, G, Graph) {
if (get(color, v) != Color::white()) {
if (get(color, v) == Color::white()) {
depth_first_visit(G, v, dfs_visitor<>(), color);
vertex_queue.push_back(v);
}
+22 -8
View File
@@ -11,7 +11,6 @@
#include <functional>
#include <boost/property_map.hpp>
#include <cmath>
#include <boost/optional.hpp>
#include <vector>
@@ -87,23 +86,38 @@ private:
group** children;
};
size_type log2(size_type n)
{
size_type leading_zeroes = 0;
do {
size_type next = n << 1;
if (n == (next >> 1)) {
++leading_zeroes;
n = next;
} else {
break;
}
} while (true);
return sizeof(size_type) * CHAR_BIT - leading_zeroes - 1;
}
public:
relaxed_heap(size_type n, const Compare& compare = Compare(),
const ID& id = ID())
: compare(compare), id(id), root(smallest_key), groups(n),
smallest_value(0)
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::log;
#endif // BOOST_NO_STDC_NAMESPACE
if (n == 0) {
root.children = new group*[1];
return;
}
if (n == 0) return;
log_n = log2(n);
log_n = static_cast<size_type>(log((double)n) / log(2.0));
if (log_n == 0) log_n = 1;
size_type g = n / log_n;
if (n % log_n > 0) ++g;
size_type log_g = static_cast<size_type>(log((double)g) / log(2.0));
size_type log_g = log2(g);
size_type r = log_g;
// Reserve an appropriate amount of space for data structures, so
@@ -120,7 +134,7 @@ public:
root.children[r] = &index_to_group[idx];
idx = build_tree(root, idx, r, log_g + 1);
if (idx != g)
r = static_cast<size_type>(log((double)(g - idx)) / log(2.0));
r = static_cast<size_type>(log2(g-idx));
}
}
+3
View File
@@ -46,6 +46,9 @@
#include <sstream>
#endif
using std::free;
using std::malloc;
#ifndef GRAPHVIZ_DIRECTED
#error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
#endif
+3
View File
@@ -46,6 +46,9 @@
#include <sstream>
#endif
using std::free;
using std::malloc;
#ifndef GRAPHVIZ_DIRECTED
#error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
#endif
+3
View File
@@ -24,6 +24,9 @@
#include <sstream>
#endif
using std::free;
using std::malloc;
#ifndef GRAPHVIZ_DIRECTED
#error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
#endif
+109
View File
@@ -0,0 +1,109 @@
// Copyright 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
// Andrew Lumsdaine
#include "basic_graph.hpp"
#include <boost/python.hpp>
#include <fstream>
#include <string>
#include <sstream>
#include <boost/graph/iteration_macros.hpp>
namespace boost { namespace graph { namespace python {
template<typename DirectedS>
void
basic_graph<DirectedS>::read_adjlist(const std::string& filename,
const std::string& node_id)
{
vector_property_map<std::string, VertexIndexMap> id_map
= get_vertex_map<std::string>(node_id);
std::ifstream file_in(filename.c_str());
std::string line;
std::map<std::string, vertex_descriptor> name_to_vertex;
while (std::getline(file_in, line)) {
std::istringstream in(line);
std::string src, tgt;
if (in >> src >> tgt) {
typename std::map<std::string, vertex_descriptor>::iterator pos;
// Find or create the source vertex
vertex_descriptor src_vert;
pos = name_to_vertex.find(src);
if (pos == name_to_vertex.end()) {
src_vert = add_vertex();
name_to_vertex[src] = src_vert;
put(id_map, src_vert, src);
} else {
src_vert = pos->second;
}
// Find or create the target vertex
vertex_descriptor tgt_vert;
pos = name_to_vertex.find(tgt);
if (pos == name_to_vertex.end()) {
tgt_vert = add_vertex();
name_to_vertex[tgt] = tgt_vert;
put(id_map, tgt_vert, tgt);
} else {
tgt_vert = pos->second;
}
// Add the edge
add_edge(src_vert, tgt_vert);
}
}
}
template<typename DirectedS>
void
basic_graph<DirectedS>::write_adjlist(const std::string& filename,
const std::string& node_id)
{
std::ofstream out(filename.c_str());
VertexIndexMap index_map = get_vertex_index_map();
bool have_id_map = has_vertex_map(node_id);
vector_property_map<std::string, VertexIndexMap> id_map;
if (have_id_map)
id_map = get_vertex_map<std::string>(node_id);
edge_iterator ei, ei_end;
for (tie(ei, ei_end) = edges(); ei != ei_end; ++ei) {
edge_descriptor e = *ei;
if (have_id_map)
out << get(id_map, source(e)) << ' '
<< get(id_map, target(e)) << std::endl;
else
out << get(index_map, source(e)) << ' '
<< get(index_map, target(e)) << std::endl;
}
}
// Explicit instantiations
template
void
basic_graph<undirectedS>::read_adjlist(const std::string& filename,
const std::string& node_id);
template
void
basic_graph<undirectedS>::write_adjlist(const std::string& filename,
const std::string& node_id);
template
void
basic_graph<bidirectionalS>::read_adjlist(const std::string& filename,
const std::string& node_id);
template
void
basic_graph<bidirectionalS>::write_adjlist(const std::string& filename,
const std::string& node_id);
} } } // end namespace boost::graph::python
+4
View File
@@ -127,6 +127,7 @@ basic_graph<DirectedS>::basic_graph(const std::string& filename,
{
switch (kind) {
case gfk_adjlist:
read_adjlist(filename);
break;
case gfk_graphviz:
read_graphviz(filename);
@@ -615,6 +616,9 @@ void export_basic_graph(const char* name)
.def("get_edge_string_map", &Graph::get_edge_string_map)
.def("get_edge_object_map", &Graph::get_edge_object_map)
// Graph I/O
.def("read_adjlist", &Graph::read_adjlist)
.def("write_adjlist", &Graph::write_adjlist)
.def("write_adjlist", &Graph::write_adjlist_def)
.def("read_graphviz", &Graph::read_graphviz)
.def("write_graphviz", &Graph::write_graphviz)
.def("write_graphviz", &Graph::write_graphviz_def)
+9
View File
@@ -307,6 +307,15 @@ class basic_graph
bool has_edge_map(const std::string& name) const;
// Graph I/O
void read_adjlist(const std::string& filename,
const std::string& node_id = std::string("node_id"));
void write_adjlist(const std::string& filename,
const std::string& node_id = std::string("node_id"));
void write_adjlist_def(const std::string& filename)
{ write_adjlist(filename); }
void read_graphviz(const std::string& filename,
const std::string& node_id = std::string("node_id"));
+97
View File
@@ -0,0 +1,97 @@
// Copyright 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: Ben Martin
// Douglas Gregor
// Andrew Lumsdaine
#include <boost/graph/minimum_degree_ordering.hpp>
//#include "graph.hpp"
#include "digraph.hpp"
#include <boost/python.hpp>
#include <vector.h>
#include <iostream.h>
namespace boost { namespace graph { namespace python {
template<typename GraphT>
boost::python::list
minimum_degree_ordering
(GraphT& g,
const vector_property_map<int, typename GraphT::VertexIndexMap>* outdegree,
const vector_property_map<int, typename GraphT::VertexIndexMap>* supernode_size,
const int delta,
const typename GraphT::VertexIndexMap *id)
{
typedef std::vector<int> InversePermutationMap;
typedef std::vector<int> PermutationMap;
typedef vector_property_map<int, typename GraphT::VertexIndexMap> OutDegreeMap;
typedef vector_property_map<int, typename GraphT::VertexIndexMap> SuperNodeSizeMap;
typedef typename GraphT::VertexIndexMap VertexIndexMap;
int n = num_vertices(g);
OutDegreeMap out_degree_map = outdegree ? *outdegree : g. template get_vertex_map<int>("outdegree");
InversePermutationMap inv_perm_map(n, 0);
PermutationMap perm_map(n, 0);
SuperNodeSizeMap sns_map =
supernode_size ? *supernode_size : g. template get_vertex_map<int>("supernode_size");
VertexIndexMap vertex_index_map = id ? *id : g.get_vertex_index_map();
typedef typename GraphT::vertex_iterator VertexIterator;
VertexIterator v, vs, ve;
using std::pair;
std::pair<VertexIterator, VertexIterator> p;
p = vertices(g);
vs = p.first;
ve = p.second;
for (v = vs; v != ve; ++v)
sns_map[*v] = 1;
boost::minimum_degree_ordering<GraphT, OutDegreeMap,
InversePermutationMap, PermutationMap,
SuperNodeSizeMap, VertexIndexMap>
(g,
out_degree_map,
inv_perm_map,
perm_map,
sns_map,
delta,
vertex_index_map);
// Build the new ordering
typedef typename graph_traits<GraphT>::vertex_descriptor vertex_descriptor;
std::vector<vertex_descriptor> new_ordering(num_vertices(g));
vs = p.first;
ve = p.second;
for (v = vs; v != ve; ++v)
new_ordering[perm_map[get(vertex_index_map, *v)]] = *v;
// Build resulting list for Python
typedef typename graph_traits<GraphT>::vertices_size_type vertices_size_type;
boost::python::list result;
typedef typename std::vector<vertex_descriptor>::iterator iterator;
for (iterator i = new_ordering.begin(); i != new_ordering.end(); ++i)
result.append(*i);
return result;
}
void export_minimum_degree_ordering()
{
using boost::python::arg;
using boost::python::def;
def("minimum_degree_ordering",
&minimum_degree_ordering<Digraph>,
(arg("graph"),
arg("out_degree") = (vector_property_map<int, Digraph::VertexIndexMap>*)0,
arg("supernode_size") =
(vector_property_map<int, Digraph::VertexIndexMap>*)0,
arg("delta") = 0,
arg("id") = (Digraph::VertexIndexMap*)0));
}
} } } // end namespace boost::graph::python
+2 -2
View File
@@ -37,7 +37,7 @@ extern void export_incremental_components();
extern void export_topological_sort();
extern void export_cuthill_mckee_ordering();
extern void export_king_ordering();
//extern void export_minimum_degree_ordering();
extern void export_minimum_degree_ordering();
extern void export_sequential_vertex_coloring();
extern void export_betweenness_centrality();
extern void export_page_rank();
@@ -121,7 +121,7 @@ BOOST_PYTHON_MODULE(bgl)
// Sparse Matrix Ordering
export_cuthill_mckee_ordering();
export_king_ordering();
// export_minimum_degree_ordering();
export_minimum_degree_ordering();
// Other algorithms
export_topological_sort();