0
votes

Suppose that G is a directed graph object in python-igraph (ver. 0.7). I want to create the following graph L related to G:

  1. The nodes of L correspond to edges of G
  2. Every node x of L has an attribute (i,j) if x corresponds to the edge i--->jof G. Here by simplicity we denote x as x.(i,j)
  3. There is an edge in L, x.(i,j)--->y.(k,l) if and only if j=k and i!=l.

The adjacency matrix of L is called the Hashimoto matrix of G.

A wrong way to create such L is the following: First we put L=G.linegraph() and then we delete the mutual edges from L. The problem with this approach is that we haven't the attributes related to the vertices of L.

Do you have any idea/hint for the construction of L?

1

1 Answers

0
votes

Please correct me if I am wrong, but if I understand it correctly then the only problem with the output of L = g.linegraph() is that the attributes are not attached to the vertices of L. Is that correct? If so, they are easy to add because vertex i in the line graph is the same as edge i in the original graph, so you can do this:

L.vs["original_edge"] = G.get_edgelist()