Simplified the adjacency matrix to create the graph with labels for nodes