This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

• An entry of the adjacency matrix is the number of directed edges from vertex to vertex .
• The diagonal entries count the number of loops for vertex .
• An undirected edge is interpreted as two directed edges with opposite directions.
• The vertices are assumed to be in the order given by VertexList[g].
• The adjacency matrix for a graph will have dimensions , where is the number of vertices.
The adjacency matrix of an undirected graph:
The adjacency matrix of a directed graph:
The adjacency matrix of an undirected graph:
 Out[1]=
 Out[2]//MatrixForm=

The adjacency matrix of a directed graph:
 Out[1]=
 Out[2]//MatrixForm=
 Scope   (4)
The adjacency matrix of an undirected graph is symmetric:
The adjacency matrix of a directed graph can be unsymmetric:
The adjacency matrix of the graph with self-loops has diagonal entries:
Use MatrixPlot to visualize the matrix:
 Applications   (7)
Compute the degree for an undirected graph from its adjacency matrix:
Compute the in-degree for a directed graph from its adjacency matrix:
Compute the out-degree for a directed graph from its adjacency matrix:
Count the number of paths between all vertices in at most steps for a directed graph:
There are two paths from 1 to 5 in two steps:
Count the number of paths from to in at most steps for a directed graph:
Compute the cocitation matrix, where the cocitation for two vertices is the number of common ancestors:
The cocitation between and :
Compute the coupling matrix, where the coupling between two vertices is the number of common descendants:
The coupling between and :
Rows and columns of the adjacency matrix follow the order given by VertexList:
Use VertexIndex to find the matrix row and column corresponding to a pair of vertices:
Check whether and are adjacent vertices:
Compare with EdgeQ:
An undirected graph has a symmetric adjacency matrix: