A tile's joint completion with its later neighbours can be refused because of cells those neighbours got from tiles that are not the tile's own dependencies; jumping only through the tile's dependencies then loops until the backjump cap (seen at G=200: 2660 jumps to one tile). The conflict set is now the dependencies of the tile and of every later neighbour in the joint check, latest first.
- commit
- 883a08f0291da3fdb8f3fdbfe1893d5a86cc04f2
- parent
- 18c9c41662976513c4a62e2ef373c2513058def7
- author
- dami <gazey55@gmail.com>
| M | engine/ | 25 | +++++++++++++++++++++---- |
@@ -730,12 +730,29 @@ func (m *mosaic) fillSolution(ctx context.Context, tag string) error {
730730 return errors.New("too many backjumps")731731 }732732 g := m.geom[i]733- // dependencies from latest to earliest in the fill order; fixed733+ // the conflict set: every redrawable earlier tile that fixes a cell734+ // of this tile or of a later neighbour it was completed jointly735+ // with (the joint check is what refused), latest first; fixed734736 // context tiles cannot be redrawn737+ inConf := map[int]bool{}735738 var byRank []int736- for _, d := range g.deps {737- if !m.geom[d].fixed {738- byRank = append(byRank, d)739+ addDeps := func(t *tileGeom) {740+ for _, d := range t.deps {741+ if m.geom[d].rank < g.rank && !m.geom[d].fixed && !inConf[d] {742+ inConf[d] = true743+ byRank = append(byRank, d)744+ }745+ }746+ }747+ addDeps(g)748+ for _, o := range m.geom {749+ if o.rank > g.rank {750+ for _, d := range o.deps {751+ if d == i {752+ addDeps(o)753+ break754+ }755+ }739756 }740757 }741758 if len(byRank) == 0 {