Opened 10 years ago
Closed 10 years ago
#7863 closed Bugs (wontfix)
Bad graph after removing named vertex and then adding it again.
Reported by: | Owned by: | Jeremiah Willcock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | graph |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Attached is a thin wrapper around boost::adjacency_list. Swapping lines 155 and 156 will switch between expected behavior and a corrupted graph Seems to be related to re-adding a vertex that was previously removed.
Attachments (1)
Change History (7)
by , 10 years ago
Attachment: | graphing.cpp added |
---|
comment:1 by , 10 years ago
comment:2 by , 10 years ago
A bug for sure on line 121, but on 124 the vertex would still be valid as it hasn't been removed. Either way those lines are there as I was trying to figure out what was wrong, and the bug reported stands whether none, either, or both lines 121, 124 are commented out.
Final tree when connect called after disconnect: b->d
Final tree when disconnect called after connect: c->b, a->b, c->d, b->d
comment:3 by , 10 years ago
It looks like you cannot use a vecS
vertex container with a named_graph
when you remove vertices; there is nothing that updates the name lookup table based on the new vertex descriptors. Because unrelated vertex descriptors might be invalidated by remove_vertex
, the table might need to be entirely rebuilt in that case. Could you please try listS
or setS
as vertex container (the second template parameter to adjacency_list
) instead of vecS
?
comment:4 by , 10 years ago
comment:5 by , 10 years ago
I've since updated to listS and things work as I want...but the vecS was definitely doing things it shouldn't so reported it.
comment:6 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
You were right to report the issue; I added a check now so that other users will not get the same kind of subtle run-time error that you experienced.
On lines 121 and 124, you are using
*tv
even after that vertex might have been deleted (on 121, it is known to have been deleted). Your comment about*fv
being invalid after*tv
has been removed is correct; in a graph withvecS
vertex container, removing one vertex invalidates all other vertex descriptors.