# Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# IncidenceMatrix

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:
•  0 vi is not incident to ej 1 ej=vivk, ej=vkvi, or ej=vkvi -1 ej=vivk 2 ej=vivi -2 ej=vivi
• 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]:=
 Out[1]=
 In[2]:=
 Out[2]//MatrixForm=

The incidence matrix of a directed graph:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]//MatrixForm=