Plot a planar graph as a plane graph

asked 1 year ago

wizard7703 gravatar image

updated 1 year ago

I have a graph D which is the bipartite graph of a matrix Y. I know this graph is planar, however when I plot it using the .plot() and output it using .save() it does not plot as a plane graph. I was wondering if there was any nice way to output a graph in a planar form (namely, such that none of the edges intersect). According to this website on the plotting sage math website (can't post url since my karma is too low) there is a plot option 'layout' which seems to have the option 'planar'. I am unsure how to test this, or if this would even achieve what I'm interested in doing.

Preview: (hide)

Comments

yes but I am unsure how to use the 'planar' layout seems to output a graph whose vertices are not organized in any nice way

wizard7703 gravatar imagewizard7703 ( 1 year ago )

well, its a planar picture. That it does not please you is a matter of taste entirely.

FrédéricC gravatar imageFrédéricC ( 1 year ago )

you could try to manipulate the picture yourself using

sage: g = graphs.WheelGraph(6)
sage: g.show(method='js')
FrédéricC gravatar imageFrédéricC ( 1 year ago )