SlideShare a Scribd company logo
Divide-and-Conquer,
Technique used :
Convex Hull by Graham’s Scan
Presented by
• Aabid Amin Shah
•MSC-IT IST Sem
• Roll no: 140201
•Central University of Kashmir.
Sub: Data Structure
1 Presented by Aabid Shah
Divide-and-Conquer
The most-well known algorithm design strategy:
1. Divide instance of problem into two or more
smaller instances
2. Solve smaller instances recursively
3. Obtain solution to original (larger) instance by
combining these solutions
2 Presented by Aabid Shah
3
 In divide and conquer, method we divide the set
of n points in 0(n) time into two subsets, one
containing the leftmost [n/2] points, and one
containing the right most [n/2] points, recursively
compute the convex hull of the subsets, and then
combine the hulls in 0(n) time. The running time is
described by the familiar recurrence
 T(n) =2T(n/2) +o(n),
so the divide and conquer method runs in o(n log
n) time.
Presented by Aabid Shah
Divide-and-Conquer Technique
subproblem 2
of size n/2
subproblem 1
of size n/2
a solution to
subproblem 1
a solution to
the original problem
a solution to
subproblem 2
a problem of size n
4 Presented by Aabid Shah
Control Abstraction for Divide and Conquer
Algorithm DAndC( P ) {
if Small( P ) then return S( P );
else {
divide P into smaller instances P1, P2, …, Pk , k >= 1;
Apply DAndC to each these sub-problems;
return Combine(DAndC(P1), DAndC(P1),…, DAndC(Pk));
}
}
5 Presented by Aabid Shah
Definition of convex Hull
 Convex hull of set Q of points is the smallest convex polygon P
for which each point of Q is either on boundary of p or inside it.
 We have a set of points P0,P1,P2….Pn. These are the set of
point and from among them we will choose a subset of points
such that when we make a polygon out of it which has
minimum sides than all other points lies inside it and these
points are on the polygon. This is the simple and cute definition
of convex hull . so we have convex hull, we have set of points
so for example .we will use graham ‘s scan algorithm to solve
this problem .
6 Presented by Aabid Shah
7 Steps of creation of Convex Hull.Presented by Aabid Shah
Graham’s scan Algorithm
1. let p0 be the point in Q with the minimum y-coordinates or the left most
such point in case of a tie
2. let <p1,p2,p3….pn> be the remaining points in Q, sorted by polar angle
in the counter clock wise order around the p0 (if more than one point
has same angle, remove all but that is farthest from p0)
3. let s be the a empty stack i.e. top[s]<--0
4. push (p0,s)
5. Push (p1,s)
6. Push (p2,s)
7. For i = 3 to n
8. While the angle formed by points NEXT-TO-TOP(S),TOP(S),and pi
makes a
non left turn
9. Pop (s)
10. Push (pi,s)
Note: When the algorithm terminates
stack[s] contains exactly the vertices
of Q in the counter clockwise order of
their appearance on the boundary.
8 Presented by Aabid Shah
How to use of Graham’s scan algorithm.
 1. we take a point with a minimum y coordinate and if
we have multiple such points with y coordinates break
the tie with left most of them.
 Let p0,p1,p2……pn is the set of q then we sort them by
polar angle counter clockwise order and start from p0
then what we do we maintain a stack. Now the top of
stack is 0 we push the first three points on it i.e.
p0,p1,p2.
Stack
top
p2
p1
P0
Polar
angle
The polar angle is theta 3> theta 2> theta 1
i.e p1 has lowest polar angle then p2,p3..pn
p0 p1
p2
p3
pn
9 Presented by Aabid Shah
Conditions to check
1. Find the next minimum y coordinate or the leftmost
such point in case of a tie.
2. Sort them by polar angle in counter clock wise
order around p0 .
3. Maintain the stack to push element on it.
4. Pop the element if it makes a non left turn angle.
5. Join the farthest point to make a convex hull of
vertex pushed on to the stack.
10 Presented by Aabid Shah
11 Presented by Aabid Shah
12 Presented by Aabid Shah
13 Presented by Aabid Shah
14 Presented by Aabid Shah
15 Presented by Aabid Shah
16 Presented by Aabid Shah
17 Presented by Aabid Shah
18 Presented by Aabid Shah
19 Presented by Aabid Shah
20 Presented by Aabid Shah
21 Presented by Aabid Shah
22 Presented by Aabid Shah
23 Presented by Aabid Shah
24 Presented by Aabid Shah
25 Presented by Aabid Shah
26 Presented by Aabid Shah
27 Presented by Aabid Shah
28 Presented by Aabid Shah
29 Presented by Aabid Shah
30 Presented by Aabid Shah
31 Presented by Aabid Shah
32 Presented by Aabid Shah
33 Presented by Aabid Shah
34 Presented by Aabid Shah
35 Presented by Aabid Shah
36 Presented by Aabid Shah
37
That’s all for Convex Hull…..
Presented by Aabid Shah
38 Presented by Aabid Shah

More Related Content

What's hot

Quick sort
Quick sortQuick sort
Quick sort
Afaq Mansoor Khan
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
Soheil Khodayari
 
Brute force-algorithm
Brute force-algorithmBrute force-algorithm
Brute force-algorithm
9854098540
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
Mohamed El-Serngawy
 
Red black tree
Red black treeRed black tree
Red black tree
Dr Sandeep Kumar Poonia
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
Mohammed Hussein
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applicationsJsaddam Hussain
 
Bezier curve computer graphics
Bezier curve computer graphics Bezier curve computer graphics
Bezier curve computer graphics
University of Potsdam
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Muhammad Hammad Waseem
 
Tries data structures
Tries data structuresTries data structures
Tries data structures
Jothi Ramasamy
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
Amrinder Arora
 
All pair shortest path by Sania Nisar
All pair shortest path by Sania NisarAll pair shortest path by Sania Nisar
All pair shortest path by Sania Nisar
Sania Nisar
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
Sam Light
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
Hema Kashyap
 
Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!
Mahesh Tibrewal
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
Stavros Vassos
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
almaqboli
 
computer Graphics
computer Graphics computer Graphics
computer Graphics
Rozi khan
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
R Islam
 

What's hot (20)

Quick sort
Quick sortQuick sort
Quick sort
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Brute force-algorithm
Brute force-algorithmBrute force-algorithm
Brute force-algorithm
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
 
Red black tree
Red black treeRed black tree
Red black tree
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Bezier curve computer graphics
Bezier curve computer graphics Bezier curve computer graphics
Bezier curve computer graphics
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Tries data structures
Tries data structuresTries data structures
Tries data structures
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
All pair shortest path by Sania Nisar
All pair shortest path by Sania NisarAll pair shortest path by Sania Nisar
All pair shortest path by Sania Nisar
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!
 
Convex Hull Algorithms
Convex Hull AlgorithmsConvex Hull Algorithms
Convex Hull Algorithms
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
Intro to AI STRIPS Planning & Applications in Video-games Lecture2-Part2
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
computer Graphics
computer Graphics computer Graphics
computer Graphics
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 

Viewers also liked

Convex Hull Algorithm Analysis
Convex Hull Algorithm AnalysisConvex Hull Algorithm Analysis
Convex Hull Algorithm Analysis
Rex Yuan
 
Jarvis Algorithm Demonstration
Jarvis Algorithm DemonstrationJarvis Algorithm Demonstration
Jarvis Algorithm Demonstration
Ismália Santiago
 
Approximation de ritter
Approximation de ritterApproximation de ritter
Approximation de ritter
Mag-Stellon Nadarajah
 
Graham Algorithm Demonstration
Graham Algorithm DemonstrationGraham Algorithm Demonstration
Graham Algorithm Demonstration
Ismália Santiago
 
26 Computational Geometry
26 Computational Geometry26 Computational Geometry
26 Computational Geometry
Andres Mendez-Vazquez
 
Svm V SVC
Svm V SVCSvm V SVC
Svm V SVC
AMR koura
 
An Efficient Convex Hull Algorithm for a Planer Set of Points
An Efficient Convex Hull Algorithm for a Planer Set of PointsAn Efficient Convex Hull Algorithm for a Planer Set of Points
An Efficient Convex Hull Algorithm for a Planer Set of PointsKasun Ranga Wijeweera
 
View classification of medical x ray images using pnn classifier, decision tr...
View classification of medical x ray images using pnn classifier, decision tr...View classification of medical x ray images using pnn classifier, decision tr...
View classification of medical x ray images using pnn classifier, decision tr...
eSAT Journals
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classification
Yiwei Chen
 
Basic guide to turf cricket pitch preparation
Basic guide to turf cricket pitch preparationBasic guide to turf cricket pitch preparation
Basic guide to turf cricket pitch preparation
Debbie-Ann Hall
 
project presentation on mouse simulation using finger tip detection
project presentation on mouse simulation using finger tip detection project presentation on mouse simulation using finger tip detection
project presentation on mouse simulation using finger tip detection Sumit Varshney
 
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithm
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithmMri brain image segmentatin and classification by modified fcm &amp;svm akorithm
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithm
eSAT Journals
 
Svm my
Svm mySvm my
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
Ahmed Daoud
 
morphological image processing
morphological image processingmorphological image processing
morphological image processingJohn Williams
 
Image Classification And Support Vector Machine
Image Classification And Support Vector MachineImage Classification And Support Vector Machine
Image Classification And Support Vector MachineShao-Chuan Wang
 
Patent Basics and Intellectual Property Rights
Patent Basics and Intellectual Property Rights Patent Basics and Intellectual Property Rights
Patent Basics and Intellectual Property Rights
Rahul Dev
 
Hand gesture recognition
Hand gesture recognitionHand gesture recognition
Hand gesture recognition
Muhammed M. Mekki
 
Support Vector Machines for Classification
Support Vector Machines for ClassificationSupport Vector Machines for Classification
Support Vector Machines for Classification
Prakash Pimpale
 

Viewers also liked (20)

Convex Hull Algorithm Analysis
Convex Hull Algorithm AnalysisConvex Hull Algorithm Analysis
Convex Hull Algorithm Analysis
 
Jarvis Algorithm Demonstration
Jarvis Algorithm DemonstrationJarvis Algorithm Demonstration
Jarvis Algorithm Demonstration
 
Approximation de ritter
Approximation de ritterApproximation de ritter
Approximation de ritter
 
Graham Algorithm Demonstration
Graham Algorithm DemonstrationGraham Algorithm Demonstration
Graham Algorithm Demonstration
 
Lec12
Lec12Lec12
Lec12
 
26 Computational Geometry
26 Computational Geometry26 Computational Geometry
26 Computational Geometry
 
Svm V SVC
Svm V SVCSvm V SVC
Svm V SVC
 
An Efficient Convex Hull Algorithm for a Planer Set of Points
An Efficient Convex Hull Algorithm for a Planer Set of PointsAn Efficient Convex Hull Algorithm for a Planer Set of Points
An Efficient Convex Hull Algorithm for a Planer Set of Points
 
View classification of medical x ray images using pnn classifier, decision tr...
View classification of medical x ray images using pnn classifier, decision tr...View classification of medical x ray images using pnn classifier, decision tr...
View classification of medical x ray images using pnn classifier, decision tr...
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classification
 
Basic guide to turf cricket pitch preparation
Basic guide to turf cricket pitch preparationBasic guide to turf cricket pitch preparation
Basic guide to turf cricket pitch preparation
 
project presentation on mouse simulation using finger tip detection
project presentation on mouse simulation using finger tip detection project presentation on mouse simulation using finger tip detection
project presentation on mouse simulation using finger tip detection
 
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithm
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithmMri brain image segmentatin and classification by modified fcm &amp;svm akorithm
Mri brain image segmentatin and classification by modified fcm &amp;svm akorithm
 
Svm my
Svm mySvm my
Svm my
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
morphological image processing
morphological image processingmorphological image processing
morphological image processing
 
Image Classification And Support Vector Machine
Image Classification And Support Vector MachineImage Classification And Support Vector Machine
Image Classification And Support Vector Machine
 
Patent Basics and Intellectual Property Rights
Patent Basics and Intellectual Property Rights Patent Basics and Intellectual Property Rights
Patent Basics and Intellectual Property Rights
 
Hand gesture recognition
Hand gesture recognitionHand gesture recognition
Hand gesture recognition
 
Support Vector Machines for Classification
Support Vector Machines for ClassificationSupport Vector Machines for Classification
Support Vector Machines for Classification
 

Similar to convex hull

Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
Unit ii divide and conquer -4
Unit ii divide and conquer -4Unit ii divide and conquer -4
Unit ii divide and conquer -4
subhashchandra197
 
Sorting2
Sorting2Sorting2
Sorting2
Saurabh Mishra
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational Geometry
Minh-Tri Pham
 
ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentary
irrrrr
 
Maths formula ii
Maths formula iiMaths formula ii
Maths formula ii
Cool Rao
 
Geometric Separators and the Parabolic Lift
Geometric Separators and the Parabolic LiftGeometric Separators and the Parabolic Lift
Geometric Separators and the Parabolic Lift
Don Sheehy
 
