The Art of Sorting

visualizing the process of sorting

2011

There are plenty sorting algorithms out there, and each fresh computer scientist has to learn and understand them. They are categorized by how fast they are, or how much memory they use. A sorting algorithm is a strategy to order a random or chaotic set of numbers. Most were invented between 1945 and 1964, in the very early days of computer science.

While a sorting algorithm itself is very technocentric, the possibilities are intriguing in relation to the process of sorting as a narrative. It contains the story of something in disorder becoming meaningful. Finding references in the chaos. Those who sort and organize might be able to guide others.

The process of sorting was investigated as an experiment with different forms of visuals. Each sorting algorithm reveals its particular strategy as a unique pattern. We took a row of pixels of a photograph and sorted the pixels by their color value. Since Processing’s color object is actually a number, they are perfect to be ordered. It worked well with grays, but revealed an unintuitive sorting of the colours. While they are ordered mathematically, one expects the gradients to be different.

In the next step each row of pixels from top to bottom was scanned and sorted in the image. This way a certain rythm of color hues, brightness and darkness is added to the sorting processes. Each animation has a duration if 720 frames, as 720 rows were sorted from top to bottom. The next step would be to think about how the image would look, to create a certain rythm, and finally a narrative.

bubble sort

heap sort

insertion sort

selection sort

shell sort

credits

Art Direction: Cedric Kiefer
Code: Christopher Warnow