http://www.perlmonks.org?node_id=169100


in reply to Node Tension

Your formula is certainly much simpler than giulienk's, but I think it may be too simple. In particular, I don't think a +5/-5 node has the same amount of tension as a +95/-5 node. I'd say that a normalized version of your "tension" would be an improvement:
$t = abs($plus - $minus)/($plus + $minus)
/s
Update: Hossman is, of course, right. This should be inverted, like so:
$real_t = 1 - $t
I guess $t is a measure of blandness or something...