三角関数(人間科学のための基礎数学)
三角関数(人間科学のための基礎数学)三角関数(人間科学のための基礎数学)
三角関数(人間科学のための基礎数学)
Masahiro Okano
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
Excel Homework Help
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
Krish_ver2
 
Question 1 Solution
Question 1 SolutionQuestion 1 Solution
Question 1 SolutionShinobi
 
factoring
factoringfactoring
factoring
Harish Sahu
 
26 Computational Geometry
26 Computational Geometry26 Computational Geometry
26 Computational Geometry
Andres Mendez-Vazquez
 

Similar to convex hull (20)

Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Unit ii divide and conquer -4
Unit ii divide and conquer -4Unit ii divide and conquer -4
Unit ii divide and conquer -4
 
Curve clipping
Curve clippingCurve clipping
Curve clipping
 
Sorting2
Sorting2Sorting2
Sorting2
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
 
algorithm unit 1
algorithm unit 1algorithm unit 1
algorithm unit 1
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational Geometry
 
ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentary
 
Maths formula ii
Maths formula iiMaths formula ii
Maths formula ii
 
Geometric Separators and the Parabolic Lift
Geometric Separators and the Parabolic LiftGeometric Separators and the Parabolic Lift
Geometric Separators and the Parabolic Lift
 
36 greedy
36 greedy36 greedy
36 greedy
 
Control chap7
Control chap7Control chap7
Control chap7
 
三角関数(人間科学のための基礎数学)
三角関数(人間科学のための基礎数学)三角関数(人間科学のための基礎数学)
三角関数(人間科学のための基礎数学)
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
 
Question 1 Solution
Question 1 SolutionQuestion 1 Solution
Question 1 Solution
 
DEV
DEVDEV
DEV
 
factoring
factoringfactoring
factoring
 
26 Computational Geometry
26 Computational Geometry26 Computational Geometry
26 Computational Geometry
 

Recently uploaded

Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
TE Studio
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
PrabhjeetSingh219035
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
aaryangarg12
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Mansi Shah
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
kecekev
 
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
708pb191
 
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptxUNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
GOWSIKRAJA PALANISAMY
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
Techno Merch
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Timeless Principles of Good Design
Timeless Principles of Good DesignTimeless Principles of Good Design
Timeless Principles of Good Design
Carolina de Bartolo
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
asuzyq
 
Borys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior designBorys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior design
boryssutkowski
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
9a93xvy
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
ameli25062005
 
Design-Thinking-eBook for Public Service Delivery
Design-Thinking-eBook for Public Service DeliveryDesign-Thinking-eBook for Public Service Delivery
Design-Thinking-eBook for Public Service Delivery
farhanaslam79
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
GOWSIKRAJA PALANISAMY
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
garcese
 
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With DesignsGame Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
184804
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
h7j5io0
 
White wonder, Work developed by Eva Tschopp
White wonder, Work developed by Eva TschoppWhite wonder, Work developed by Eva Tschopp
White wonder, Work developed by Eva Tschopp
Mansi Shah
 

Recently uploaded (20)

Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
 
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
 
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptxUNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Timeless Principles of Good Design
Timeless Principles of Good DesignTimeless Principles of Good Design
Timeless Principles of Good Design
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
 
Borys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior designBorys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior design
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
 
Design-Thinking-eBook for Public Service Delivery
Design-Thinking-eBook for Public Service DeliveryDesign-Thinking-eBook for Public Service Delivery
Design-Thinking-eBook for Public Service Delivery
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
 
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With DesignsGame Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
 
White wonder, Work developed by Eva Tschopp
White wonder, Work developed by Eva TschoppWhite wonder, Work developed by Eva Tschopp
White wonder, Work developed by Eva Tschopp
 

