GraphTheory
AdjacencyMatrix
construct adjacency matrix
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
AdjacencyMatrix(G, opts)
AdjacencyMatrix(G, L, opts)
G
-
graph
L
values for adjacent, nonadjacent, and diagonal entries
opts
(optional) one or more options as specified below
datatype=type
Specifies a datatype for the generated Matrix as described in rtable . The default is datatype=anything.
order=one of C_order or Fortran_order
Specifies the order of the generated Matrix. The default is order=C_order.
shape=name or list of names
Specifies the storage allocation for Matrix entries. Must be a name or list of names specifying one or more built-in or user-defined indexing functions . The default is shape=symmetric if G is undirected and shape=[] if G is directed.
storage=name
Specifies the storage mode . The default is storage=sparse if the number of edges is much smaller than the square of the number of vertices; otherwise, it is storage=triangular[upper] if G is undirected and storage=rectangular if G is directed.
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 optional parameter L is a list of three elements specifying alternate special-purpose values for the entries of the adjacency matrix. If specified, the generated matrix has the following properties:
A[i,j] = L[1] when there is an edge from i to j in G
A[i,j] = L[2] when there is no edge from i to j in G
A[i,i] = L[3] along the diagonal
The default behavior corresponds to specifying the list [1,0,0].
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 is used.
with⁡GraphTheory:
G≔Graph⁡1,2,3,4,Trail⁡1,2,3,4,1
G≔Graph 1: an undirected graph with 4 vertices and 4 edges
AdjacencyMatrix⁡G
0101101001011010
Neighbors⁡G
2,4,1,3,2,4,1,3
H≔Digraph⁡1,2,3,4,Trail⁡1,2,3,4,1
H≔Graph 2: a directed graph with 4 vertices and 4 arcs
AdjacencyMatrix⁡H
0100001000011000
Departures⁡H
2,3,4,1
The GraphTheory[AdjacencyMatrix] command was updated in Maple 2021.
The L parameter was introduced in Maple 2021.
The datatype, order, shape and storage options were introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021 .
See Also
Degree
Departures
Neighbors
Trail
Download Help Document
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル