Add shortest distance weight.