list of heuristics used
-: implemented
*: not implemented (yet)

KEY

level 1: trivial, immediate: can spot this by looking at one
         cell and its immediate neighbourhood
level 2: easy, almost immediate: can spot this with doing a
         minimum of search through slightly more distant
         cells.
level 3: intermediate: need to consider a larger area,
         possibly the entire board. heuristics with runtime
         Theta(n^4) will NOT go here.
level 4: more powerful search needed, might need to search
         through the entire board multiple times, runtime
         can be exponential.
level 5: advanced stuff. runtime: 2^(runtime from level 4)

NURIKABE (NP-complete)

level 1 (trivial, immediate)

- surround cells containing 1 with walls.
- for 2x2 blocks containing 3 walls, set the 4th to be island.
- if a cell is adjacent to two numbers, it must be wall.
- if an unfilled cell is surrounded by wall, it must be wall.
- if there is an island of the same size as its number, all
  unfilled neighbouring cells must be wall.
* if an unfilled cell is surrounded by island, it must be
  island (not needed so far).

level 2 (easy, almost immediate)

- if a cell is adjacent to two different islands (they both
  contain a number), it must be wall.
- if a wall region can only grow to one cell and not all walls
  have been placed, the one cell must be wall.
- if an island can only grow to one cell (and it's not done),
  then the cell must be island.
- if there is an enclosure containing a number and the
  enclosure is of the same size, all enclosed cells must be
  island.

level 3

- if an island is one less than its size and one cell is
  adjacent to all cells the island can grow to, that one
  cell must be wall.
- if a cell on the board cannot be reached by any island,
  it must be wall.
- if there is a cell where an island must pass in order to
  grow enough, it must be island ("island articulation point").
- if there is an island which, when grown maximally, reaches
  exactly its size, then let it do so.

level 4

- if there is a cell where a wall must pass in order to
  connect all walls, it must be wall ("wall articulation
  point").
- if an island can grow into a cell and cause another island
  to not be able to grow sufficiently, that cell must be wall.
- if there is a cell where a wall on it would cause another
  island to not be able to grow sufficiently, that cell must
  be island.
* take intersection of all ways to put an island (including
  surrounding walls). if it is possible to find two disjoint
  growings of an island, then the intersection of island is
  empty (the intersection of walls might still be nonempty).
  the leaf of the backtracking should check if the final
  shape (including walls) doesn't violate basic rules (2x2
  wall, isolated enclosure with wall and unnumbered island,
  neighbouring islands closed with wrong number)
* if there is an unnumbered blank which can only be legally
  connected to one numbered tile: try all ways of connecting
  these and take the intersection. see above.
* if there is an unnumbered blank which can only be legally
  connected to one numbered tile: set the island id for this
  blank, and run the other island growth heuristic.
* if there is a "corridor" somewhere such that a wall in one
  of its cells will cause 2x2 wall, then this cell must be
  island.
* for a group of (connected?) cells of size n>=2: assume in
  turn all 2^n combinations. do a non-deep check for illegal
  scenarios: 2x2 walls, disconnected walls, enclosed islands
  with wrong size, 0 or 2 numbers. if the subgroup of
  noncontradicting fillings has a cell filled in the same
  way across all fillings, then it must be filled in like
  that.

level 5

- for a cell: assume that it is blank, then fill in greedily.
  then, assume it's wall, fill in greedily. for each cell that
  were filled in similarly for both, then the cell should be
  filled in like this. in addition, if any of the assumptions
  cause a contradiction, the cell must be filled in the other
  way.
* if an unnumbered island can belong to n numbered islands:
  for each of the n islands, assume that the unnumbered island
  belongs to it, then solve greedily. if all but one leads
  to contradiction, then the unnumbered island belongs to the
  non-contradictory one. afterwards, run suitable unnumbered
  connection heuristic.
* for a group of (connected?) cells of size n>=2: assume in
  turn all 2^n combinations of filling in these cells. if a
  subset causes contradictions: check if the complementary
  subset of noncontradictory fillings have one cell filled
  in the same way. then, fill it in. also, if, for the non-
  contradictory subset, some cell gets filled in the same
  way for every combination, then it must be filled in like
  that.
* given an unnumbered island: identify all islands being
  able to reach it. take intersection of all ways for all
  islands to reach the island (might be too expensive).

level ? (unformalized heuristics)

* try to grow two or more islands simultaneously and take
  intersection?
* find a general area where only one island can grow in
  order to prevent 2x2 wall. use this in conjunction with
  intersection.
* try all ways to connect two walls. if only one way is
  legal, apply it.
* advanced reasoning on walls: check if a blank prevents a
  wall spanning tree (based on the number of allowed walls)
* given an isolated unnumbered island: identify all islands
  able to reach it. then check if there is an island such
  that all the other islands (when connecting to the
  isolated island) causes the island to not be able to grow
  to its desired size. then, the isolated island belongs to
  this island, and we can run intersection on the island
  and the isolated island. (?)
* assume that a cell is empty. then, try to prove that when
  the empty cells grows to a numbered island, then the
  walls have to be disconnected. if this is true, then the
  cell must be wall.

AKARI (NP-complete)

level 1 (trivial, immediate)

- if a wall already has its n lights, or it will have n lights
  after lighting up all adjacent free cells, fill in all
  free neighbours with empty and light, respectively.

level 2 (easy, almost immediate)

- if a light diagonally adjacent to a wall causes that wall
  to not being able to fulfill its number of required adjacent
  lights: that cell must be empty.
- if there is an unlit empty cell and only one unfilled cell
  which can reach it, that cell must be light.
- if an unfilled cell can't see any other unfilled cells,
  it must contain bulb.

level 3 (intermediate)

* if putting a bulb on a cell makes it impossible to light up
  some cell on the board, that cell must be empty.
  (level 5 contradiction also accomplishes this, only slower)
* check if there exists two walls each having two possible light sites,
  forcing all other cells in two lanes to be empty

level 4

level 5 (advanced)

- for a cell: assume that it has bulb, then fill in greedily.
  then, assume it's empty, fill in greedily. for each cell that
  were filled in similarly for both, then the cell should be
  filled in like this. in addition, if any of the assumptions
  cause a contradiction, the cell must be filled in the other
  way.

HEYAWAKE (NP-complete)

level 1 (trivial, immediate)

- if a numbered region has enough walls, then the rest of the
  cells must be empty.
- if a numbered region has number of walls + unfilled equal to
  its number, then the rest of the cells must be wall.
- mark unfilled cells next to a wall as empty
- identify combinations of rectangle shapes, numbers and whether
  they are near a wall (n*m-i, n*m rectangle with number i)
  - 2x2-2 in a corner
  - 2x2-2 
  - 3x2-3 with the 3 side at the edge
  - 3x3-5
  - 3x3-4, mark empty
  - nx2-n (n>2), mark n-2 empty in neighbouring regions
  - (n*2+1)x1

level 2 (almost immediate)

- if making a cell empty causes a strip of empty passing through
  >=2 borders, then the cell must be wall.
- if an empty cell is surrounded by three walls, the fourth must
  be empty.

level 3 (intermediate)

- try all combinations of filling in a numbered region. only
  check if for adjacent walls and surrounded 1x1 within the
  region. across all non-rejected combinations, take the
  intersection of these (ie, only fill in cells filled in
  the same way for all combinations). only attempt this
  heuristic if (regsize choose regnum) is below a certain
  number.
* check all pairs of regions to find:
  * neighbouring 3x3-4 and 3x3-4: fill in as #  |  #
                                              # | #
                                             #  |  #

level 4

- if placing a wall in a cell causes two regions to be
  disconnected, then the cell must be empty ("empty
  articulation point")

level 5

* for a cell: assume that it is blocked, then fill in greedily.
  then, assume it is blank, fill in greedily. for each cell that
  were filled in similarly for both, then the cell should be
  filled in like this. in addition, if any of the assumptions
  cause a contradiction, then the cell must be filled in the
  other way.
* try all combinations of filling in a numbered region. reject
  all combinations causing disconnection, strip crossing >=2
  borders and adjacent walls. fill in the intersection of
  all these combinations. NB, do not run this heuristic if
  regsize choose regnum is larger than some constant.

PICROSS (NP-complete)

SLITHERLINK (NP-complete)
