|
SOLUTIONS
|
Mathematica
>
Mathematics and Algorithms
>
Graphs & Networks
>
Constructing Graphs
>
Graphs and Matrices
>
IncidenceMatrix
BUILT-IN MATHEMATICA SYMBOL
IncidenceMatrix
IncidenceMatrix[g]
gives the vertex-edge incidence matrix of the graph g.
DetailsDetails
- IncidenceMatrix returns a SparseArray object, which can be converted to an ordinary matrix using Normal.
- For an undirected graph, an entry
of the incidence matrix is given by: -
0 vertex
is not incident to edge 
1 vertex
is incident to edge 
2 vertex
is incident to edge
and a self-loop - For a directed graph, an entry
of the incidence matrix is given by: -
0 vertex
is not incident to edge 
1 vertex
is incident to edge
and
is the head of 
-1 vertex
is incident to edge
and
is the tail of 
2 vertex
is incident to edge
and a self-loop - The vertices
are assumed to be in the order given by VertexList[g] and the edges
are assumed to be in the order given by EdgeList[g]. - The incidence matrix for a graph will have an
×
matrix, where
is the number of vertices and
is the number of edges, counting multiplicity.
New in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »




