A Algorithm Using Python For A Graph