Where Defined
boost/graph/circle_layout.hppDescription
The distance from the center of the polygon to each point is determined by the radius parameter. The position parameter must be an Lvalue Property Map whose value type is a class type containing x and y members that will be set to the x and y coordinates.
diff --git a/doc/compressed_sparse_row.html b/doc/compressed_sparse_row.html
index 056fcace..9323a4db 100644
--- a/doc/compressed_sparse_row.html
+++ b/doc/compressed_sparse_row.html
@@ -1,5 +1,12 @@
+
Compressed Sparse Row Graph
diff --git a/doc/connected_components.html b/doc/connected_components.html
index acd27a71..c1811365 100644
--- a/doc/connected_components.html
+++ b/doc/connected_components.html
@@ -2,13 +2,9 @@
Boost Graph Library: Connected Components
diff --git a/doc/constructing_algorithms.html b/doc/constructing_algorithms.html
index a0e11156..c04c8bda 100644
--- a/doc/constructing_algorithms.html
+++ b/doc/constructing_algorithms.html
@@ -2,13 +2,9 @@
Boost Graph Library: Constructing Graph Algorithms
diff --git a/doc/copy_graph.html b/doc/copy_graph.html
index 5f3d03e2..368fc7e0 100644
--- a/doc/copy_graph.html
+++ b/doc/copy_graph.html
@@ -2,13 +2,9 @@
Boost Graph Library: Copy Graph
diff --git a/doc/cuthill_mckee_ordering.html b/doc/cuthill_mckee_ordering.html
index 9c63e62f..1af288db 100644
--- a/doc/cuthill_mckee_ordering.html
+++ b/doc/cuthill_mckee_ordering.html
@@ -2,13 +2,9 @@
-
-
-
-
-
-
-
+ -- 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)
Boost Graph Library: Cuthill-Mckee Ordering
diff --git a/doc/dag_shortest_paths.html b/doc/dag_shortest_paths.html
index 9c196963..ad6c675e 100644
--- a/doc/dag_shortest_paths.html
+++ b/doc/dag_shortest_paths.html
@@ -2,13 +2,9 @@
Boost Graph Library: Directed Acyclic Graph Shortest Paths
diff --git a/doc/default.css b/doc/default.css
index 0e4226a0..2dcd838f 100644
--- a/doc/default.css
+++ b/doc/default.css
@@ -6,6 +6,13 @@
:copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
+
+-- Copyright (c) 2005 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)
+
*/
.first {
diff --git a/doc/depth_first_search.html b/doc/depth_first_search.html
index 8f2fc21a..6bc6f110 100644
--- a/doc/depth_first_search.html
+++ b/doc/depth_first_search.html
@@ -2,13 +2,9 @@
Boost Graph Library: Depth-First Search
diff --git a/doc/depth_first_visit.html b/doc/depth_first_visit.html
index c14fba42..329d2cf2 100644
--- a/doc/depth_first_visit.html
+++ b/doc/depth_first_visit.html
@@ -2,13 +2,9 @@
Boost Graph Library: Depth-First Visit
diff --git a/doc/dfs_visitor.html b/doc/dfs_visitor.html
index 40c94200..6b79d823 100644
--- a/doc/dfs_visitor.html
+++ b/doc/dfs_visitor.html
@@ -2,13 +2,9 @@
Boost Graph Library: dfs_visitor
diff --git a/doc/dijkstra_shortest_paths.html b/doc/dijkstra_shortest_paths.html
index 90c28924..a7bdd166 100644
--- a/doc/dijkstra_shortest_paths.html
+++ b/doc/dijkstra_shortest_paths.html
@@ -2,13 +2,9 @@
Boost Graph Library: Dijkstra's Shortest Paths
diff --git a/doc/dijkstra_visitor.html b/doc/dijkstra_visitor.html
index 9e0c6b5e..995030f8 100644
--- a/doc/dijkstra_visitor.html
+++ b/doc/dijkstra_visitor.html
@@ -2,13 +2,9 @@
Boost Graph Library: dijkstra_visitor
diff --git a/doc/distance_recorder.html b/doc/distance_recorder.html
index 67e4196d..eb1d137a 100644
--- a/doc/distance_recorder.html
+++ b/doc/distance_recorder.html
@@ -2,13 +2,9 @@
Boost Graph Library: distance_recorder
diff --git a/doc/edge_list.html b/doc/edge_list.html
index 0d2384a3..4a556cef 100644
--- a/doc/edge_list.html
+++ b/doc/edge_list.html
@@ -2,13 +2,9 @@
Boost Graph Library: Edge List Class
diff --git a/doc/edmunds_karp_max_flow.html b/doc/edmunds_karp_max_flow.html
index 0468dd72..0bf59675 100644
--- a/doc/edmunds_karp_max_flow.html
+++ b/doc/edmunds_karp_max_flow.html
@@ -2,13 +2,9 @@
Boost Graph Library: Edmunds-Karp Maximum Flow
diff --git a/doc/exception.html b/doc/exception.html
index de010fe0..f5cbdf28 100644
--- a/doc/exception.html
+++ b/doc/exception.html
@@ -2,13 +2,9 @@
Boost Graph Library: Exceptions
diff --git a/doc/faq.html b/doc/faq.html
index 6f9b7652..eeef22e4 100644
--- a/doc/faq.html
+++ b/doc/faq.html
@@ -2,13 +2,9 @@
Boost Graph Library: FAQ
diff --git a/doc/figs/Makefile b/doc/figs/Makefile
index 444eb094..7c63524e 100644
--- a/doc/figs/Makefile
+++ b/doc/figs/Makefile
@@ -1,4 +1,9 @@
# -*- makefile -*-
+# Copyright (c) 2002 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)
.SUFFIXES: .fig .gif .tif .jpeg
diff --git a/doc/file_dependency_example.html b/doc/file_dependency_example.html
index 995385db..7aa0e68a 100644
--- a/doc/file_dependency_example.html
+++ b/doc/file_dependency_example.html
@@ -2,13 +2,9 @@
File Dependency Example
@@ -105,7 +101,7 @@ list of files and to set-up the dependencies. We use the
adjacency_list class to represent the graph. The
vecS selector means that a
std::vector will be used
to represent each edge-list, which provides efficient traversal. The
-
directedS selector means we want a directed graph, and the
+
bidirectionalS selector means we want a directed graph with access to both the edges outgoing from each vertex and the edges incoming to each vertex, and the
color_property attaches a color property to each vertex of the
graph. The color property will be used in several of the algorithms in
the following sections.
@@ -140,9 +136,8 @@ the following sections.
};
using namespace boost;
- typedef adjacency_list<vecS, vecS, directedS,
- property<vertex_color_t, default_color_type>,
- property<edge_weight_t, int>
+ typedef adjacency_list<vecS, vecS, bidirectionalS,
+ property<vertex_color_t, default_color_type>
> Graph;
Graph g(used_by, used_by + sizeof(used_by) / sizeof(Edge), N);
typedef graph_traits<Graph>::vertex_descriptor Vertex;
@@ -208,86 +203,42 @@ earliest time that a file can be built assuming that an unlimited
number of files can be built at the same time? The main criteria for
when a file can be built is that all of the files it depends on must
already be built. To simplify things for this example, we'll assume
-that each file takes 1 time unit to build (even header files). The
+that each file takes 1 time unit to build (even header files). For
+parallel compilation, we can build all of the files corresponding to
+vertices with no dependencies, e.g., those that have
+an
in-degree of 0, in the first step. For all other files, the
main observation for determining the ``time slot'' for a file is that
the time slot must be one more than the maximum time-slot of the files
it depends on.
-
-This idea of calculating a value based on the previously computed
-values of neighboring vertices is the same idea behind Dijkstra's
-single-source shortest paths algorithm (see dijkstra_shortest_paths()). The
-main difference between this situation and a shortest-path algorithm
-is that we want to use the maximum of the neighbors' values instead of
-the minimum. In addition, we do not have a single source
-vertex. Instead we will want to treat all vertices with in-degree of
-zero as sources (i.e., vertices with no edges coming into them). So we
-use Dijkstra's algorithm with several extra parameters instead
-of relying on the defaults.
-
-
-To use dijkstra_shortest_paths(), we must first set up the vertex
-and edge properties that will be used in the algorithm. We will need
-a time property (replacing the distance property of Dijkstra's
-algorithm) and an edge weight property. We will use a
-std::vector to store the time. The weight property has already
-been attached to the graph via a plug-in so here we just declare an
-map for the internal weight property.
+
We start be creating a vector time
that will store the
+ time step at which each file can be built. We initialize every value
+ with time step zero.
std::vector<int> time(N, 0);
- typedef std::vector<int>::iterator Time;
- using boost::edge_weight_t;
- typedef boost::property_map<Graph, edge_weight_t>::type Weight;
- Weight weight = get(edge_weight, g);
-
-The next step is to identify the vertices with zero in-degree which
-will be our ``source'' vertices from which to start the shortest path
-searches. The in-degrees can be calculated with the following loop.
+
Now, we want to visit the vertices against in topological order,
+ from those files that need to be built first until those that need
+ to be built last. However, instead of printing out the order
+ immediately, we will compute the time step in which each file should
+ be built based on the time steps of the files it depends on. We
+ only need to consider those files whose in-degree is greater than
+ zero.
-
-
- std::vector<int> in_degree(N, 0);
- Graph::vertex_iterator i, iend;
- Graph::out_edge_iterator j, jend;
- for (boost::tie(i, iend) = vertices(g); i != iend; ++i)
- for (boost::tie(j, jend) = out_edges(*i, g); j != jend; ++j)
- in_degree[target(*j, g)] += 1;
-
-
-
-Next we need to define comparison of the "cost". In this
-case we want each file to have a time stamp greater than any of its
-predecessors. Therefore we define comparison with the
-std::greater<int> function object. We also need to
-tell the algorithm that we want to use addition to combine time
-values, so we use std::plus<int>.
-
-
-
- std::greater<int> compare;
- std::plus<int> combine;
-
-
-
-We are now ready to call uniform_cost_search(). We just
-loop through all the vertices in the graph, and invoke the algorithm
-if the vertex has zero in-degree.
-
-
-
- for (boost::tie(i, iend) = vertices(g); i != iend; ++i)
- if (in_degree[*i] == 0)
- boost::dijkstra_shortest_paths(g, *i,
- distance_map(&time[0]).
- weight_map(weight).
- distance_compare(compare).
- distance_combine(combine));
-
+
+ for (i = make_order.begin(); i != make_order.end(); ++i) {
+ if (in_degree (*i, g) > 0) {
+ Graph::in_edge_iterator j, j_end;
+ int maxdist = 0;
+ for (tie(j, j_end) = in_edges(*i, g); j != j_end; ++j)
+ maxdist = std::max(time[source(*j, g)], maxdist);
+ time[*i]=maxdist+1;
+ }
+ }
+
Last, we output the time-slot that we've calculated for each vertex.
diff --git a/doc/filtered_graph.html b/doc/filtered_graph.html
index 84d5bfc9..74bfcb7a 100644
--- a/doc/filtered_graph.html
+++ b/doc/filtered_graph.html
@@ -2,13 +2,9 @@
Boost Graph Library: Filtered Graph
diff --git a/doc/floyd_warshall_shortest.html b/doc/floyd_warshall_shortest.html
index 1e96d505..8952cf26 100644
--- a/doc/floyd_warshall_shortest.html
+++ b/doc/floyd_warshall_shortest.html
@@ -1,4 +1,11 @@
+
Floyd-Warshall All Pairs Shortest Paths
+
+
Boost Graph Library: Fruchterman-Reingold Force-Directed Layout
Graph Coloring Example
diff --git a/doc/graph_concepts.html b/doc/graph_concepts.html
index ff33cef2..cb82769b 100644
--- a/doc/graph_concepts.html
+++ b/doc/graph_concepts.html
@@ -2,13 +2,9 @@
Boost Graph Concepts
diff --git a/doc/graph_theory_review.html b/doc/graph_theory_review.html
index 65823bbb..a541936d 100644
--- a/doc/graph_theory_review.html
+++ b/doc/graph_theory_review.html
@@ -2,13 +2,9 @@
Boost Graph Library: Graph Theory Review
diff --git a/doc/graph_traits.html b/doc/graph_traits.html
index 413ccd15..8831c34b 100644
--- a/doc/graph_traits.html
+++ b/doc/graph_traits.html
@@ -2,13 +2,9 @@
Boost Graph Library: Graph Traits
diff --git a/doc/gursoy_atun_layout.html b/doc/gursoy_atun_layout.html
index d0812e78..16bf2be8 100644
--- a/doc/gursoy_atun_layout.html
+++ b/doc/gursoy_atun_layout.html
@@ -1,4 +1,11 @@
+
Boost Graph Library: Gürsoy-Atun Layout