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
comment:2 follow-up: 3 Changed 14 years ago by
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 Changed 14 years ago by
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 12 years ago by
Milestone: | LEMON 1.3 release → LEMON 1.4 release |
---|
Changed 10 years ago by
Attachment: | d40bd6a41276ebb3795cb50422975481.jpg added |
---|
comment:5 Changed 8 years ago by
Milestone: | LEMON 1.4 release → LEMON 1.5 release |
---|
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.