I should complete allpairs and removepath, but I think it's too hard to do it and understand how my prof have made the algorithm.
So anyone can help make a simple version af this algorithm, easier to understand?

1) Please provide sample input.
2) Leading white space is a key element of python syntax. Please follow and read the link at my signature to preserve your program indentation.
3) Please demonstrate that you made an effort to understand the program.

Looks like each edge is bi-directional. No "1 way streets".

ps. Hey! The "quote post" trick works to recover the spaces! Thank you again.