From fcf5d92ca6f90a3ab8fb63dd4700466d1b921cee Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 13:38:53 +0000 Subject: [PATCH 001/108] Disable debug symbols for intel [SVN r33591] --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index cd0724fc..5ef8179f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -57,7 +57,7 @@ test-suite graph_test : [ run gursoy_atun_layout_test.cpp ] - [ run layout_test.cpp : : : always_show_run_output ] + [ run layout_test.cpp : : : always_show_run_output intel:off ] [ compile reverse_graph_cc.cpp ] From 96a3f1fa67a032f4916b67b4f90e7ff45f594530 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 10 Apr 2006 19:27:23 +0000 Subject: [PATCH 002/108] Move enum out of GraphParse::operator() [SVN r33642] --- include/boost/graph/adjacency_list_io.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/graph/adjacency_list_io.hpp b/include/boost/graph/adjacency_list_io.hpp index 74f47409..fb762fe0 100644 --- a/include/boost/graph/adjacency_list_io.hpp +++ b/include/boost/graph/adjacency_list_io.hpp @@ -115,6 +115,7 @@ void getSubset(T&, const no_property&) // get property subset //=========================================================================== // graph parser +typedef enum{ PARSE_NUM_NODES, PARSE_VERTEX, PARSE_EDGE } GraphParserState; template @@ -131,8 +132,7 @@ struct GraphParser typedef typename graph_traits::vertex_descriptor Vertex; std::vector nodes; - typedef enum{ PARSE_NUM_NODES, PARSE_VERTEX, PARSE_EDGE } State; - State state = PARSE_VERTEX; + GraphParserState state = PARSE_VERTEX; unsigned int numLine = 1; char c; From f44af6dd2ffbafc9e320efb30dc52015e31b599f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 10 Apr 2006 20:09:33 +0000 Subject: [PATCH 003/108] Don't generate self edges when asked not to, from Johan Oudinet [SVN r33644] --- include/boost/graph/plod_generator.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/graph/plod_generator.hpp b/include/boost/graph/plod_generator.hpp index 4e19a6bb..d1ac2ada 100644 --- a/include/boost/graph/plod_generator.hpp +++ b/include/boost/graph/plod_generator.hpp @@ -89,7 +89,9 @@ namespace boost { source = x(*gen); } while ((*out_degrees)[source].second == 0); current.first = (*out_degrees)[source].first; - current.second = x(*gen); + do { + current.second = x(*gen); + } while (current.first == current.second && !allow_self_loops); --degrees_left; if (--(*out_degrees)[source].second == 0) { (*out_degrees)[source] = out_degrees->back(); From 69c5cf732c87b84bf50495d8f2bcd60582c74385 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sat, 22 Apr 2006 13:19:48 +0000 Subject: [PATCH 004/108] added comparison operators (<,etc.) to the edge class [SVN r33765] --- include/boost/graph/detail/edge.hpp | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/include/boost/graph/detail/edge.hpp b/include/boost/graph/detail/edge.hpp index 8ab375f0..da085973 100644 --- a/include/boost/graph/detail/edge.hpp +++ b/include/boost/graph/detail/edge.hpp @@ -49,7 +49,7 @@ namespace boost { // protected: property_type* m_eproperty; }; - + template inline bool operator==(const detail::edge_desc_impl& a, @@ -65,6 +65,36 @@ namespace boost { return ! (a.get_property() == b.get_property()); } + // Order edges according to the address of their property object + template + inline bool + operator<(const detail::edge_desc_impl& a, + const detail::edge_desc_impl& b) + { + return a.get_property() < b.get_property(); + } + template + inline bool + operator<=(const detail::edge_desc_impl& a, + const detail::edge_desc_impl& b) + { + return a.get_property() <= b.get_property(); + } + template + inline bool + operator>(const detail::edge_desc_impl& a, + const detail::edge_desc_impl& b) + { + return a.get_property() > b.get_property(); + } + template + inline bool + operator>=(const detail::edge_desc_impl& a, + const detail::edge_desc_impl& b) + { + return a.get_property() >= b.get_property(); + } + } //namespace detail } // namespace boost From 62c6d9ef2f05a5ba10f51c2ce2d35bf030dff837 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sat, 22 Apr 2006 13:35:32 +0000 Subject: [PATCH 005/108] added edges_size_type and vertices_size_type to the adjacency_list_traits [SVN r33766] --- include/boost/graph/adjacency_list.hpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/boost/graph/adjacency_list.hpp b/include/boost/graph/adjacency_list.hpp index 197ef54f..9719ead1 100644 --- a/include/boost/graph/adjacency_list.hpp +++ b/include/boost/graph/adjacency_list.hpp @@ -259,7 +259,8 @@ namespace boost { template + class DirectedS = directedS, + class EdgeListS = listS> struct adjacency_list_traits { typedef typename detail::is_random_access::type @@ -282,6 +283,22 @@ namespace boost { std::size_t, vertex_ptr>::type vertex_descriptor; typedef detail::edge_desc_impl edge_descriptor; + + typedef std::size_t vertices_size_type; + + private: + // Logic to figure out the edges_size_type + struct dummy {}; + typedef typename container_gen::type EdgeContainer; + typedef typename DirectedS::is_bidir_t BidirectionalT; + typedef typename DirectedS::is_directed_t DirectedT; + typedef typename ct_and::type >::type on_edge_storage; + public: + typedef typename boost::ct_if_t::type edges_size_type; + }; } // namespace boost From ac1e867af47a422605d15261ae7475e1a3ac7811 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sat, 22 Apr 2006 13:41:55 +0000 Subject: [PATCH 006/108] added edges_size_type to adjacency_list_traits [SVN r33767] --- doc/adjacency_list.html | 16 ++++++++++------ doc/history.html | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/adjacency_list.html b/doc/adjacency_list.html index 3f44593e..2f614de3 100644 --- a/doc/adjacency_list.html +++ b/doc/adjacency_list.html @@ -358,7 +358,7 @@ align=center>OKOK
and
-adjacency_list_traits<OutEdgeList, VertexList, Directed>::vertex_descriptor +adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::vertex_descriptor

The type for the vertex descriptors associated with the adjacency_list. @@ -367,7 +367,7 @@ The type for the vertex descriptors associated with the graph_traits<adjacency_list>::edge_descriptor
and
-adjacency_list_traits<OutEdgeList, VertexList, Directed>::edge_descriptor +adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_descriptor

The type for the edge descriptors associated with the adjacency_list. @@ -428,7 +428,7 @@ as out_edge_iterator. graph_traits<adjacency_list>::directed_category
and
-adjacency_list_traits<OutEdgeList, VertexList, Directed>::directed_category +adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::directed_category

Provides information about whether the graph is directed (directed_tag) or undirected @@ -438,7 +438,7 @@ directed (directed_tag) or undirected graph_traits<adjacency_list>::edge_parallel_category
and
-adjacency_list_traits<OutEdgeList, VertexList, Directed>::edge_parallel_category +adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_parallel_category

This describes whether the graph class allows the insertion of parallel edges (edges with the same source and target). The two tags @@ -449,13 +449,17 @@ parallel edges while the others allow parallel edges.
-graph_traits<adjacency_list>::vertices_size_type +graph_traits<adjacency_list>::vertices_size_type
+and
+adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::vertices_size_type


The type used for dealing with the number of vertices in the graph.
-graph_traits<adjacency_list>::edge_size_type +graph_traits<adjacency_list>::edge_size_type
+and
+adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::edge_size_type


