Moved from adjacency matrix to adjacency list for connectivity matrices. Should help in reducing space complexity quite a bit. Needs a bit of cleanup in the code though.