Hacker Newsnew | past | comments | ask | show | jobs | submit | emerent's commentslogin

You're getting a lot of pushback in the comments here and I don't understand why. This is exactly right. Stay consistent with the existing way or commit to changing it all (not necessary all at once) so it's consistent again, but better.


Nobody is pushing back about "commit to changing all".

Nobody is denying that "inconsistent" can be bad on its own.

But you can't say that "inconsistent but good" is bad by providing an example of how "inconsistent and bad" is bad.


How is it a subset then if it has the @-prefix? Wait, does Rust's grammar still have the @ and ~ sigils from the pre 1.0 times for pointers?


It started off that way, but didn't (and won't) remain that way.

I'm using @ for intrinsics because that's how Zig does it and I like it for similar reasons to how Rust uses ! for macros.


There is a collection of benchmarks of the fastest sudoku solvers here: https://github.com/t-dillon/tdoku/tree/master/benchmarks

How fast they are depends on the difficulty of the sudoku and on your machine, but it's typically a few thousand/s on the hardest known and several 100k/s to a million/s on very easy.


I'm the author of Tdoku and maintainer of those benchmarks.

If anyone has a well optimized DLX implementation I'd love to add it to the comparison. The few I've sampled from github were not competitive, but I have no idea how much effort when into them.

This page from 2011 has some comparisons of backtracking and DLX solvers from that era, but it would be interesting to update: https://attractivechaos.wordpress.com/2011/06/19/an-incomple...


Seems pretty competitive to me if the third fastest in your benchmark uses dancing links.

I do think it's probably true that dancing links wont be literally the fastest, but the neat thing is that it's a generic algorithm that solves ALL total cover problems, not just Sudoku. Of course a tuned Sudoku solver could probably beat it (optimizing around the Sudoku-specific parts), but it's nice to see that it's at least in the running.


Bear in mind that JSolve was 5x faster than the fastest DLX solver in the attractivechaos 2011 benchmarks, and today there are several solvers that are 2x faster than JSolve (https://github.com/t-dillon/tdoku/tree/master/benchmarks). If the difference is really an order of magnitude, that's pretty non-competitive.

I certainly don't mean do disparage DLX. It's a powerful and general algorithm. But if you need a fast Sudoku solver (for puzzle mining or studying Sudoku research questions) then it's not the tool I'd reach for. The backtracking solvers just get a lot of mileage out of tuning their representation to play nicely with hardware. They also blow general purpose CDCL SAT solvers out of the water, at least for 9x9 Sudoku.


Thanks, it's nice to have something to point to about DLX, other than "mine was slow".


I see, do those solvers explore the entire solution space to also validate that a puzzle has exactly 1 solution?

That's one of the cool things about a dlx solver: it can do that while still being very fast.


All of them do.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: