Boost logo

Boost :

Subject: Re: [boost] [BGL] Graph union
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-06-21 14:06:57


On Tue, 21 Jun 2011, Shaun Jackman wrote:

> Hi,
>
> Is there a graph adapter that presents a view of the union of two
> graphs? The union graph would not be modifiable.

No -- it's something we've wanted for a while, but I don't think anyone
has written one.

> If not, any tips on how to go about implementing this?

If you are just taking the union of the edges and keeping the same vertex
set, it should not be too difficult using iterator_adaptor. The issue for
the general case (which you might not have) is how to handle properties
that exist only on one side of the union or the other. You might want to
try boost::optional for that, but the iterator design will be more
complicated.

-- Jeremiah Willcock


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk