SlideShare a Scribd company logo
1 of 45
On the Convex Layers
of a
Planer Dynamic Set of Points
Kasun Ranga Wijeweera
(krw19870829@gmail.com)
1
Introduction
2
What is a Convex Polygon?
• A polygon P is called convex if x in P and y in P implies that
the segment xy is a subset of P.
• A vertex is called reflex if its internal angle is greater than π.
• Any polygon with a reflex vertex is not convex.
3
Convex Hull of a Planer Set of Points
• The convex hull of a set of points is the shape taken by a
rubber band stretched around nails pounded into the plane at
each point.
4
Convex Layers of a Planer Set of Points
• Let S be the set of points.
• The set of convex layers is derived by applying following
procedure iteratively on S: compute the convex hull of S and
remove its vertices from S.
5
Research Problem
• A set of points where points may be inserted or deleted is
called a dynamic set of points.
• A practical algorithm to maintain convex layers of a dynamic
set of points is not available in literature.
6
Literature Survey
7
Static Convex Layers Algorithms
• Green & Silverman (1979): O (n3)
• Overmars & Leeuwen (1981): O (n log2 n)
• Preparata & Shamos (1985): O (n2)
• Chazelle (1985): O (n log n)
• Neilson (1996): O (n log n)
• Raimi & Dana (2017): O (n log n)
8
Dynamic Convex Layers Algorithms
• Sanjib & Niraj (2015): O (n2)
• Insertion or a deletion of a point takes O (n) time.
9
Methodology
10
Related Research Paper
K. R. Wijeweera, S. R. Kodituwakku (2018), On the Convex
Layers of a Planer Dynamic Set of Points, Ceylon Journal of
Science, Volume 47 (Issue 2), pp. 165-174.
11
Representation of a Layer
• Each convex layer can be represented by a convex polygon.
• The layers are numbered beginning from 0.
• The very first point which arrives should always belong to
the 0th layer.
12
Representation of a Layer…
• A layer is represented as a set of edges.
• Edges are also numbered beginning from 0s in each layer.
• Figure shows the representation of jth edge in ith layer.
13
Representation of a Layer…
• A layer or an edge can have two states: dead or alive.
• Only alive layers and alive edges are considered as the
convex layers.
• These two states are stored in array elements l_dead[i] and
e_dead[i][j].
• l_dead[i] = 1  ith layer is dead  All the edges of the ith
layer are dead.
• e_dead[i][j] = 1  jth edge of the ith layer is dead.
14
Insertion of a Point
15
Construction of the Primary Hull
• Each layer begins with a single point and later it may evolve
to a convex polygon.
• When a layer is a triangle then it is called “primary hull”.
• The very first point should be included to the 0th layer by
setting it as (sx[0][0], sy[0][0]).
• If next point coincides with the very first point then it should
be set as (sx[1][0], sy[1][0]).
• If next point also coincides with the very first point then it
should be set as (sx[2][0], sy[2][0]).
• In this way, coincident points are propagated to inner layers.
16
Construction of the Primary Hull…
• The point which is distinct to the very first point for the first
time is set as (ex[0][0], ey[0][0]).
• After insertion of the first edge to the 0th layer then the next
point can have two states: collinear with 0th edge or not.
17
Construction of the Primary Hull…
• The vertices of the triangle: P1 (x1, y1), P2 (x2, y2), P3 (x3, y3).
• Let txy = x1 * (y2 – y3) + x2 * (y3 – y1) + x3 * (y1 – y2).
• txy = 0 ↔ (P1, P2, P3) are collinear.
• txy > 0 ↔ (P1, P2, P3) are in anticlockwise order.
• txy < 0 ↔ (P1, P2, P3) are in clockwise order.
18
txy > 0 txy < 0
Collinear with the 0th Edge
• If next point is collinear with the 0th edge then there are three
possibilities as shown in the figure.
• In first two situations, the closest end point should be
replaced by the new point. The dropped end point should be
transferred to the closest inner layer.
• There is no extension for the third situation. The new point
should be transferred to the closest inner layer.
19
Non Collinear with the 0th Edge
• If next point is not collinear with the 0th edge then the convex
layer should be extended to a triangle.
• Let coordinates of the new point be (x, y).
• Two new edges should be added to the layer h to extend.
• 1st edge: sx[h][1] = x; sy[h][1] = y; ex[h][1] = sx[h][0];
ey[h][1] = sy[h][0];
• 2nd edge: sx[h][2] = x; sy[h][2] = y; ex[h][2] = ex[h][0];
ey[h][2] = ey[h][0];
20
Construction of the Secondary Hull
• The mechanism used to extend convex layer differs after the
layer became a triangle.
• Let (xc/3, yc/3) be the centroid of the primary hull.
• xc = sx[h][0] + ex[h][0] + sx[h][1]; yc = sy[h][0] + ey[h][0] +
sy[h][1];
• (xc/3, yc/3) always remains inside the layer even though the
layer is extended.
• If (xc/3, yc/3) and the new point are in opposite sides of a
given edge of the convex layer then it is said that the new
point is OUTSIDE to that edge.
21
Identifying INSIDE or OUTSIDE to an Edge
• The vertices of the triangle: P1 (x1, y1), P2 (x2, y2), P3 (x3, y3).
• Let txy = x1 * (y2 – y3) + x2 * (y3 – y1) + x3 * (y1 – y2).
• txy = 0 ↔ (P1, P2, P3) are collinear.
• txy > 0 ↔ (P1, P2, P3) are in anticlockwise order.
• txy < 0 ↔ (P1, P2, P3) are in clockwise order.
22
txy > 0 txy < 0
Identifying INSIDE or OUTSIDE to an Edge…
• Let N be the new point and G be the centroid of the primary
hull.
• Note that N is INSIDE all the edges of the layer except edge
AB.
• txy {B, A, N} * txy {B, A, G} < 0  N is OUTSIDE AB.
• txy {B, A, N} * txy {B, A, G} ≥ 0  N is INSIDE AB.
23
Expansion of a Layer
• When a new point appears, the outermost convex layer to
which that point is outside should be selected first.
• If the new point is not outside any of the convex layers
available then new layer should be created inside the
innermost layer.
24
Expansion of a Layer…
• When a layer expands then it may leave some of its existing
points.
• These points should be transferred to the adjacent inner layer
of the current layer as new points.
• This procedure should be carried out inheriting points from
outer layers to inner layers.
25
Expansion of a Layer…
26
Expansion of a Layer…
27
Expansion of a Layer…
28
Expansion of a Layer…
29
Expansion of a Layer…
30
How to Expand a Layer
• Suppose new point appears outside a single edge of the layer.
• The edge AB should be set into dead.
• Two alive edges AN and BN should be added to the layer.
31
How to Expand a Layer…
• Suppose new point appears outside two edges of the layer.
• Edges MP and MQ are added as alive edges to the layer.
• Edges MQ and MR are added as alive edges to the layer.
• Note that the edge MQ appears twice in the list of edges.
32
How to Expand a Layer…
• If an edge appears more than once in the list of edges then it
should be set into dead.
• Therefore, the edge MQ should be set into dead.
• The point Q should be transferred to adjacent inner layer.
33
Deletion of a Point
34
Deletion of a Point…
• Suppose the point circled in figure should be deleted.
• The corresponding layer should be set into dead first.
35
Deletion of a Point…
• The points in the deleted layer except the deleted point
should be transferred to the adjacent inner layer.
36
Results and Discussion
37
Analysis of the Algorithm
• Suppose that there are n points on the plane.
• The convex layers have already been found and suppose that
there are k convex layers.
• Then each layer contains (n/k) average number of points.
• Three cases:
• Insertion of a point.
• Deletion of a point.
• Working in the dynamic context.
38
Insertion of a Point
• The worst case occurs when the new point appears outside all
the layers.
• Suppose a point is transferred to a layer.
• It takes O (n/k) time to search and set dead the existing edges
of a layer.
• It takes O [(n/k)2] time to detect duplicate edges in the edge
list.
• Altogether, it takes O (n/k) + O [(n/k)2] = O [(n/k)2] time to
transfer a single point to a layer.
• A layer receives O (n/k) points in the worst case.
• Therefore, it takes O [(n/k)2] * O (n/k) = O [(n/k)3] time to
transfer points between two adjacent layers.
• Since there are k layers, it takes O [(n/k)3] * O (k) = O (n3/k2)
time to insert a point in the worst case. 39
Deletion of a Point
• The worst case occurs when a point on the outermost layer is
deleted.
• All the points except the point to be deleted should be
transferred to inner layers.
• Thus the deletion problem becomes an insertion problem.
• Therefore, it takes O (n3/k2) time to delete a point in the worst
case.
40
Working in the Dynamic Context
• A single point can be inserted or deleted in O (n3/k2) time.
• Therefore, the algorithm takes n * O (n3/k2) = O (n4/k2) time
to compute the convex layers in the dynamic context.
41
Drawbacks of Sanjib & Niraj Algorithm
• The algorithm assumes that the set of points does not contain
any collinear points.
• The authors proposed a theoretical algorithm without
providing a corresponding implementation.
• The notion of tangent is not available in higher dimensions.
42
Conclusions
43
Conclusions
• The proposed algorithm takes O (n3/k2) time to perform an
insertion or a deletion of a point whereas Sanjib & Niraj
algorithm takes O (n) time.
• The proposed algorithm takes O (n4/k2) time in dynamic
context whereas Sanjib and Niraj algorithm takes O (n2) time.
• The proposed algorithm can handle set of points with
coincident points and collinear points.
• The proposed algorithm was successfully implemented using
C programming language.
• The notion used in the proposed algorithm can be extended
into higher dimensions.
44
Thank you!
45

More Related Content

What's hot

Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipseMaaz Rizwan
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmNeha Kaurav
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithmAnkit Garg
 
Cs8092 computer graphics and multimedia unit 2
Cs8092 computer graphics and multimedia unit 2Cs8092 computer graphics and multimedia unit 2
Cs8092 computer graphics and multimedia unit 2SIMONTHOMAS S
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.Mohd Arif
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algoMohd Arif
 
Operational research
Operational researchOperational research
Operational researchAlbi Thomas
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesOmprakash Chauhan
 
An Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonAn Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonKasun Ranga Wijeweera
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversionMohd Arif
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmMrinmoy Dalal
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithmMani Kanth
 
07 cie552 image_mosaicing
07 cie552 image_mosaicing07 cie552 image_mosaicing
07 cie552 image_mosaicingElsayed Hemayed
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.Mohd Arif
 

What's hot (20)

bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
Cs8092 computer graphics and multimedia unit 2
Cs8092 computer graphics and multimedia unit 2Cs8092 computer graphics and multimedia unit 2
Cs8092 computer graphics and multimedia unit 2
 
Cs580
Cs580Cs580
Cs580
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algo
 
Operational research
Operational researchOperational research
Operational research
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
An Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonAn Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a Polygon
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing Algorithm
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
07 cie552 image_mosaicing
07 cie552 image_mosaicing07 cie552 image_mosaicing
07 cie552 image_mosaicing
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.
 

Similar to On the Convex Layers of a Planer Dynamic Set of Points

Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...
Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...
Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...Kasun Ranga Wijeweera
 
My pp tno sound
My pp tno soundMy pp tno sound
My pp tno sounddicosmo178
 
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]On the Convex Layers of a Planer Dynamic Set of Points [Short Version]
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]Kasun Ranga Wijeweera
 
Shear of thin walled sections.pdf
Shear of thin walled sections.pdfShear of thin walled sections.pdf
Shear of thin walled sections.pdfTarikHassanElsonni
 
7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washersdicosmo178
 
7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washersdicosmo178
 
7.3 volumes by cylindrical shells
7.3 volumes by cylindrical shells7.3 volumes by cylindrical shells
7.3 volumes by cylindrical shellsdicosmo178
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3SIMONTHOMAS S
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & RasterizationAhmed Daoud
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Amr E. Mohamed
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Amr E. Mohamed
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fillwahab13
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptographyBarani Tharan
 
Lec4 shear of thin walled beams
Lec4 shear of thin walled beamsLec4 shear of thin walled beams
Lec4 shear of thin walled beamsMahdi Damghani
 

Similar to On the Convex Layers of a Planer Dynamic Set of Points (20)

Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...
Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...
Convex Partitioning of a Polygon into Smaller Number of Pieces with Lowest Me...
 
My pp tno sound
My pp tno soundMy pp tno sound
My pp tno sound
 
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]On the Convex Layers of a Planer Dynamic Set of Points [Short Version]
On the Convex Layers of a Planer Dynamic Set of Points [Short Version]
 
Shear of thin walled sections.pdf
Shear of thin walled sections.pdfShear of thin walled sections.pdf
Shear of thin walled sections.pdf
 
7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers
 
7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers7.2 volumes by slicing disks and washers
7.2 volumes by slicing disks and washers
 
7.3 volumes by cylindrical shells
7.3 volumes by cylindrical shells7.3 volumes by cylindrical shells
7.3 volumes by cylindrical shells
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3
 
Lecture24
Lecture24Lecture24
Lecture24
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
 
ECC_basics.ppt
ECC_basics.pptECC_basics.ppt
ECC_basics.ppt
 
testpang
testpangtestpang
testpang
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
 
Ch07 linearspacealignment
Ch07 linearspacealignmentCh07 linearspacealignment
Ch07 linearspacealignment
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptography
 
ECC_basics.ppt
ECC_basics.pptECC_basics.ppt
ECC_basics.ppt
 
Lec4 shear of thin walled beams
Lec4 shear of thin walled beamsLec4 shear of thin walled beams
Lec4 shear of thin walled beams
 

More from Kasun Ranga Wijeweera

Algorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonAlgorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonKasun Ranga Wijeweera
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmKasun Ranga Wijeweera
 
Getting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingGetting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingKasun Ranga Wijeweera
 
Variables in Visual Basic Programming
Variables in Visual Basic ProgrammingVariables in Visual Basic Programming
Variables in Visual Basic ProgrammingKasun Ranga Wijeweera
 
Conditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingConditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingKasun Ranga Wijeweera
 
Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Kasun Ranga Wijeweera
 

More from Kasun Ranga Wijeweera (20)

Decorator Design Pattern in C#
Decorator Design Pattern in C#Decorator Design Pattern in C#
Decorator Design Pattern in C#
 
Singleton Design Pattern in C#
Singleton Design Pattern in C#Singleton Design Pattern in C#
Singleton Design Pattern in C#
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Algorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonAlgorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a Polygon
 
Geometric Transformations II
Geometric Transformations IIGeometric Transformations II
Geometric Transformations II
 
Geometric Transformations I
Geometric Transformations IGeometric Transformations I
Geometric Transformations I
 
Introduction to Polygons
Introduction to PolygonsIntroduction to Polygons
Introduction to Polygons
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
Loops in Visual Basic: Exercises
Loops in Visual Basic: ExercisesLoops in Visual Basic: Exercises
Loops in Visual Basic: Exercises
 
Conditional Logic: Exercises
Conditional Logic: ExercisesConditional Logic: Exercises
Conditional Logic: Exercises
 
Getting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingGetting Started with Visual Basic Programming
Getting Started with Visual Basic Programming
 
CheckBoxes and RadioButtons
CheckBoxes and RadioButtonsCheckBoxes and RadioButtons
CheckBoxes and RadioButtons
 
Variables in Visual Basic Programming
Variables in Visual Basic ProgrammingVariables in Visual Basic Programming
Variables in Visual Basic Programming
 
Loops in Visual Basic Programming
Loops in Visual Basic ProgrammingLoops in Visual Basic Programming
Loops in Visual Basic Programming
 
Conditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingConditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic Programming
 
Assignment for Variables
Assignment for VariablesAssignment for Variables
Assignment for Variables
 
Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]
 
Assignment for Events
Assignment for EventsAssignment for Events
Assignment for Events
 
Mastering Arrays Assignment
Mastering Arrays AssignmentMastering Arrays Assignment
Mastering Arrays Assignment
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 

Recently uploaded (20)

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 

On the Convex Layers of a Planer Dynamic Set of Points

  • 1. On the Convex Layers of a Planer Dynamic Set of Points Kasun Ranga Wijeweera (krw19870829@gmail.com) 1
  • 3. What is a Convex Polygon? • A polygon P is called convex if x in P and y in P implies that the segment xy is a subset of P. • A vertex is called reflex if its internal angle is greater than π. • Any polygon with a reflex vertex is not convex. 3
  • 4. Convex Hull of a Planer Set of Points • The convex hull of a set of points is the shape taken by a rubber band stretched around nails pounded into the plane at each point. 4
  • 5. Convex Layers of a Planer Set of Points • Let S be the set of points. • The set of convex layers is derived by applying following procedure iteratively on S: compute the convex hull of S and remove its vertices from S. 5
  • 6. Research Problem • A set of points where points may be inserted or deleted is called a dynamic set of points. • A practical algorithm to maintain convex layers of a dynamic set of points is not available in literature. 6
  • 8. Static Convex Layers Algorithms • Green & Silverman (1979): O (n3) • Overmars & Leeuwen (1981): O (n log2 n) • Preparata & Shamos (1985): O (n2) • Chazelle (1985): O (n log n) • Neilson (1996): O (n log n) • Raimi & Dana (2017): O (n log n) 8
  • 9. Dynamic Convex Layers Algorithms • Sanjib & Niraj (2015): O (n2) • Insertion or a deletion of a point takes O (n) time. 9
  • 11. Related Research Paper K. R. Wijeweera, S. R. Kodituwakku (2018), On the Convex Layers of a Planer Dynamic Set of Points, Ceylon Journal of Science, Volume 47 (Issue 2), pp. 165-174. 11
  • 12. Representation of a Layer • Each convex layer can be represented by a convex polygon. • The layers are numbered beginning from 0. • The very first point which arrives should always belong to the 0th layer. 12
  • 13. Representation of a Layer… • A layer is represented as a set of edges. • Edges are also numbered beginning from 0s in each layer. • Figure shows the representation of jth edge in ith layer. 13
  • 14. Representation of a Layer… • A layer or an edge can have two states: dead or alive. • Only alive layers and alive edges are considered as the convex layers. • These two states are stored in array elements l_dead[i] and e_dead[i][j]. • l_dead[i] = 1  ith layer is dead  All the edges of the ith layer are dead. • e_dead[i][j] = 1  jth edge of the ith layer is dead. 14
  • 15. Insertion of a Point 15
  • 16. Construction of the Primary Hull • Each layer begins with a single point and later it may evolve to a convex polygon. • When a layer is a triangle then it is called “primary hull”. • The very first point should be included to the 0th layer by setting it as (sx[0][0], sy[0][0]). • If next point coincides with the very first point then it should be set as (sx[1][0], sy[1][0]). • If next point also coincides with the very first point then it should be set as (sx[2][0], sy[2][0]). • In this way, coincident points are propagated to inner layers. 16
  • 17. Construction of the Primary Hull… • The point which is distinct to the very first point for the first time is set as (ex[0][0], ey[0][0]). • After insertion of the first edge to the 0th layer then the next point can have two states: collinear with 0th edge or not. 17
  • 18. Construction of the Primary Hull… • The vertices of the triangle: P1 (x1, y1), P2 (x2, y2), P3 (x3, y3). • Let txy = x1 * (y2 – y3) + x2 * (y3 – y1) + x3 * (y1 – y2). • txy = 0 ↔ (P1, P2, P3) are collinear. • txy > 0 ↔ (P1, P2, P3) are in anticlockwise order. • txy < 0 ↔ (P1, P2, P3) are in clockwise order. 18 txy > 0 txy < 0
  • 19. Collinear with the 0th Edge • If next point is collinear with the 0th edge then there are three possibilities as shown in the figure. • In first two situations, the closest end point should be replaced by the new point. The dropped end point should be transferred to the closest inner layer. • There is no extension for the third situation. The new point should be transferred to the closest inner layer. 19
  • 20. Non Collinear with the 0th Edge • If next point is not collinear with the 0th edge then the convex layer should be extended to a triangle. • Let coordinates of the new point be (x, y). • Two new edges should be added to the layer h to extend. • 1st edge: sx[h][1] = x; sy[h][1] = y; ex[h][1] = sx[h][0]; ey[h][1] = sy[h][0]; • 2nd edge: sx[h][2] = x; sy[h][2] = y; ex[h][2] = ex[h][0]; ey[h][2] = ey[h][0]; 20
  • 21. Construction of the Secondary Hull • The mechanism used to extend convex layer differs after the layer became a triangle. • Let (xc/3, yc/3) be the centroid of the primary hull. • xc = sx[h][0] + ex[h][0] + sx[h][1]; yc = sy[h][0] + ey[h][0] + sy[h][1]; • (xc/3, yc/3) always remains inside the layer even though the layer is extended. • If (xc/3, yc/3) and the new point are in opposite sides of a given edge of the convex layer then it is said that the new point is OUTSIDE to that edge. 21
  • 22. Identifying INSIDE or OUTSIDE to an Edge • The vertices of the triangle: P1 (x1, y1), P2 (x2, y2), P3 (x3, y3). • Let txy = x1 * (y2 – y3) + x2 * (y3 – y1) + x3 * (y1 – y2). • txy = 0 ↔ (P1, P2, P3) are collinear. • txy > 0 ↔ (P1, P2, P3) are in anticlockwise order. • txy < 0 ↔ (P1, P2, P3) are in clockwise order. 22 txy > 0 txy < 0
  • 23. Identifying INSIDE or OUTSIDE to an Edge… • Let N be the new point and G be the centroid of the primary hull. • Note that N is INSIDE all the edges of the layer except edge AB. • txy {B, A, N} * txy {B, A, G} < 0  N is OUTSIDE AB. • txy {B, A, N} * txy {B, A, G} ≥ 0  N is INSIDE AB. 23
  • 24. Expansion of a Layer • When a new point appears, the outermost convex layer to which that point is outside should be selected first. • If the new point is not outside any of the convex layers available then new layer should be created inside the innermost layer. 24
  • 25. Expansion of a Layer… • When a layer expands then it may leave some of its existing points. • These points should be transferred to the adjacent inner layer of the current layer as new points. • This procedure should be carried out inheriting points from outer layers to inner layers. 25
  • 26. Expansion of a Layer… 26
  • 27. Expansion of a Layer… 27
  • 28. Expansion of a Layer… 28
  • 29. Expansion of a Layer… 29
  • 30. Expansion of a Layer… 30
  • 31. How to Expand a Layer • Suppose new point appears outside a single edge of the layer. • The edge AB should be set into dead. • Two alive edges AN and BN should be added to the layer. 31
  • 32. How to Expand a Layer… • Suppose new point appears outside two edges of the layer. • Edges MP and MQ are added as alive edges to the layer. • Edges MQ and MR are added as alive edges to the layer. • Note that the edge MQ appears twice in the list of edges. 32
  • 33. How to Expand a Layer… • If an edge appears more than once in the list of edges then it should be set into dead. • Therefore, the edge MQ should be set into dead. • The point Q should be transferred to adjacent inner layer. 33
  • 34. Deletion of a Point 34
  • 35. Deletion of a Point… • Suppose the point circled in figure should be deleted. • The corresponding layer should be set into dead first. 35
  • 36. Deletion of a Point… • The points in the deleted layer except the deleted point should be transferred to the adjacent inner layer. 36
  • 38. Analysis of the Algorithm • Suppose that there are n points on the plane. • The convex layers have already been found and suppose that there are k convex layers. • Then each layer contains (n/k) average number of points. • Three cases: • Insertion of a point. • Deletion of a point. • Working in the dynamic context. 38
  • 39. Insertion of a Point • The worst case occurs when the new point appears outside all the layers. • Suppose a point is transferred to a layer. • It takes O (n/k) time to search and set dead the existing edges of a layer. • It takes O [(n/k)2] time to detect duplicate edges in the edge list. • Altogether, it takes O (n/k) + O [(n/k)2] = O [(n/k)2] time to transfer a single point to a layer. • A layer receives O (n/k) points in the worst case. • Therefore, it takes O [(n/k)2] * O (n/k) = O [(n/k)3] time to transfer points between two adjacent layers. • Since there are k layers, it takes O [(n/k)3] * O (k) = O (n3/k2) time to insert a point in the worst case. 39
  • 40. Deletion of a Point • The worst case occurs when a point on the outermost layer is deleted. • All the points except the point to be deleted should be transferred to inner layers. • Thus the deletion problem becomes an insertion problem. • Therefore, it takes O (n3/k2) time to delete a point in the worst case. 40
  • 41. Working in the Dynamic Context • A single point can be inserted or deleted in O (n3/k2) time. • Therefore, the algorithm takes n * O (n3/k2) = O (n4/k2) time to compute the convex layers in the dynamic context. 41
  • 42. Drawbacks of Sanjib & Niraj Algorithm • The algorithm assumes that the set of points does not contain any collinear points. • The authors proposed a theoretical algorithm without providing a corresponding implementation. • The notion of tangent is not available in higher dimensions. 42
  • 44. Conclusions • The proposed algorithm takes O (n3/k2) time to perform an insertion or a deletion of a point whereas Sanjib & Niraj algorithm takes O (n) time. • The proposed algorithm takes O (n4/k2) time in dynamic context whereas Sanjib and Niraj algorithm takes O (n2) time. • The proposed algorithm can handle set of points with coincident points and collinear points. • The proposed algorithm was successfully implemented using C programming language. • The notion used in the proposed algorithm can be extended into higher dimensions. 44