How To Implement A Graph In Python