Can anyone provide me the implementation and tutorial on Aho Corasick algorithms and some problems containing aho corasick algorithm.
An algorithm to generate a random unsolved Sudoku whose only a unique solution exist.
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3390 |
| 6 | Um_nik | 3387 |
| 7 | tourist | 3384 |
| 8 | heuristica | 3322 |
| 9 | turmax | 3319 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 143 |
| 5 | AmShZ | 141 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | maroonrk | 134 |
| 9 | BledDest | 132 |
| 10 | qwexd | 129 |
Can anyone provide me the implementation and tutorial on Aho Corasick algorithms and some problems containing aho corasick algorithm.
An algorithm to generate a random unsolved Sudoku whose only a unique solution exist.
| Name |
|---|



Aho Corasic Problem:
LightOJ 1427 — Substring Frequency (II)
CodeChef Music & Lyrics
Ahmed Aly's Site contains more problems.
Aho Corasick .This link is from wikipedia. The explanation is not absolutely clear but using my code you will understand it. I have named my variables according to the wikipedia post, so you can swap between webpage and source code.Here is the code. I hope that this would be helpful
I don't think this could be so fast but it could make a random Sudoku in a few seconds. It's is very easy to solve a Sudoku by backtracing with little time. To generate a random unsolve Sudoku, firstly, create a finish state. Afterward, try to remove one cell in this state, then check the number of solotion (by backtracking). If this number = 0, you must undo your action, if this number >= 2, you could repeat this action.
Question 2
Your definition of "random" is underspecified. Uniformly random from all possible unique Sudoku puzzles? (This is insane and I doubt there is a better way than lookup of a gigantic table.) Simply generate a unique Sudoku puzzle that is sufficiently random? Just generate a valid Sudoku grid and remove a random square. Three squares, if you wish (this is the largest that can still ensure a unique solution).
Or you want to make a nice Sudoku puzzle that is human solvable? That is called intelligence and creativity. There's a reason why there are many popular pencil puzzle constructors (most notably Thomas Snyder for Sudoku perhaps?) whose puzzles are not boring/computer-generated.
Can you give a basic idea to generate human solvable puzzle using computer.
I have got the algorithm by ACRUSH to solve the problem, but i am unable to code it.
can anyone code it for mr ?