GraphTheory[AdjacencyMatrix]
|
Calling Sequence
|
|
AdjacencyMatrix(G)
|
|
Description
|
|
•
|
The AdjacencyMatrix command returns the adjacency matrix of a graph G whose rows and columns are indexed by the vertices. The entry 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
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
|
|
Download Help Document
Was this information helpful?