Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

By using the equivalent definition of total graph as the square(or distance-2 graph) of the subdivision graph(the graph formed by subdividing each edge, we obtain the following pseudo-code:

def TotalGraph(G)

h=G

k = 1

G.subdivide_edges(G.edges(), k)

h=G.distance_graph(list(range(1,3)))

return h

This seems to work in my case.

By using the equivalent definition of total graph as the square(or distance-2 graph) of the subdivision graph(the graph formed by subdividing each edge, we obtain the following pseudo-code:

def TotalGraph(G):
 

def TotalGraph(G)

h=G

h=G

k = 1

1

G.subdivide_edges(G.edges(), k)

G.subdivide_edges(G.edges(), k)

h=G.distance_graph(list(range(1,3)))

h=G.distance_graph(list(range(1,3))) return h

h

This seems to work in my case.