I have developed an efficient algorithm for enumerating the non-trivial templates that match a given LS. For example, for the Latin Square in the image below, these are just 3 of the 360 candidates:
By "non-trivial", I mean that the templates all have these (generally desirable) properties:
- contiguous regions
- no whole-row or whole-column regions
- no horizontal or vertical partitions