Lurker News

Comments (491) 209 threads

Earlier comments
otikik2 replies#
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.

Also, it has a great website dedicated to it, with lots of interactive demos:
http://theory.stanford.edu/~amitp/GameProgramming/

yellowflash#
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.

quickthrower2#
Yes and alpha beta pruning. Your link mentions that.
carapace1 reply#
Dancing Links (Knuth's paper: https://arxiv.org/pdf/cs/0011047.pdf )

> 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.

Zrdr#
+1 Dancing Link. Donald Knuth rules !
anxtyinmgmt#
Shor's Algorithm blew my mind after getting the slightest grasp of it thanks to Scott Aaronson: https://www.scottaaronson.com/blog/?p=208

The LLL lattice basis reduction algorithm and the Coppersmith method are also jaw-dropping

Load more comments