Implemented two routing algorithms.