Wrote functions for getting the states and edges in a graph