GraphTheory[AdjacencyMatrix] - Maple Help

Online Help

All Products    Maple    MapleSim


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

GraphTheory[AdjacencyMatrix]

Calling Sequence

AdjacencyMatrix(G)

Parameters

G

-

graph

Description

• 

The AdjacencyMatrix command returns the adjacency matrix of a graph G whose rows and columns are indexed by the vertices. The entry i,j of this matrix is 1 if there is an edge from vertex i to vertex j and 0 otherwise.

• 

The default output is an n by n Matrix with the following properties:

– 

If G is directed or undirected: datatype=anything and order=C_order

– 

If G is undirected: shape=symmetric, storage=triangular[upper],

– 

If G is directed: storage=rectangular, shape=[]

– 

If G is sparse, i.e., |E| << |V|^2 then storage=sparse will be used.

Examples

withGraphTheory&colon;

G:=Graph1&comma;2&comma;3&comma;4&comma;Trail1&comma;2&comma;3&comma;4&comma;1

G:=Graph 1: an undirected unweighted graph with 4 vertices and 4 edge(s)

(1)

AdjacencyMatrixG

0101101001011010

(2)

NeighborsG

2&comma;4&comma;1&comma;3&comma;2&comma;4&comma;1&comma;3

(3)

H:=Digraph1&comma;2&comma;3&comma;4&comma;Trail1&comma;2&comma;3&comma;4&comma;1

H:=Graph 2: a directed unweighted graph with 4 vertices and 4 arc(s)

(4)

AdjacencyMatrixH

0100001000011000

(5)

DeparturesH

2&comma;3&comma;4&comma;1

(6)

See Also

Degree, Departures, Neighbors, Trail


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam