Beruflich Dokumente
Kultur Dokumente
Outline
Divide and Conquer Algorithms
Binary Tree Traversal
Divide/Conquer
Patrick
Removing Node(s)
Divide and
Conquer
Multiplication
Closest Pair & Quickhull
Branch & Bound
Dynamic Programming
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Outline
Divide and Conquer Algorithms
Binary Tree Traversal
Multiplication
Closest Pair & Quickhull
Branch & Bound
Dynamic Programming
Divide/Conquer
Patrick
3
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
General Procedure
Divide/Conquer
Patrick
4
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Branch/Bound
2. Solve Subproblems
Fast Concurrent
Object Localization
and Recognition
3. Combine Subsolutions
Dynamic
Programming
29
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Merge Sort
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Quicksort
Dynamic
Programming
29
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Preorder Traversal
Divide/Conquer
Patrick
Divide and
Conquer
7
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Inorder Traversal
Divide/Conquer
Patrick
Divide and
Conquer
8
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Postorder Traversal
Divide/Conquer
Patrick
Divide and
Conquer
9
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Divide and
Conquer
10
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Multiplication
Divide/Conquer
Patrick
Divide and
Conquer
11
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Multiplication
Clicker Question: How many multiplications are needed to multiply two 300-digit long numbers?
Divide/Conquer
Patrick
Divide and
Conquer
12
9972
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
= 994, 009?
Dynamic
Programming
D Other?
29
Karatsubas Method
Two-Digit Integers a1 a0 and b1 b0
ab
(a1 + a0 ) (b1 + b0 )
a1 b0 + a0 b1
ab
= (a1 10 + a0 ) (b1 10 + b0 )
= a1 b1 102 + (a1 b0 + a0 b1 ) 10 + a0 b0
= a1 b1 + (a1 b0 + a0 b1 ) + a0 b0
= (a1 + a0 ) (b1 + b0 ) a1 b1 a0 b0
= a1 b1 102 + ((a1 + a0 ) (b1 + b0 ) a1 b1 a0 b0 ) 10 + a0 b0
Complexity of Multiplication
Divide/Conquer
Regular Method
T (n) =4T n2 +O (n)
n2
Patrick
Katsuba Method
T (n) =3T n2 +O (n)
n1.59
Divide and
Conquer
14
Branch/Bound
5
x 10
Fast Concurrent
Object Localization
and Recognition
10
1.59
n2
Dynamic
Programming
8
7
6
5
4
3
2
1
0
0
100
200
300
400
500
600
700
800
900
1000
29
Multiplication
Clicker Question: How many multiplications are needed to multiply two 300-digit long numbers?
Divide/Conquer
Patrick
Divide and
Conquer
15
B 10300 2997 ?
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
D Other?
Dynamic
Programming
3001.59 8, 682
< 10% of 3002
29
Closest Pair
Divide/Conquer
Patrick
Divide and
Conquer
16
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Quickhull
Divide/Conquer
Patrick
Divide and
Conquer
17
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Outline
Divide and Conquer Algorithms
Binary Tree Traversal
Multiplication
Closest Pair & Quickhull
Branch & Bound
Dynamic Programming
Divide/Conquer
Patrick
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
18
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Divide & Conquer algorithms leave you with a subproblems, each of size b
19
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Work on the subproblem that is most likely to contain the solution (or the
best solution)
Leave less promising subproblems for later
20
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
Ignore a subproblem if its best possible solution is worse than the current
best solution
Dynamic
Programming
Whats promising?
. . . That depends on the problem . . .
29
Branch/Bound
21
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Branch/Bound
22
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
The
The
The
The
The
x coordinate of
x coordinate of
y coordinate of
y coordinate of
objects class
its
its
its
its
left-most point
right-most point
top-most point
bottom-most point
Branch/Bound
23
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Branch/Bound
24
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
If none of the boxes that you still have to look at could be as good as your
current, best result, youre done
Branch/Bound
25
Remove the best result and rerun the algorithm to find the second, third,
. . . , nth best result
Fast Concurrent
Object Localization
and Recognition
Dynamic
Programming
29
Outline
Divide and Conquer Algorithms
Binary Tree Traversal
Multiplication
Closest Pair & Quickhull
Branch & Bound
Dynamic Programming
Divide/Conquer
Patrick
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
26
29
Dynamic
Programming
Dynamic Programming
Divide/Conquer
Patrick
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Divide & Conquer algorithms leave you with a distinct subproblems, each
of size b
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
27
29
Dynamic
Programming
External References I
Divide/Conquer
Patrick
Divide and
Conquer
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
28
29
Dynamic
Programming
Any Questions?
Divide/Conquer
Patrick
Divide and
Conquer
Binary Tree Traversal
Removing Node(s)
Multiplication
Closest Pair &
Quickhull
Branch/Bound
Fast Concurrent
Object Localization
and Recognition
29
29
Dynamic
Programming