Duplicated graph.py to try diff algo