computing edge weights