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 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | heuristica | 3322 |
| 10 | maroonrk | 3312 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 144 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 136 |
| 8 | BledDest | 133 |
| 9 | maroonrk | 132 |
| 10 | Proof_by_QED | 131 |
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 ?