Creates a graph