cleaning up the minimal path
Simplify the min-path