calculate shortest distance