support for adjacency list added
adjacency matrix for graph connectivity