title: How would I program an algorithm to solve this puzzle?
body: <p>Need ideas on programming an algorithm to solve a particular puzzle.</p>
  
  <p>Basically, the puzzle is:</p>
  
  <p>There are 9 lights arranged in a 3x3 grid:<br>
  A B C<br>
  D E F<br>
  G H I<br>
  (lets say each letter represents a light)</p>
  
  <p>If you turn on or off a light, the lights adjacent to it (up, down, left or right), but not diagonal, will turn on if they are are off, or turn off if they are on.<br>
  (e.g. if A is off, B is off, D is off and you turn on A, B and D will turn on as well)</p>
  
  <p>If you are given a 3x3 grid with lights that are on or off arranged randomly, what would be the least number of lights you need to turn on or off, to turn off all the lights.  </p>