Move k-path and floyd-warshall to their separate module.

This will yield less recomputations while running experiments.