Section2.3Line Graphs and Covers
Let D be the incidence matrix of an orientation of the graph X. Then
A signed ajacency matrix T of a graph Y determines a two-fold cover Z of Y, as follows. The vertex set of the cover is
The pairs
Lemma2.3.1
Here |S|=A(Y). We offer another view of this result. If A and B are symmetric 01-matrices such that A\circ B=0, then A-B is a signed adjacency matrix and
This leads us to an easy construction of the adjacency matrix of the cover.
xxxxxxxxxx
def lgcvr( X):
D = X.incidence_matrix()
IDM = identity_matrix( X.num_edges())
M = D.transpose()*D -2*IDM
MM = M.elementwise_product(M)
A = (1/2)*(M+MM)
B = (1/2)*(M-MM)
return block_matrix(2, 2, [A,B,B,A])
Now we turn to our line graphs. The cover can be constructed as follows. Choose one arc (u,v) for each edge \{u,v\} of X. (This defines an orientation of the graph.) Our matrix S is a signing of A(L(X))—its rows and columns are indexed by our chosen arcs, and the entry corresponding to a pair of distinct overlapping arcs is 1 if they have the same head or tail, and -1 otherwise. Rather than represent the vertices of the cover by pairs ((u,v),i), we proceed thus: if (u,v) is one of our chosen arcs then we use (u,v) to denote ((u,v),0) and (v,u) for ((u,v),1). The following procedure implements this.
xxxxxxxxxx
def dbl_lng( X):
V = X.vertices()
E = X.edges( labels=False)
arcs = [(i,j) for i in V for j in V\
if ((i,j) in E or (j,i) in E)]
return Graph( [arcs, lambda a,b: a != b and (a[0]==b[0] or a[1]==b[1])])
We test that our two constructions agree on the Petersen graph, and see that cover is isomorphic to the line graph of the direct product of the Petersen graph with K_2. (This product is itself a cover of the Petersen graph.)
xxxxxxxxxx
P = graphs.PetersenGraph()
Q1 = Graph( lgcvr( P))
Q2 = dbl_lng( P)
Q1.is_isomorphic( Q2)
xxxxxxxxxx
K2 = graphs.CompleteGraph(2)
LP2 = (P.tensor_product(K2)).line_graph()
LP2.is_isomorphic( Q1)