Unexpected behaviour of complement method - is it a bug?

I’m trying to create a complement of graph:

g = ig.Graph()
g.add_vertices([0, 1, 2, 3])
g.add_edges([[0,1], [0,2], [1, 2]])
c = g.complementer() 
[e.tuple for e in c.es]

and I get that edges are:

[(0, 3), (0, 0), (1, 3), (1, 1), (2, 3), (2, 2), (3, 3)]

Looped ones are not needed so I try to disable them using

g.complementer(loops=False)

but then I get TypeError: complementer() takes no keyword arguments. This is weird because documentation says that loops is a keyword of complementer.
What do I do wrong?

1 Like

This is a bug; the workaround is to use g.complementer(False) (i.e. as a positional argument). I’ll fix this soon. Thanks!

1 Like

This is now fixed in the development version. Many thanks for the bug report!

1 Like