Added functionality for initializing Graph and DiGraph using adjacency matrix