Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Line graph of a given graph

I tried this code in sage. But in the output the vertex labelling of the desired line graph gets overlapped and hece the graph is not clearly visible. Can I improve the code so that the line graph is clearly visible without overlapping.

G=graphs.EmptyGraph()

G.add_edges([(2,3),(2,4),(2,1),(1,5),(5,6),(1,0),(0,12),(0,13),(14,0),(15,0),(7,0),(7,10),(11,7),(7,9),(7,8)])

G.show()

h = G.line_graph()

h.show()

click to hide/show revision 2
None

updated 2017-09-14 08:24:27 -0500

kcrisman gravatar image

Line graph of a given graph

I tried this code in sage. But in the output the vertex labelling of the desired line graph gets overlapped and hece the graph is not clearly visible. Can I improve the code so that the line graph is clearly visible without overlapping.

G=graphs.EmptyGraph()

G=graphs.EmptyGraph()
 G.add_edges([(2,3),(2,4),(2,1),(1,5),(5,6),(1,0),(0,12),(0,13),(14,0),(15,0),(7,0),(7,10),(11,7),(7,9),(7,8)])
 

G.add_edges([(2,3),(2,4),(2,1),(1,5),(5,6),(1,0),(0,12),(0,13),(14,0),(15,0),(7,0),(7,10),(11,7),(7,9),(7,8)])

G.show()

G.show()

h = G.line_graph()

G.line_graph()

h.show()

h.show()