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~~h=G

~~1~~k =

~~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.

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.