Random Solutions are Often Good Enough
sultanik.com
sultanik.com
This same principle can be applied in other contexts [2] - e.g. Johnson-Lindestrauss is essentially a statement that random projections are "often" nearly isometries.
[1]: http://terrytao.wordpress.com/2010/01/03/254a-notes-1-concen...
The fact that they approach optimality is gravy.
It was trivial to add, and it was faster than all the extra checks I'd have to do for the edge cases. Also, it gave me peace of mind, since I knew it worked in theory, instead of my other feeble attempts which worked most of the time, but always failed in some new edge case.
Of course, this solver is for the standard Sudoku game on a 9 x 9 grid. Perhaps the claim in the article refers to "Sudoku" in the sense of the generalized problem of solving n x n Sudoku, for any n?
You could argue that, if we consider "Sudoku" to be the instance of the puzzle where n=9, then the puzzle isn't NP-hard because it has the constant-time solution of trying all 6.67e21 solutions, but the result is so uninteresting that it's understood that the author means the more general problem.
9x9 Sudoku has a constant size, which means that it can be evaluated in O(1) time, if such notation makes sense.
Also, if you've never run across Dancing Links[1], do yourself a favor and go take a look. It's a method (by Knuth) for implementing an algorithm (ditto) for generally solving any exact-cover problem (including Sudoku of course). Basically it amounts to constructing a matrix that encompasses all of the game's constraints and possible inputs, after which all solutions can be found through mechanical operations on the matrix. It's both beautiful and very fun to implement.
[0] http://en.wikipedia.org/wiki/Exact_cover [1] http://en.wikipedia.org/wiki/Dancing_Links
15. Robert Tarjan, Princeton: What do you see as the most promising directions for future work in algorithm design and analysis? What interesting and important open problems do you see?
Don Knuth: My current draft about satisfiability already mentions 25 research problems, most of which are not yet well known to the theory community. Hence many of them might well be answered before Volume 4B is ready. Open problems pop up everywhere and often. But your question is, of course, really intended to be much more general.
In general I'm looking for more focus on algorithms that work fast with respect to problems whose size, n, is feasible. Most of today's literature is devoted to algorithms that are asymptotically great, but they are helpful only when n exceeds the size of the universe.
In one sense such literature makes my life easier, because I don't have to discuss those methods in TAOCP. I'm emphatically not against pure research, which significantly sharpens our abilities to deal with practical problems and which is interesting in its own right. So I sometimes play asymptotic games. But I sure wouldn't mind seeing a lot more algorithms that I could also use.
For instance, I've been reading about algorithms that decide whether or not a given graph G belongs to a certain class. Is G, say, chordal? You and others discovered some great algorithms for the chordality and minimum fillin problems, early on, and an enormous number of extremely ingenious procedures have subsequently been developed for characterizing the graphs of other classes. But I've been surprised to discover that very few of these newer algorithms have actually been implemented. They exist only on paper, and often with details only sketched.
Two years ago I needed an algorithm to decide whether G is a so-called comparability graph, and was disappointed by what had been published. I believe that all of the supposedly "most efficient" algorithms for that problem are too complicated to be trustworthy, even if I had a year to implement one of them.
Thus I think the present state of research in algorithm design misunderstands the true nature of efficiency. The literature exhibits a dangerous trend in contemporary views of what deserves to be published.
Another issue, when we come down to earth, is the efficiency of algorithms on real computers. As part of the Stanford GraphBase project I implemented four algorithms to compute minimum spanning trees of graphs, one of which was the very pretty method that you developed with Cheriton and Karp. Although I was expecting your method to be the winner, because it examines much of the data only half as often as the others, it actually came out two to three times worse than Kruskal's venerable method. Part of the reason was poor cache interaction, but the main cause was a large constant factor hidden by O notation.
I'm not a CS guy so reading this article made me feel a bit better, especially since it mentions sudoku.
Whether they're "hard enough to solve", though....
And then add the screening for difficulty levels.
*Not an exact figure =)
Ah, I see what you mean, you're not talking about generating the intended solution, you're talking about which cells TO BLANK before giving it to the user.
"So the moral of the story is: Sometimes quickly and mindlessly choosing a random solution isn't half bad!"
Marco points out in latest ATP how he randomizes the lists of podcasts every time the list is shown. Neat!