Testing adjacency list and adjacency matrix graphs in Python.