# $4$ way heat distribution multiplier problem

I'm making a simple heat distribution program. It's a $2D$ matrix with cells holding heat value. Every iteration looks for cells near current which have lower heat value and gives them some of its heat. Each cell gets different amount of heat (based on heat difference and conductivity).

The problem is with the stage where the distributed amount of heat needs to be multiplied by a certain number to account for up to three nearby cells that don't accept heat (hotter than current cell). I can't figure out how to calculate that multiplier.

-
I think you're going to have to supply a bit more detail than that. What's the purpose of this "accounting for"? –  joriki Aug 10 '12 at 17:01
It's for giving the full amount of distributable heat to all available cells proportionately. –  user1306322 Aug 10 '12 at 17:08