Shortest Path In Graph Python