WLJS LogoWLJS Notebook

IncidenceMatrix

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

  • IncidenceMatrix[{v -> w, ...}] uses rules v -> w to specify the graph g.

Examples

Incidence matrix of a graph:

g = Graph[{1 -> 2, 2 -> 3, 3 -> 1}];
IncidenceMatrix[g]

From edge rules:

IncidenceMatrix[{a -> b, b -> c, c -> a}]

Undirected graph:

IncidenceMatrix[CycleGraph[4]]

Please visit the official Wolfram Language Reference for more details.

On this page