1 year ago

#320383

test-img

GiacomoFrisoni

Python - Efficient algorithm to compute edge adjacency matrix (line graph)

Does anyone know an efficient algorithm to compute the edge-adjacency matrix (also known as the line graph L(G)) of a graph (G) starting from its traditional vertex-adjacency matrix?

By definition

The edge-adjacency matrix E of G is a square and symmetric matrix whose elements eij are 1 if and only if edge i is adjacent to edge j. Two edges are adjacent if they are incidents to a common vertex.

Target transformation example. The nodes and edges’ roles are inversed in the new graph.

enter image description here

python

matrix

graph-theory

adjacency-matrix

0 Answers

Your Answer

Accepted video resources