Sorting Networks

Sorting Networks
PDFs
Can't find a translation? Check our projects page for status.

To make computers go faster, it can be a lot more effective to have several slower computers working on a problem than a single fast one. This raises questions about how much of the computation can be done at the same time.

Here we use a fun team activity to demonstrate an approach to parallel sorting. It can be done on paper, but we like to get students to do it on a large scale, running from node to node in the network.

 
  • Cartoon
Videos 
Photos 
  • Photos from Computer Science camps for children aged 8-12, run by Mark Laprairie

    Photos from Computer Science camps for children aged 8-12, run by Mark Laprairie of the University of Regina.

  • Students in New Zealand run the sorting network outdoors.

    Students in New Zealand run the sorting network outdoors.

  • Sorting networks can also be set up as a board game if there's not enough space

    Sorting networks can also be set up as a board game if there's not enough space to run around.

  • Tim guides students in Sorting Networks activity, UOC, Christchurch, 17-18.04.20

    Tim guides students in Sorting Networks activity, UOC, Christchurch, 17-18.04.2008

  • Prof Wada with students, Informatics Education Symposium 2010, Osaka, Japan

    Prof Wada with students, Informatics Education Symposium 2010, Osaka, Japan

  • A 9 year old prepares the Sorting Network Activity with Michele Fini, Italy

    A 9 year old prepares the Sorting Network Activity with Michele Fini, Italy

  • Sorting Network Activity with 11 & 12 year olds, Michele Fini, Italy, 2010

    Sorting Network Activity with 11 & 12 year olds, Michele Fini, Italy, 2010

Extension 
  • National Center for Women & Information Technology (NCWIT) has a learning package called Unplugged in a Box which has detailed lesson plan of an activity called "Beat the Clock".

    Download the related video at Beat the Clock -- Sorting Networks

  • Mordechai (Moti) Ben-Ari from the Weizmann Institute of Science, Israel has programmed the Sorting Networks Unplugged activity in Scratch which can be downloaded in a zip file of the complete set of activities . Please read the ReadMe.txt for documentation.

  • The Greenroom resources area using the Greenfoot software has the sorting network solved you can download and use in the Greenfoot environment.
    If you are a teacher, you can apply easily to join and use the resources there.

  • As an extra challenge for the children, have them do the activity completely silently

  • Use words (compared using dictionary order) instead of numbers for sorting. This will generally slow the children down, especially if some words start with the same letters

  • This is a good exercise for thinking about permutations. For example, with 6 people entering the sorting network, there are 6x5x4x3x2x1=720 possible orders that they can start in, yet only one way that they will come out. When children are designing their own sorting networks, they should test them with all possibly input patterns. For example, to check a 3-input sorting network, there are 6 (3x2x1) possible input permutations, and for 4 inputs there are 24 (4x3x2x1) permutations, and for n inputs there are n! (factorial) permutations. These numbers get larger very rapidly

  • Jeff Gray from University of Alabama at Birmingham has the following suggestion as an extension to this activity using robotics.
    - Place the robots on an initial position in a sorting network.
    - Have each robot generate a random number
    - Have the robots do the pairwise comparison thorugh Bluetooth using unique identifiers of each robot
    - Coordination of “Traffic” will be needed so the robots can move across the network so that they do not bump into each other.

Other Resources 
Log In