solving the konigsberg bridge problem with Python