AdjacencyMatrix: Representing a Graph by a Matrix
Learn about the representation of graphs by matrices.
We'll cover the following...
An adjacency matrix is a way of representing an vertex graph by an matrix, a
, whose entries are boolean values.
Press + to interact
int n;boolean[][] a;AdjacencyMatrix(int n0) {n = n0;a = new boolean[n][n];}
The matrix entry a[i][j]
is defined as
...