Initial adjacency matrix implementation