add graph.py to build graph