COIN-OR::LEMON - Graph Library

Opened 14 years ago

Last modified 8 years ago

#384 new enhancement

Adaptor class for complementary graph

Reported by: Peter Kovacs Owned by: Balazs Dezso
Priority: major Milestone: LEMON 1.5 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

It would be nice to have an adaptor class to obtain the complementary graph of a simple, undirected graph.

Attachments (1)

Change History (6)

comment:1 Changed 14 years ago by Peter Kovacs

I think, the adaptor should not check if the original graph is simple or not, just leave out such edges that can be found in it.

comment:2 in reply to:  description ; Changed 14 years ago by Alpar Juttner

Replying to kpeter:

It would be nice to have an adaptor class to obtain the complementary graph of a simple, undirected graph.

Do you have any idea how to implement it?

A function to statically create a complementary graph seems to be an easier target.

comment:3 in reply to:  2 Changed 14 years ago by Peter Kovacs

Replying to alpar:

It would be nice to have an adaptor class to obtain the complementary graph of a simple, undirected graph.

Do you have any idea how to implement it?

Such an adaptor class could be implemented as if it was a combination of FullGraph and FilterEdges using an ArcLookup solution for filtering the edges of the original graph. It wouldn't be so fast, but it would be convenient.

A function to statically create a complementary graph seems to be an easier target.

Adaptor classes are typically harder to implement and slower to use than creating another structure explicitly. However, they are more convenient, especially because they are dynamic. That's why I would prefer an adaptor class for this purpose.

(In fact, such an adpator class could be used easily to create an explict complementary graph using GraphCopy.)

comment:4 Changed 11 years ago by Alpar Juttner

Milestone: LEMON 1.3 releaseLEMON 1.4 release

comment:5 Changed 8 years ago by Alpar Juttner

Milestone: LEMON 1.4 releaseLEMON 1.5 release
Note: See TracTickets for help on using tickets.