construct incidence matrix
(literal) reverse the sign convention for digraphs
IncidenceMatrix(G) returns the incidence matrix of a graph G whose rows are indexed by the vertices and columns by the edges of G. The order of the edges is defined by Edges(G).
If G is undirected the entry i,j of this 0,1-matrix is 1 iff vertex i is incident to edge j.
If G is directed the entry i,j of this −1,0,1-matrix is 1 iff vertex i is the head of arc j and −1 iff vertex i is the tail of arc j.
If G is directed and reverse is specified, the entry i,j of this −1,0,1-matrix is −1 iff vertex i is the head of arc j and 1 iff vertex i is the tail of arc j.
G≔Graph 1: an undirected unweighted graph with 4 vertices and 6 edge(s)
DG≔Graph 2: a directed unweighted graph with 5 vertices and 9 arc(s)
Download Help Document
What kind of issue would you like to report? (Optional)