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.
2 | No.2 Revision |
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
G.subdivide_edges(G.edges(), k)
h=G.distance_graph(list(range(1,3)))
This seems to work in my case.