algorithm

Shortest distance algorithm