SlideShare a Scribd company logo
1 of 14
Closest Pair Problem
Divide and Conquer
Closest-Pair Problem by Divide-and-Conquer
Step 0 Sort the points by x co-ordinate (list one) and then by y co-
ordinate (list two).
Step 1 Divide the points given into two subsets S1 and S2 by a
vertical line, x = m, through the median m of their x coordinates
so that half the points lie to the left or on the line and half the
points lie to the right or on the line.
Step 2 Find recursively the closest pairs for the left and right
subsets.
Closest Pair by Divide-and-Conquer (cont.)
Step 3 Set d = min{d1, d2}. d is not necessarily the smallest distance
between all the point pairs because points of a closer pair can lie on
the opposite sides of the separating line. While combining the
solutions such points need to be examined.
Points in the symmetric vertical strip of width 2d will be possible
closest pair.
Let C1 and C2 be the subsets of points in the left subset S1 and of the
right subset S2, respectively, that lie in this vertical strip. The points in
C1 and C2 are stored in increasing order of their y coordinates, taken
from the second list.
Step 4 For every point P(x,y) in C1, we inspect points in C2 that may be
closer to P than d. There can be no more than 6 such points
(because d ≤ d2)!
Closest Pair by Divide-and-Conquer: Worst Case
Efficiency of the Closest-Pair Algorithm
Running time of the algorithm (without sorting) is:
T(n) = 2T(n/2) + M(n), where M(n)  Θ(n)
By the Master Theorem (with a = 2, b = 2, d = 1)
T(n)  Θ(n log n)
So the total time is Θ(n log n).
Quickhull Algorithm
Convex hull: smallest convex set that includes given points.
• Quick hull algorithm uses divide and conquer technique.
• Initially points are sorted by x-coordinate values with ties
resolved by y coordinates.
• Identify extreme points P1 and Pn (leftmost and rightmost).
Quickhull Algorithm
• Compute upper hull recursively:
• find point Pmax that is farthest away from line P1Pn
• compute the upper hull of the points to the left of line
P1Pmax
• compute the upper hull of the points to the left of line
PmaxPn
• Compute lower hull in a similar manner
P1
Pn
Pmax
Idea of Quick hull
Quick hull
If q1(x1, y1), q2(x2, y2), and q3(x3, y3) are three arbitrary points in the
Cartesian plane, then the area of the triangle q1q2q3 is equal to one-half of the
magnitude of the determinant
the sign of this expression is positive if and only if the point q3 = (x3, y3) is to the left of the line q1q2.
Efficiency of Quickhull Algorithm
Time Complexity:
• Finding point farthest away from line P1Pn can be
done in linear time and merging of the left and the
right convex hulls take O(n) time and as we are
dividing the points into two equal parts,
T(n) = 2T(n/2) + O(n)
• so the time complexity of the above algorithm is
O(n * log n).
• Time efficiency:
• worst case: O(n2)
T(n) = T(n-1) + O(n)
LU-17 Closest pair and convex hull using divide and conquer.pptx

More Related Content

What's hot

Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sortMadhu Bala
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound techniqueishmecse13
 
Dynamic Programming-Knapsack Problem
Dynamic Programming-Knapsack ProblemDynamic Programming-Knapsack Problem
Dynamic Programming-Knapsack ProblemAmrita Yadav
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1Amrinder Arora
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquerKrish_ver2
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Ziyauddin Shaik
 
Knapsack problem using greedy approach
Knapsack problem using greedy approachKnapsack problem using greedy approach
Knapsack problem using greedy approachpadmeshagrekar
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplicationMegha V
 
data structures- back tracking
data structures- back trackingdata structures- back tracking
data structures- back trackingAbinaya B
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsKrishnan MuthuManickam
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmsRajendran
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search TechniquesJismy .K.Jose
 

What's hot (20)

Lower bound
Lower boundLower bound
Lower bound
 
Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sort
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound technique
 
Dynamic Programming-Knapsack Problem
Dynamic Programming-Knapsack ProblemDynamic Programming-Knapsack Problem
Dynamic Programming-Knapsack Problem
 
5.1 greedy
5.1 greedy5.1 greedy
5.1 greedy
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
Strassen.ppt
Strassen.pptStrassen.ppt
Strassen.ppt
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems
 
Knapsack problem using greedy approach
Knapsack problem using greedy approachKnapsack problem using greedy approach
Knapsack problem using greedy approach
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
 
P versus NP
P versus NPP versus NP
P versus NP
 
data structures- back tracking
data structures- back trackingdata structures- back tracking
data structures- back tracking
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 

Similar to LU-17 Closest pair and convex hull using divide and conquer.pptx

Closest pair problems (Divide and Conquer)
Closest pair problems (Divide and Conquer)Closest pair problems (Divide and Conquer)
Closest pair problems (Divide and Conquer)Gem WeBlog
 
Geometry (Grid & section formula)
Geometry (Grid & section formula)Geometry (Grid & section formula)
Geometry (Grid & section formula)itutor
 
ClosestPair_Kleinberg_and_Tardos.pptx_enjoy
ClosestPair_Kleinberg_and_Tardos.pptx_enjoyClosestPair_Kleinberg_and_Tardos.pptx_enjoy
ClosestPair_Kleinberg_and_Tardos.pptx_enjoymixlhs
 
Math vocabulary A-Z
Math vocabulary A-ZMath vocabulary A-Z
Math vocabulary A-Zfgeasland
 
Section 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneSection 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneRob Poodiack
 
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksJinTaek Seo
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsAmrinder Arora
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_spaceMahbub Alwathoni
 
Lesson 14 b - parametric-1
Lesson 14 b - parametric-1Lesson 14 b - parametric-1
Lesson 14 b - parametric-1Jean Leano
 
Class 10 mathematics compendium
Class 10 mathematics compendiumClass 10 mathematics compendium
Class 10 mathematics compendiumAPEX INSTITUTE
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 

Similar to LU-17 Closest pair and convex hull using divide and conquer.pptx (20)

Closest pair problems (Divide and Conquer)
Closest pair problems (Divide and Conquer)Closest pair problems (Divide and Conquer)
Closest pair problems (Divide and Conquer)
 
Geometry (Grid & section formula)
Geometry (Grid & section formula)Geometry (Grid & section formula)
Geometry (Grid & section formula)
 
R lecture co2_math 21-1
R lecture co2_math 21-1R lecture co2_math 21-1
R lecture co2_math 21-1
 
Brute force
Brute forceBrute force
Brute force
 
Co-ordinate Geometry.pptx
Co-ordinate Geometry.pptxCo-ordinate Geometry.pptx
Co-ordinate Geometry.pptx
 
Math project
Math projectMath project
Math project
 
ClosestPair_Kleinberg_and_Tardos.pptx_enjoy
ClosestPair_Kleinberg_and_Tardos.pptx_enjoyClosestPair_Kleinberg_and_Tardos.pptx_enjoy
ClosestPair_Kleinberg_and_Tardos.pptx_enjoy
 
Math vocabulary A-Z
Math vocabulary A-ZMath vocabulary A-Z
Math vocabulary A-Z
 
Section 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneSection 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate Plane
 
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Planos numericos
Planos numericosPlanos numericos
Planos numericos
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
 
D4 trigonometrypdf
D4 trigonometrypdfD4 trigonometrypdf
D4 trigonometrypdf
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_space
 
Aieee mathematics- 2010
Aieee mathematics- 2010Aieee mathematics- 2010
Aieee mathematics- 2010
 
Lesson 14 b - parametric-1
Lesson 14 b - parametric-1Lesson 14 b - parametric-1
Lesson 14 b - parametric-1
 
Class 10 mathematics compendium
Class 10 mathematics compendiumClass 10 mathematics compendium
Class 10 mathematics compendium
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
Dda algo notes
Dda algo notesDda algo notes
Dda algo notes
 

Recently uploaded

Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...amitlee9823
 
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...amitlee9823
 
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen DatingDubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Datingkojalkojal131
 
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...sonalitrivedi431
 
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Pooja Nehwal
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...poojakaurpk09
 
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfMiletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfGabrielaMiletti
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)Soham Mondal
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Kokokojalkojal131
 
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...ZurliaSoop
 
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...Call Girls in Nagpur High Profile
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Rearing technique of lac insect and their management
Rearing technique of lac insect and their managementRearing technique of lac insect and their management
Rearing technique of lac insect and their managementSaurabhTiwari264113
 
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 

Recently uploaded (20)

Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...
Vip Mumbai Call Girls Ghatkopar Call On 9920725232 With Body to body massage ...
 
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen DatingDubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
Dubai Call Girls Starlet O525547819 Call Girls Dubai Showen Dating
 
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
 
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
 
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfMiletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
 
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Brigade Road Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Rearing technique of lac insect and their management
Rearing technique of lac insect and their managementRearing technique of lac insect and their management
Rearing technique of lac insect and their management
 
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 

LU-17 Closest pair and convex hull using divide and conquer.pptx

  • 2.
  • 3. Closest-Pair Problem by Divide-and-Conquer Step 0 Sort the points by x co-ordinate (list one) and then by y co- ordinate (list two). Step 1 Divide the points given into two subsets S1 and S2 by a vertical line, x = m, through the median m of their x coordinates so that half the points lie to the left or on the line and half the points lie to the right or on the line. Step 2 Find recursively the closest pairs for the left and right subsets.
  • 4.
  • 5. Closest Pair by Divide-and-Conquer (cont.) Step 3 Set d = min{d1, d2}. d is not necessarily the smallest distance between all the point pairs because points of a closer pair can lie on the opposite sides of the separating line. While combining the solutions such points need to be examined. Points in the symmetric vertical strip of width 2d will be possible closest pair. Let C1 and C2 be the subsets of points in the left subset S1 and of the right subset S2, respectively, that lie in this vertical strip. The points in C1 and C2 are stored in increasing order of their y coordinates, taken from the second list. Step 4 For every point P(x,y) in C1, we inspect points in C2 that may be closer to P than d. There can be no more than 6 such points (because d ≤ d2)!
  • 6. Closest Pair by Divide-and-Conquer: Worst Case
  • 7.
  • 8. Efficiency of the Closest-Pair Algorithm Running time of the algorithm (without sorting) is: T(n) = 2T(n/2) + M(n), where M(n)  Θ(n) By the Master Theorem (with a = 2, b = 2, d = 1) T(n)  Θ(n log n) So the total time is Θ(n log n).
  • 9. Quickhull Algorithm Convex hull: smallest convex set that includes given points. • Quick hull algorithm uses divide and conquer technique. • Initially points are sorted by x-coordinate values with ties resolved by y coordinates. • Identify extreme points P1 and Pn (leftmost and rightmost).
  • 10. Quickhull Algorithm • Compute upper hull recursively: • find point Pmax that is farthest away from line P1Pn • compute the upper hull of the points to the left of line P1Pmax • compute the upper hull of the points to the left of line PmaxPn • Compute lower hull in a similar manner P1 Pn Pmax
  • 12. Quick hull If q1(x1, y1), q2(x2, y2), and q3(x3, y3) are three arbitrary points in the Cartesian plane, then the area of the triangle q1q2q3 is equal to one-half of the magnitude of the determinant the sign of this expression is positive if and only if the point q3 = (x3, y3) is to the left of the line q1q2.
  • 13. Efficiency of Quickhull Algorithm Time Complexity: • Finding point farthest away from line P1Pn can be done in linear time and merging of the left and the right convex hulls take O(n) time and as we are dividing the points into two equal parts, T(n) = 2T(n/2) + O(n) • so the time complexity of the above algorithm is O(n * log n). • Time efficiency: • worst case: O(n2) T(n) = T(n-1) + O(n)