Lecture 5 Sorting Networks - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Lecture 5 Sorting Networks

Description:

A sorting network is a comparison network which output ... 3-stage Clos Network. 1. m. n. n. n. n. Rearrangeability. Theorem. Network with 2x2 crossbars ... – PowerPoint PPT presentation

Number of Views:234
Avg rating:3.0/5.0
Slides: 43
Provided by: ding8
Category:

less

Transcript and Presenter's Notes

Title: Lecture 5 Sorting Networks


1
Lecture 5Sorting Networks
2
Comparator
comparator
3
A Sorting Network
2
2
9
5
6
5
9
5
2
5
6
2
6
9
6
9
A sorting network is a comparison network which
output monotone nondecreasing sequence for every
input.
4
Depth
2
2
9
5
6
5
9
5
2
5
6
2
6
9
6
9
Depth is the maximum number of comparators on
a path from an input wire to an output wire.
5
Depth parallel time
2
2
9
5
6
5
9
5
2
5
6
2
6
9
6
9
Depth is the maximum number of comparators on
a path from an input wire to an output wire.
6
Insertion Sort
7
key
8
Sorting network constructed from insertion sort.
9
How to construct a sortingnetwork from merging
sort?
10
Divide and Conquer
  • Divide the problem into subproblems.
  • Conquer the subproblems by solving them
    recursively.
  • Combine the solutions to subproblems into the
    solution for original problem.

11
Merge Sort
12
Procedure
13
Structure
Sorting network
Merging network
Sorting network
14
Construction of Merging Network
  • 0-1 principal.
  • Bitonic sorter.
  • Merging network.

15
0-1 principal
16
Lemma
17
Proof of 0-1 Principal
18
Bitonic Sequence
19
Bitonic 0-1 Sequence
20
Some Properties
21
The half-cleaner
0
0
0
0
bitonic clean
0
1
1
0
bitonic
1
1
0
0
bitonic
1
0
0
1
22
The half-cleaner
0
0
0
0
bitonic clean
1
1
1
0
bitonic
1
1
1
1
bitonic
1
1
0
1
23
Lemma
  • One of two halfs is bitonic clean.
  • every number in the 1st half any element in
    the 2nd half.

24
Proof (case 1)
0
0
1
0
1
1
0
0
0
25
Proof (case 2)
0
0
1
0
1
0
0
1
0
26
Proof (case 3)
0
0
1
0
1
1
1
0
0
0
1
27
Proof (case 4)
0
0
1
1
1
0
0
1
1
0
0
28
Proof (case 5)
1
1
0
0
1
1
1
1
0
1
1
29
Proof (case 6)
1
1
0
1
1
1
0
1
1
0
1
30
Proof (case 7)
1
0
1
1
0
0
1
1
0
0
1
31
Proof (case 8)
1
0
1
0
1
0
1
0
0
1
1
32
bitonic
sorted
Half cleaners
33
0
0
0
0
sorted
0
0
1
0
sorted
0
0
0
1
sorted
1
1
1
1
Half cleaners
Merging Network
34
Structure
Sorting network
Merging network
Sorting network
35
Sorting Network
Merging Networks
36
What we learnt in this lecture?
  • What is sorting network?
  • Depth parallel time.
  • Sorting network from Merge sort.

37
Permutation Network
  • Switching network
  • Rearrangeability
  • Nework with 2x2 crossbars

38
Crossbar Switch
A crossbar switch can realize any matching
between Inputs and outputs.
39
3-stage Clos Network
1
n
n
n
n
m
40
Rearrangeability
Theorem
41
Network with 2x2 crossbars
42
Puzzle
Write a Comment
User Comments (0)
About PowerShow.com