GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/IncidenceMatrix

GraphTheory

  

IncidenceMatrix

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IncidenceMatrix(G)

IncidenceMatrix(G, reverse)

Parameters

G

-

graph

reverse

-

(literal) reverse the sign convention for digraphs

Description

• 

IncidenceMatrix(G) returns the incidence matrix of a graph G whose rows are indexed by the vertices and columns by the edges of G.  The order of the edges is defined by Edges(G).

• 

If G is undirected the entry i,j of this 0,1-matrix is 1 iff vertex i is incident to edge j.

• 

If G is directed the entry i,j of this −1,0,1-matrix is 1 iff vertex i is the head of arc j and −1 iff vertex i is the tail of arc j.

• 

If G is directed and reverse is specified, the entry i,j of this −1,0,1-matrix is −1 iff vertex i is the head of arc j and 1 iff vertex i is the tail of arc j.

Examples

withGraphTheory:

GCompleteGraph4

GGraph 1: an undirected unweighted graph with 4 vertices and 6 edge(s)

(1)

EdgesG

1,2,1,3,1,4,2,3,2,4,3,4

(2)

IncidenceMatrixG

111000100110010101001011

(3)

DGDigraphTrail1,2,3,4,5,3,Trail1,5,2,4,1

DGGraph 2: a directed unweighted graph with 5 vertices and 9 arc(s)

(4)

EdgesDG

1,2,1,5,2,3,2,4,3,4,4,1,4,5,5,2,5,3

(5)

IncidenceMatrixDG

−1−1000100010−1−1000100010−1000100011−1−1000100001−1−1

(6)

IncidenceMatrixDG,reverse

11000−1000−1011000−1000−101000−1000−1−111000−10000−111

(7)

See Also

AdjacencyMatrix

Degree

IncidentEdges

Neighbors

Trail