Unformatted text preview: mparator, all inputs to the ´Õ · µ Ø
comparators are consistent with those of the original network. This fact is apparent in the construction.
As for running time, we iterate over all Ö comparators, and at each comparator we consider all the following comparators. Thus, we have a running time of ¢´Ö ¾ µ.
(c) Prove or give a counterexample: For any standard sorting network, if a comparator ´
added anywhere in the network, the network continues to sort.
Solution: Simple counterexamples exist. µ, where , is Handout 14: Solution Set 6 2 Problem 6-2. A comparison network is a transposition network if each comparator connects adjacent lines. Intuitively, a transposition network represents the action over time of a linear systolic array making oblivious comparison
exchanges between adjacent array elements.
(a) Show that if a transposition network with Ò inputs actually sorts, then it has ª´Ò ¾ µ comparators.
Solution: For simplicity, let’s consider an even Ò. If the network actually sorts, then it must sort the
Ò ½ ¼ ½
Ò ¾ ½ . Each input has to be moved across exactly Ò ¾ lines.
input Ò ¾ Ò ¾ · ½
In a transposition network, each comparator moves two inputs by exactly ½ line. Thus, each input must be
involved in Ò ¾ comparators. Since there are Ò inputs, and each comparator can only move two inputs,
ª´Ò¾ µ comparators. The same argument works for odd Ò.
we need at least Ò¾
(b) Prove that a transposition network with Ò inputs is a sorting network if and only if it sorts the sequence
Ò Ò ½
View Full Document
- Spring '07
- Graph Theory, Shortest path problem, µ, Comparator, comparators