michaelhodel / arc-dsl

Domain Specific Language for the Abstraction and Reasoning Corpus
MIT License
184 stars 38 forks source link

Fix solve 4290ef0e #11

Closed AmziJeffs closed 6 days ago

AmziJeffs commented 1 week ago

The current solver fails on the test example. The error is due to a heuristic for ordering of the reticules, which results in a tie on the largest two reticules.

The fix uses a more precise heuristic, that accounts for the minimum manhattan distance between pieces of the reticules, i.e. the "gap" between corners of the reticules. This requires eight extra lines, partly because of the annoyance of dealing with the edge case where a reticule is 1x1 or 3x3 (and consists of exactly one connected piece, making the manhattan computation awkward).