IncidenceMatrix

IncidenceMatrix[g]
gives the vertex-edge incidence matrix of the graph g.

IncidenceMatrix[{vw,}]
uses rules vw to specify the graph g.

DetailsDetails

  • IncidenceMatrix returns a SparseArray object, which can be converted to an ordinary matrix using Normal.
  • The incidence matrix for a graph with vertices {v1,,vn} and edges {e1,,em} is an matrix with entries aij given by:
  • 0vi is not incident to ej
    1ej=vivk, ej=vkvi, or ej=vkvi
    -1ej=vivk
    2ej=vivi
    -2ej=vivi
  • The vertices vi are assumed to be in the order given by VertexList[g] and the edges ej are assumed to be in the order given by EdgeList[g].

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

The incidence matrix of an undirected graph:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//MatrixForm=

The incidence matrix of a directed graph:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//MatrixForm=
Introduced in 2010
(8.0)
| Updated in 2015
(10.3)
Translate this page: