Thanks for the explanation.
I have implemented this myself now and try to use it for exploration only so far. In general it seems to work with some little flaws. There is one question remaining from my side

You say you put all tiles to explore in the bfs queue at once(which makes sense) but also your weighting function is weight/dist^2.
I understand how that works if you have one source .. like a food location. If the food is weighted with 100 you have a value of 100/4 two tiles away and 100/9 three tiles away and so on.
But with multiple sources how can I be sure about the source(and so the distance)? Because every visited tile has 4 influences(its neighbors) how do i determine which is the source?
I assume the exploration targets have different weights.. if not everything would be clear
