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
:
- The nodes of
L
correspond to edges ofG
- Every node
x
ofL
has an attribute(i,j)
ifx
corresponds to the edgei--->j
ofG
. Here by simplicity we denotex
asx.(i,j)
- There is an edge in
L
,x.(i,j)--->y.(k,l)
if and only ifj=k
andi!=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
?