I'm programming a boardgame...game. The basic idea of it is there are two players (call them $X$ and $Y$) that are trying to trying to build a wall connecting the North and South, and East and West sides, respectively, of a chessboard (however it can be larger or smaller than $8\times 8$ but the board is always square.) A typical board state would look something like this:
0 X 0 0 0 0
0 0 0 0 0 0
Y 0 0 X Y 0
0 Y X Y X 0
0 0 Y 0 0 0
0 0 X 0 0 0
Zero denotes an empty space. $Y$'s pretty close to winning. All $8$ directions between pieces count as connections. (I'm simplifying the rules a bit for the sake of clarity, I promise you the actual game is at least somewhat more exciting.)
Does some function or algorithm $f($player, board$)$ exist that gives me a number measuring how connected the player's sides of the board are given the board configuration? (Would tend to -Infinity for a loss, $0$ for an empty board, and $+\infty$ for a win)
I've actually tried modelling it as a diffusion problem numerically, but computation time becomes an issue there, and situations like this lead to problems with that approach too:
0 0 0 X 0 0 0
0 0 0 X 0 0 0
0 0 0 X 0 0 0
Y Y Y X Y Y Y
0 0 0 X 0 0 0
0 0 0 X 0 0 0
0 0 0 X 0 0 0
I'm just a dumb physicist, so this area of math is totally outside my area of expertise!!!