結果 : shortest distance algorithm