I like the A* pathfinding algorithm. It's not particularly elegant or beautiful on itself, and it's very dependant on the heuristics applied & the topology of the terrain used. Yet the results tend to be quite pleasing to watch.
Actually it's pretty elegant by itself, Consider this all traversals are same,
val someDS; while(!someDS.isEmpty()){
addChildren(someDS.pop())
}
Now replace, someDs with Queue -> BFS Stack -> DFS Priority Queue, with priority of distance so far -> Dijkstra. Priority Queue, with distance + heuristic -> A* Its beautiful.
> In computer science, dancing links is the technique suggested by Donald Knuth to efficiently implement his Algorithm X. Algorithm X is a recursive, nondeterministic, depth-first, backtracking algorithm that finds all solutions to the exact cover problem. Some of the better-known exact cover problems include tiling, the n queens problem, and Sudoku. ~ https://en.wikipedia.org/wiki/Dancing_Links Also SEQUITUR http://www.sequitur.info/ > Sequitur (or Nevill-Manning algorithm) is a recursive algorithm developed by Craig Nevill-Manning and Ian H. Witten in 1997[1] that infers a hierarchical structure (context-free grammar) from a sequence of discrete symbols. The algorithm operates in linear space and time. It can be used in data compression software applications. ~ https://en.wikipedia.org/wiki/Sequitur_algorithm Part of the reason I like these both is that they each require sharp pointer manipulation to work efficiently. I'm a functional programming fan, these beautiful and useful algorithms remind me that purity isn't everything, eh? Also, it's fun to think about how you might get FP code to emit correct pointer-munging code for them.
Comments (491) 209 threads
Earlier commentsAlso, it has a great website dedicated to it, with lots of interactive demos:
http://theory.stanford.edu/~amitp/GameProgramming/
val someDS;
}while(!someDS.isEmpty()){
Now replace, someDs with
Queue -> BFS
Stack -> DFS
Priority Queue, with priority of distance so far -> Dijkstra.
Priority Queue, with distance + heuristic -> A*
Its beautiful.
https://en.wikipedia.org/wiki/Shakey_the_robot
> In computer science, dancing links is the technique suggested by Donald Knuth to efficiently implement his Algorithm X. Algorithm X is a recursive, nondeterministic, depth-first, backtracking algorithm that finds all solutions to the exact cover problem. Some of the better-known exact cover problems include tiling, the n queens problem, and Sudoku.
~ https://en.wikipedia.org/wiki/Dancing_Links
Also SEQUITUR http://www.sequitur.info/
> Sequitur (or Nevill-Manning algorithm) is a recursive algorithm developed by Craig Nevill-Manning and Ian H. Witten in 1997[1] that infers a hierarchical structure (context-free grammar) from a sequence of discrete symbols. The algorithm operates in linear space and time. It can be used in data compression software applications.
~ https://en.wikipedia.org/wiki/Sequitur_algorithm
Part of the reason I like these both is that they each require sharp pointer manipulation to work efficiently.
I'm a functional programming fan, these beautiful and useful algorithms remind me that purity isn't everything, eh? Also, it's fun to think about how you might get FP code to emit correct pointer-munging code for them.
The LLL lattice basis reduction algorithm and the Coppersmith method are also jaw-dropping
All comments shown.
Couldn't load more comments. Check your connection and try again.