[Boost-bugs] [Boost C++ Libraries] #5441: add_edges in empty CSR graph

Subject: [Boost-bugs] [Boost C++ Libraries] #5441: add_edges in empty CSR graph
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-08 15:30:29


#5441: add_edges in empty CSR graph
--------------------------------------------------------------+-------------
 Reporter: Johan Oudinet <johan.oudinet@…> | Owner: asutton
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: compressed_sparse_row_graph, add_edges, graphviz |
--------------------------------------------------------------+-------------
 Hi,

 I'm using Boost 1.42 (but I guess the problem is still there in 1.46) and
 I get a strange behavior after using the method add_edges from CSR graph.
 Here is a summary of what I'm doing:
 My simple graph is described in test.dot

 1) I create an empty CSR graph g
 2) I add a total of 3 edges (those described in the GraphViz file) thanks
 to the method add_edges (and my own iterators) because read_graphviz
 doesn't work with CSR graph.
 3) num_edges is equal to 3 but num_vertices is equal to 0 instead of 3!
 4) If I try to iterate on the edges with BGL_FORALL_EDGES(e, g, graph_t),
 I get nothing!

 add_edges should create vertices also, shouldn't it?
 If not, I expect it throws at least an error if it finds an unknown
 vertex...

 The full example code that produces this _bug_ is available here:
 http://tinyurl.com/csr-add-edges-error

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5441>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC