Add function to compute how an individual edge contributes to a node's
gain value.