[Community Puzzle] Constrained Latin Squares

Thanks for investigating :slight_smile:
I could try to optimize things more, but when I have a response time under 1s in local, it is hard to be motivated by that.

Do you have an idea of how I can reach CG team to talk about Dart in the platform ?
I already posted on the forum that it needed an update of SDK, but there was no reaction from the team… And I’d like to discuss the compilation target and all with them, to understand what’s under the hood.

That’s understandable. With local response times under 1s, I can imagine how hard it is to stay motivated to optimise further when the slowdown seems platform-specific.

As for reaching the team, Discord might be a better route. They’ve mentioned that they’ll be focusing more on site development later this year, so there’s a better chance your suggestions will be seen and responded to.

I’d suggest posting in either the #feature-request or #bug-report channels. These channels should get more attention than other channels (and the forum) for this kind of issue.

I don’t code in Dart but I ported my python code to Dart and passed all validators. Though I did see timeouts and time fluctuations with cases 9x9 so you have a valid point here. There could be a problem with the server load, I’m just guessing.

Just to let you know that there are at least 2 published solutions in Dart besides mine. I would suggest using mutable globals and update before, make your recursive call, and finally reset after instead of creating new objects. The most important thing though is to choose the next empty cell based on a heuristic. What would you consider to be the next cell to try?

And one more thing just to clear things out in my previous comment I wasn’t suggesting using algorithm X nor dancing links like people mentioned above. Obviously you don’t need such complicated algorithms, actually I shouldn’t say complicated because I’ve never used algorithm X nor dancing links, I don’t even know what they do.

Thanks for your help !
I certainly could manage it with my own dedicated code, but I arrived here on this puzzle because I am following AlgorithmX playground and practicing/tweaking my DLX Solver.

The ā€œnext cell to tryā€ is implicit by sorting in the Requirement columns by number of actions fullfilling that requirement, ā€œfilling a cellā€ is indeed the only action I modeled here.
Saying the same thing differently, my DlxSolver always try first the columns that have the most constraints on them (aka the less possible values).

No problem, I don’t know the details of DLX but the logic sounds very similar to what I’ve done but I also presorted both cols and rows to speed up. I also applied a combined heuristic/constraint on both cols and rows and I think that made the difference on speed.

Dart was updated !

This solve my issue, 9x9 Hard is now answered in 1653 ms (not as good as locally, but quite acceptable :slight_smile: )

2 Likes