Macaulay2 » Documentation
Packages » Graphs :: incidenceMatrix
next | previous | forward | backward | up | index | toc

incidenceMatrix -- computes the incidence matrix of a graph

Synopsis

Description

An incidence matrix M is the #vertexSet of G by #edges of G matrix where entry (i,j) equals 1 if vertex i is incident to edge j, and equals 0 otherwise.

i1 : M = incidenceMatrix cycleGraph 3

o1 = | 1 1 0 |
     | 1 0 1 |
     | 0 1 1 |

              3       3
o1 : Matrix ZZ  <-- ZZ

See also

Ways to use incidenceMatrix :

For the programmer

The object incidenceMatrix is a method function.