Implement the adjacency matrix graph