Opened 7 years ago

Last modified 6 years ago

#11714 new Bugs

[subgraph.hpp] add_vertex(u_global, g) on a subgraph does not recursively add to parent subgraphs

Reported by: s.hammer@… Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost Development Trunk Severity: Problem
Keywords: subgraph Cc:

Description

Hello,

One of the invariants of an induced subgraph is:

  • If vertex u is in subgraph g, then u must be in g.parent().

This is true if you call add_vertex(g) on a subgraph to create a new vertex. If you however choose to add a already existing global vertex to the subgraph, this addition is not propagated to the parents of this subgraph.

I assume this is a bug and fixed it. The patch is on github: https://github.com/j-4/graph/tree/fix-add_vertex-subgraph

I also created a pull request! Thanks, Stefan

PS: Attached is a unit test which fails due to this issue and runs through with the patched version!

Attachments (3)

test_subgraph.cc (5.5 KB ) - added by s.hammer@… 7 years ago.
Boost unit test for the issue
subgraph.hpp (38.7 KB ) - added by Stefan Hammer <s.hammer@…> 7 years ago.
UPDATE: Boost unit test for the issue
test_subgraph.2.cc (8.5 KB ) - added by Stefan Hammer <s.hammer@…> 7 years ago.
UPDATE: Boost unit test for the issue

Download all attachments as: .zip

Change History (4)

by s.hammer@…, 7 years ago

Attachment: test_subgraph.cc added

Boost unit test for the issue

by Stefan Hammer <s.hammer@…>, 7 years ago

Attachment: subgraph.hpp added

UPDATE: Boost unit test for the issue

by Stefan Hammer <s.hammer@…>, 7 years ago

Attachment: test_subgraph.2.cc added

UPDATE: Boost unit test for the issue

Note: See TracTickets for help on using tickets.