Earlier quoted context omitted.
Link?
https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exc...
Ask HN: What's your favorite elegant/beautiful algorithm?
131–140 of 507 posts
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#132Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#133Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#134https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dither...
It can simulate color transitions with fewer colours by using a simple error diffusion algorithm.
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#135Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#136It would be hard to beat Floyd–Warshall algorithm. Think about the problem of finding shortest paths between all pairs of nodes in graph. Sounds trivial? Would you believe if someone told you it can be done in literally 5 lines of code? When I saw that for the first time I was in the disbelief. The elegance comes from these fact, - Very non-trivial problem - Just 5 lines of code - Probably the most language agnostic…
Are you sure about this point? I'd like to see a purely functional implementation of this, e.g. in Haskell without monoids. I believe it's significantly harder than a C implementation (which is indeed a few lines)
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#137K - means clustering, which I learned about recently. For non-machine learning folks, this algorithms helps in grouping relevant items together. As a practical, using this algorithm you can segment your customers based on their purchase history and interests. The actual algorithm is very simple, imagine a lot of points on the 2D plane and each of them represent customers, whom you want to segment/cluster. Now, chose…
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#138Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#139Minimax search https://www.cs.cornell.edu/courses/cs312/2002sp/lectures/rec... How knew that a couple of line of code could be used cause so many interesting behaviors like cooperation, betrayal etc.
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#140Been learning about Hashlife[0] the last few days. It's pretty cool. [0] http://www.drdobbs.com/jvm/an-algorithm-for-compressing-spac...