Add some framework for PathAlgorithm.

@dgearhart @kevinkreiser @gknisely 
why do yo have to check?