Opened 12 years ago

Closed 11 years ago

#5441 closed Bugs (wontfix)

add_edges in empty CSR graph

Reported by: Johan Oudinet <johan.oudinet@…> Owned by: Andrew Sutton
Milestone: To Be Determined Component: graph
Version: Boost 1.42.0 Severity: Problem
Keywords: compressed_sparse_row_graph, add_edges, graphviz Cc:

Description

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

Attachments (1)

test.dot (82 bytes ) - added by Johan Oudinet <johan.oudinet@…> 12 years ago.
Simple GraphViz file to give as input of the program

Download all attachments as: .zip

Change History (2)

by Johan Oudinet <johan.oudinet@…>, 12 years ago

Attachment: test.dot added

Simple GraphViz file to give as input of the program

comment:1 by Jeremiah Willcock, 11 years ago

Resolution: wontfix
Status: newclosed

BGL does not have checks for out-of-bounds accesses in many places, and so crashing on use of invalid vertex descriptors will not be fixed.

Note: See TracTickets for help on using tickets.