Hacker News new | comments | show | ask | jobs | submit login
Visualizing sorting algorithms with Hilbert curve (corte.si)
65 points by simonb on Jan 26, 2010 | hide | past | web | favorite | 6 comments

What's the reasoning for not just using points from a continuous spectrum? His approach tries to both make adjacent colors distinct while also making them blend well with nearby colors, which he admits are contradictory goals.

The reason is one wouldn't be able to distinguish, at least as easily as in his visualizations, single data points.

It's a clever way to automatically create visual classifications of random-sized collections of data points. The goals are not contradictory, they just constraint each other.

I understand that it helps separate colours from their neighbours, but I don't understand why that helps this particular visualisation. Particularly if there's no obvious way to determine at a glance whether the colour is 'higher' or 'lower' than the one next to it.

For the sorting diagrams these colours start out random and end up sorted, in neither case, nor in the transition period in-between, do I see an obvious benefit to this method of choosing colors.

Hey, as I say in the post - I make no claims whatsoever for the visualisations. They were strictly for fun, and I'm a bit surprised to find them on HN. However... choosing colours along the Hilbert traversal of the RGB cube is good if you want a sequence of many colours that are maximally distinct, where similar colours (here "similarity" is their distance from each other in the RGB cube) are as close as possible to each other in the sequence. In fact, the Hilbert curve's properties guarantee that this sequence will be near optimal - we don't know how to do better without restricting ourselves to some subset of the RGB cube.

That's cool. I'm interested, but totally unschooled, when it comes to visualisation stuff so I just thought I was missing something that would be obvious to others.

I'm now wondering if this could be applied to choosing colours for auto-generated pie charts, bar charts or map keys and similar.

Upvoted for "Mallory-Chicken Impetus."

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