An adjacency matrix is a data structure for storing graphs in memory. If the graph has N nodes, then it can be represented by an N×N boolean matrix, with each element Mi,j representing whether there exists an edge between node i and node j.
This is preferred when there are many edges but not many nodes. Otherwise, consider using adjacency list.