The type used for dealing with the number of edges in the graph. diff --git a/doc/history.html b/doc/history.html index b88fc262..8bb86d22 100644 --- a/doc/history.html +++ b/doc/history.html @@ -91,6 +91,9 @@ September 27, 2000.
  • biconnected_components now has a visitor parameter and supports named parameters, from Janusz Piwowarski.
  • adjacency_matrix now models the Bidirectional Graph concept.
  • adjacency_list is now Serializable, from Jeremy Siek of Rice University.
  • +
  • Added edges_size_type and vertices_size_type to adjacency_list_traits, from Jeremy Siek of Rice University.
  • +
  • Added operator< , etc. to the edge descriptor of adjacency_list, + from Jeremy Siek of Rice University.

  • Bug Fixes
    -
    -

    Contents

    + -
    -

    Where Defined

    +
    +

    Where Defined

    <boost/graph/graphviz.hpp>

    -
    -

    Exceptions

    +
    +

    Exceptions

     struct graph_exception : public std::exception {
       virtual ~graph_exception() throw();
    @@ -403,21 +122,65 @@ type is passed to read_graphgraph keyword in the DOT
     language.

    -
    -

    Building the GraphViz Readers

    +
    +

    Example

    +

    The following example illustrates a relatively simple use of the +GraphViz reader to populate an adjacency_list graph

    +
    +// Vertex properties
    +typedef property < vertex_name_t, std::string,
    +          property < vertex_color_t, float > > vertex_p;  
    +// Edge properties
    +typedef property < edge_weight_t, double > edge_p;
    +// Graph properties
    +typedef property < graph_name_t, std::string > graph_p;
    +// adjacency_list-based type
    +typedef adjacency_list < vecS, vecS, directedS,
    +  vertex_p, edge_p, graph_p > graph_t;
    +
    +// Construct an empty graph and prepare the dynamic_property_maps.
    +graph_t graph(0);
    +dynamic_properties dp;
    +
    +property_map<graph_t, vertex_name_t>::type name =
    +  get(vertex_name, graph);
    +dp.property("node_id",name);
    +
    +property_map<graph_t, vertex_color_t>::type mass =
    +  get(vertex_color, graph);
    +dp.property("mass",mass);
    +
    +property_map<graph_t, edge_weight_t>::type weight =
    +  get(edge_weight, graph);
    +dp.property("weight",weight);
    +
    +// Use ref_property_map to turn a graph property into a property map
    +boost::ref_property_map<graph_t*,std::string> 
    +  gname(get_property(graph,graph_name));
    +dp.property("name",gname);
    +
    +// Sample graph as an std::istream;
    +std::istringstream
    +  gvgraph("digraph { graph [name=\"graphname\"]  a  c e [mass = 6.66] }");
    +
    +bool status = read_graphviz(gvgraph,graph,dp,"node_id");
    +
    +
    +
    +

    Building the GraphViz Readers

    To use the GraphViz readers, you will need to build and link against the "bgl-viz" library. The library can be built by following the Boost Jam Build Instructions for the subdirectory libs/graph/build.

    -
    -

    Deprecated Readers

    +
    +

    Deprecated Readers

    The deprecated readers do not provide exceptions on error (they abort), they require the use of one of the predefined graph types (GraphvizDigraph or GraphvizGraph), and they do not support arbitrary properties. They will be removed in a future Boost version.

    -
    -

    Notes

    +
    +

    Notes

    • The read_graphviz function does not use any code from the @@ -430,7 +193,7 @@ corner cases that are not well specified.
    • reflect subgraphs as actual entities in the BGL. Rather, they are used to shorten some edge definitions as well as to give a subset of all nodes or edges certain properties. For example, the -DOT graphs digraph { a -> subgraph {b -> c} -> e } and +DOT graphs digraph { a -> subgraph {b -> c} -> e } and digraph { a -> b -> e ; a -> c -> e ; b -> c} are equivalent.
    • Subgraph IDs refer to subgraphs defined earlier in the graph description. Undefined subgraphs behave as empty subgraphs @@ -448,12 +211,12 @@ that property map value types are default constructible.
    -
    -

    See Also

    + -
    -

    Future Work

    +
    +

    Future Work