Bridj-It 2.0 (a.k.a. GALE, BIRD CAGE and BRIDG-IT)

Theory


The game board consists of a pattern of red dots overlaid with a pattern of green dots. Each player takes turns connecting any adjacent pair of dots, either horizontally or vertically.

The human player plays from left to right on the green dots, while the computer plays from top to bottom on the red dots. The player who first makes a continuous line from one side of the board to the other is the winner.

The work done by Prof. Claude Shannon with 'BIRD CAGE', which used an electrical circuit of small light bulbs, and switches to open-circuit or short-circuit each bulb, with the machine's move being determined by observing which bulb was the brightest, suggests that electrical circuit analysis could be used to determine the computer's moves.

Therefore, the game board can be represented as a network of identical-value resistors, instead of light bulbs, with a voltage source applied across it.

The human plays by open-circuiting a resistor. The computer plays by short-circuiting a resistor. The game is won when the network is completely open-circuited or completely short-circuited.

The computer's move can be determined by using network analysis to calculate which resistor has the highest voltage across it (or the highest current flowing through it).

To do this, we need to calculate the currents flowing through each resistor.

Kirchoff's Voltage Law states that the sum of the voltages around a closed loop is zero.

Ohms Law states that V = IR, therefore the voltage across R1 is (I0 - I1) x R1, where I0 is the current flowing around loop 0, and I1 is the current flowing around loop 1.

The sum of the voltages around loop 0, then, is (I0-I1)R1+(I0-I2)R2+(I0-I3)R3+(I0-I4)R4 - V = 0

This can be rewritten as:
I0(R1+R2+R3+R4) - I1R1 - I2R2 - I3R3 - I4R4 = V

For loop 2, we get: I1(R1+R5+R8) - I0R1 - I2R5 - I5R8 = 0. Doing this for each loop in the network gives us a set of simultaneous linear equations which can be expressed in matrix form as: [R]*[I]=[V], or:

  (R1+R2+R3+R4) -R1 -R2 -R3 -R4 0 0 0 0 0 0 0 0       I0       V  
  -R1 (R1+R5+R8) -R5 0 0 -R8 0 0 0 0 0 0 0       I1       0  
  -R2 -R5 (R2+R5+R6+R9) -R6 0 0 -R9 0 0 0 0 0 0       I2       0  
  -R3 0 -R6 (R3+R6+R7+R10) -R7 0 0 -R10 0 0 0 0 0   *   I3   =   0  
  .
.
.
    .
.
.
    .
.
.
 
  0 0 0 0 0 0 0 0 -R18 0 0 -R21 (R18+R21+R25)       I12       0  

Now we can use matrix algebra to solve the equations and obtain the currents I0 through I12.

In the game BridjIt, we use the Gaussian elimination method. Once we have all the loop currents, we can calculate the actual current flowing through each resistor. For example, the current flowing through R1 is I0 - I1 and the current flowing through R13 is I6 - I7

All we have to do now, is note which resistor has the maximum amount of current flowing through it, and instruct the computer to make its move.