Create a graph factory struct.