The marking procedure optimistically assigns a new region number
that may have to be undone with a second traversal along the path
that creates a conflict.

Simplest case that has trouble for my algorithm

1 1 1  1
1 2 2  1
1 2 1  1
1 1 1  1

The outer loop is marked region 1:

1 1 1  1
1 2 2  1
1 2 1  1
1 1 1  1

Then the "2 loop"

1 1 1  1
1 2 2  1
1 2 1  1
1 1 1  1

But the left over 1 is assigned a  new region 3. The algorithm
goes right and wants to mark the pixel at [3,4] with 3.

1 1 1  1
1 2 2  1
1 2 3  1 <- collision!
1 1 1  1

There are two ways to resolve this

1) use the Davidoff method to begin with
or
2) During the traversal of what could be a new region
keep track of the beginning [r0, c0] (already done)
and, if there is a collision
  STORE
    (i) the collision coordinate [rx, cx]
    (ii) the region number R previously assigned to the collision
coordinate [rx, cx]
  MARK
     the path from  [r0, c0] to [rx, cx] with region number R
 RESET
     the next region number S to S-1
     remove the polygon database record for region S
 exit from the traversal