Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Visualizing Algorithms (2014) (ocks.org)
294 points by mrv_asura on July 1, 2022 | hide | past | favorite | 27 comments



Can we add 2014 to the title?

For those unaware, Mike created https://observablehq.com/ and d3.js


The fact that this is 8 years old makes it even more impressive.


For sampling points on a plane (or other geometries), there is an even better algorithm:

http://extremelearning.com.au/unreasonable-effectiveness-of-...

(Yes, no https - I promise the visualizations are worth it!)


Speaking as a self-taught "programmer" who never got far beyond the rudiments (basic scripting and automation is about as far as I go), I find stuff like this utterly mindblowing. I'm aware that sorting and maze generation algorithms exist of course, but it's magic to me. I don't understand them at all, and seeing them visualised like this, in such an appealing way, is incredible.


For what is worth, programmers who went through college and/or university didn’t learn this stuff there, so technically speaking we are all self-taught.

Search about Depth-First Search and Breadth-First Search algorithms, they are very short and easy to understand.

You will be able to build and solve your own mazes in no time.


Wait, are you saying that computer scientists don't learn about spanning trees, DFS, BFS, or sorting at university?


It might be in their courses, but they doesn't mean they understood or retained it properly. Lots of programmers get by without ever reimplementing those in industry work


In fact implementing them for production should be a fire-able offense if they have not searched for a library that does it.

The only place in industry where this should be used is in interviews and candidates should never be asked to do it again if they pass that phase. We cannot have people working on stuff they interviewed with.


Is this sarcasm, or might you be interested in a rebuttal?


I assume they mean the methods and justifications behind the visualisations, since DFS etc. are absolutely taught everywhere.


Cramming the night before an exam isn't the same thing as learning. It doesn't change who you are and the way you see the world. It doesn't give you new abilities you can use for the rest of your life.


Cramming the night before an exam isn't the same thing as teaching either. If we need to accept that teaching is always the outcome of the worst performing learners it would follow that schools don't teach children to read. After all, illiterate people exist. That some teaching outcomes exist which are contrary to the curriculums goals doesn't mean that curriculums don't exist.

There are billions of us and learning outcomes are varied in part because teachers vary in skill. With so many chances and plenty of bad teachers, it is inevitable that some small fraction of the population gain the perception that trees aren't taught in CS programs even though they almost always are.


Nobody in this thread has claimed that trees (or sorting or maze generation algorithms, which don't necessarily involve trees) aren't taught. Guessmyname claimed that "programmers who went through college and/or university didn’t learn this stuff there," not that nobody tried to teach it to them. Every claim in the thread about what is taught has been a positive claim that some things were taught; there have been no negative claims claiming that something or other wasn't taught or wasn't in a curriculum.

Teachers can have a significant effect on the learning process, but learners have a much larger one. Other things like available learning resources and institutional incentives may have larger effects than teachers, curricula, or even (variation among) learners.


That's a fair point, and for many students true, but also not what I was claiming which is simply that these techniques are usually taught. If students fail to learn or have no interest or cram and forget, that's another problem.

That said, it's not like I was taught the specifics of generating mazes, even though there was additional content on it in the textbook etc. - I'm talking more about the general algorithms.


Maze generation is sometimes used in CS classes as an example of data structures like union-find or algorithms like minimum spanning tree construction; http://homepage.divms.uiowa.edu/~hzhang/c31/notes/ch07.pdf is one example. It wouldn't be terribly surprising for someone to get through an undergraduate CS curriculum without encountering maze generation, which is kind of a shame, and though hopefully they do encounter minimum spanning trees at least a few times, their application to maze generation may be nonobvious. And Mike has visualized a number of other maze generation algorithms here that are more specialized.

But I was saying that when guessmyname said, "programmers who went through college and/or university didn’t learn this stuff there," they're probably mostly correct, regardless of whether this stuff was taught, because most programmers who went through college and/or university were mostly focused on getting good grades, not learning, and you don't need to learn this stuff to get good grades. So your response that it was taught is not entirely to the point.


I don't think we really disagree all that much.


There is a how-reverse-image-search-works visualization. It explains how ivf_flat in faiss finds the approximate images in a huge amount of vectors. https://zilliz.com/blog/Visualize-Reverse-Image-Search-with-...


observablehq.com is awesome. We use it to build our feder example: https://observablehq.com/@min-tian/feder , If you want to understand vector embeddings, give it a try https://github.com/zilliztech/feder


I had a professor in college who made visualizations like this in PowerPoint, with each slide being a frame. He would then zoom through them and it would animate how various algorithms worked. Like this article, it was really amazing for understanding how they worked. I wish more courses offered visualizations like this, they make such a huge difference.


Interesting this came out just as I rejigged and updated a visualisation tool I made a decade ago (!) which shows sorting algorithms in a really pretty rainbow colour form. I think it gives a good insight into how these work.

https://ljs.io/rainbow/


Rock star level performance in visualization and developer experience


It gets more interesting the further you read! Superb work by the author.


It's beautiful but in my opinion a perfect example of why a table of contents or something similar (not remembering the internet equivalent term atm) is important.


Plugging in my tool where you can plug and vis your own sorting algorithm. https://xosh.org/VisualizingSorts/sorting.html


In an ideal world, this is how algorithms and datastructures are taught.

Beautiful work.


so cool




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: