Created the graph and adjacency matrix