create_graph function

Create a graph object