Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Tilman authored and Michel Tilman committed Jun 29, 2019
1 parent a636e6a commit 8c962f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The *ClassyDancingLinks* algorithm also uses classes to represent the nodes of t

The *StructuredDancingLinks* algorithm is struct-based, and, sort of implements its own memory management. A *node store* manages the links between the struct nodes (links are just indices in the node store array). This algorithm also foregoes simple iterator abstractions to loop over the doubly-linked lists. This algorithm is significantly faster than *ClassyDancingLinks*, requiring about 1.2 ms to find the evil sudoku solution. (An experimental non-recursive implementation of this algorithm reduces the required time even further to about 1 ms or less.)

Both benchmarks measure the performance of the respective algorithms to find the solution for the evil sudoku. Each solution is tested for *correctness*: does the solution comply with the rules of a valid sudoku? This validation is taken care of by the sudoku initializer. Whether the solution is also *complete* (i.e. have all empty cells in the sudoku been assigned a number), is not handled by default. When we add this completeness test to the benchmarks, the results of both algorithm change spectacularly (for reasons as yet unclear). Perfomance of the class-based implementation. drops to about 10 ms, whereas the struct-based implementation suddenly requires 35 ms.
Both benchmarks measure the performance of the respective algorithms to find the solution for the evil sudoku. Each solution is tested for *correctness*: does the solution comply with the rules of a valid sudoku? This validation is taken care of by the sudoku initializer. Whether the solution is also *complete* (i.e. have all empty cells in the sudoku been assigned a number), is not handled by default. When we add this completeness test to the benchmarks, the results of both algorithm change spectacularly (for reasons as yet unclear). Perfomance of the class-based implementation drops to about 10 ms, whereas the struct-based implementation suddenly requires 35 ms.

Implementing a version of the algorithm in Swift that approximates the performance of the Scala solution clearly turned out to be less straightforward than expected.

Expand Down

0 comments on commit 8c962f9

Please # to comment.