Graph structure using adjacency matrix