convex hull

  • 1. Divide-and-Conquer, Technique used : Convex Hull by Graham’s Scan Presented by • Aabid Amin Shah •MSC-IT IST Sem • Roll no: 140201 •Central University of Kashmir. Sub: Data Structure 1 Presented by Aabid Shah
  • 2. Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances recursively 3. Obtain solution to original (larger) instance by combining these solutions 2 Presented by Aabid Shah
  • 3. 3  In divide and conquer, method we divide the set of n points in 0(n) time into two subsets, one containing the leftmost [n/2] points, and one containing the right most [n/2] points, recursively compute the convex hull of the subsets, and then combine the hulls in 0(n) time. The running time is described by the familiar recurrence  T(n) =2T(n/2) +o(n), so the divide and conquer method runs in o(n log n) time. Presented by Aabid Shah
  • 4. Divide-and-Conquer Technique subproblem 2 of size n/2 subproblem 1 of size n/2 a solution to subproblem 1 a solution to the original problem a solution to subproblem 2 a problem of size n 4 Presented by Aabid Shah
  • 5. Control Abstraction for Divide and Conquer Algorithm DAndC( P ) { if Small( P ) then return S( P ); else { divide P into smaller instances P1, P2, …, Pk , k >= 1; Apply DAndC to each these sub-problems; return Combine(DAndC(P1), DAndC(P1),…, DAndC(Pk)); } } 5 Presented by Aabid Shah
  • 6. Definition of convex Hull  Convex hull of set Q of points is the smallest convex polygon P for which each point of Q is either on boundary of p or inside it.  We have a set of points P0,P1,P2….Pn. These are the set of point and from among them we will choose a subset of points such that when we make a polygon out of it which has minimum sides than all other points lies inside it and these points are on the polygon. This is the simple and cute definition of convex hull . so we have convex hull, we have set of points so for example .we will use graham ‘s scan algorithm to solve this problem . 6 Presented by Aabid Shah
  • 7. 7 Steps of creation of Convex Hull.Presented by Aabid Shah
  • 8. Graham’s scan Algorithm 1. let p0 be the point in Q with the minimum y-coordinates or the left most such point in case of a tie 2. let <p1,p2,p3….pn> be the remaining points in Q, sorted by polar angle in the counter clock wise order around the p0 (if more than one point has same angle, remove all but that is farthest from p0) 3. let s be the a empty stack i.e. top[s]<--0 4. push (p0,s) 5. Push (p1,s) 6. Push (p2,s) 7. For i = 3 to n 8. While the angle formed by points NEXT-TO-TOP(S),TOP(S),and pi makes a non left turn 9. Pop (s) 10. Push (pi,s) Note: When the algorithm terminates stack[s] contains exactly the vertices of Q in the counter clockwise order of their appearance on the boundary. 8 Presented by Aabid Shah
  • 9. How to use of Graham’s scan algorithm.  1. we take a point with a minimum y coordinate and if we have multiple such points with y coordinates break the tie with left most of them.  Let p0,p1,p2……pn is the set of q then we sort them by polar angle counter clockwise order and start from p0 then what we do we maintain a stack. Now the top of stack is 0 we push the first three points on it i.e. p0,p1,p2. Stack top p2 p1 P0 Polar angle The polar angle is theta 3> theta 2> theta 1 i.e p1 has lowest polar angle then p2,p3..pn p0 p1 p2 p3 pn 9 Presented by Aabid Shah
  • 10. Conditions to check 1. Find the next minimum y coordinate or the leftmost such point in case of a tie. 2. Sort them by polar angle in counter clock wise order around p0 . 3. Maintain the stack to push element on it. 4. Pop the element if it makes a non left turn angle. 5. Join the farthest point to make a convex hull of vertex pushed on to the stack. 10 Presented by Aabid Shah
  • 11. 11 Presented by Aabid Shah
  • 12. 12 Presented by Aabid Shah
  • 13. 13 Presented by Aabid Shah
  • 14. 14 Presented by Aabid Shah
  • 15. 15 Presented by Aabid Shah
  • 16. 16 Presented by Aabid Shah
  • 17. 17 Presented by Aabid Shah
  • 18. 18 Presented by Aabid Shah
  • 19. 19 Presented by Aabid Shah
  • 20. 20 Presented by Aabid Shah
  • 21. 21 Presented by Aabid Shah
  • 22. 22 Presented by Aabid Shah
  • 23. 23 Presented by Aabid Shah
  • 24. 24 Presented by Aabid Shah
  • 25. 25 Presented by Aabid Shah
  • 26. 26 Presented by Aabid Shah
  • 27. 27 Presented by Aabid Shah
  • 28. 28 Presented by Aabid Shah
  • 29. 29 Presented by Aabid Shah
  • 30. 30 Presented by Aabid Shah
  • 31. 31 Presented by Aabid Shah
  • 32. 32 Presented by Aabid Shah
  • 33. 33 Presented by Aabid Shah
  • 34. 34 Presented by Aabid Shah
  • 35. 35 Presented by Aabid Shah
  • 36. 36 Presented by Aabid Shah
  • 37. 37 That’s all for Convex Hull….. Presented by Aabid Shah
  • 38. 38 Presented by Aabid Shah