Drawing a planar multigraph with loops

asked 2018-01-10 07:00:59 -0600

A.P. gravatar image

I would like to draw a planar graph with multiple edges and loops in Sage. Unfortunately, the default algorithm draws may intersecting edges and Sage is unable to compute an embedding for graphs with loops multiple edges.

Fortunately I know a planar embedding of this graph, so I tried using the set_embedding method, but it doesn't seem to work, either. If I only list a vertice's the neighbours, omitting their multiplicities, Sage complains that the list is shorter than the vertice's degree, while if I include multiple copies of each neighbour according to multiplicity, then Sage complains that elements of the list aren't unique.

Is there a way to achieve what I need?

edit retag flag offensive close merge delete



Please provide code to generate the graph you are interested in.

This will make it a lot easier for other users to try to answer your question.

You can also say what you have tried and show how it fails and say what you would expect instead.

slelievre gravatar imageslelievre ( 2018-01-11 00:58:28 -0600 )edit