introduction to computational geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf ·...

100
Introduction Area Inclusion Hull Art Gallery Introduction to Computational Geometry Partha P. Goswami ([email protected]) Institute of Radiophysics and Electronics University of Calcutta 92, APC Road, Kolkata - 700009, West Bengal, India.

Upload: others

Post on 28-Jun-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction to Computational Geometry

Partha P. Goswami([email protected])

Institute of Radiophysics and ElectronicsUniversity of Calcutta

92, APC Road, Kolkata - 700009, West Bengal, India.

Page 2: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Outline

1 Introduction

2 Area Computation of a Simple Polygon

3 Point Inclusion in a Simple Polygon

4 Convex Hull: An application of incremental algorithm

5 Art Gallery Problem: A study of combinatorial geometry

Page 3: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Computational Geometry (CG) involves study of algorithmsfor solving geometric problems on a computer. The emphasisis more on discrete and combinatorial geometry.

There are many areas in computer science like computergraphics, computer vision and image processing, robotics,computer-aided designing (CAD), geographic informationsystems (GIS), etc. that give rise to geometric problems.

In CG, the focus is more on discrete nature of geometricproblems as opposed to continuous issues.

People deal more with straight or flat objects (lines, linesegments, polygons) or simple curved objects as circles, thanwith high degree algebraic curves.

This branch of study is around thirty years old if one assumesMichael Ian Shamos’s thesis [6] as the starting point.

Page 4: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Computational Geometry (CG) involves study of algorithmsfor solving geometric problems on a computer. The emphasisis more on discrete and combinatorial geometry.

There are many areas in computer science like computergraphics, computer vision and image processing, robotics,computer-aided designing (CAD), geographic informationsystems (GIS), etc. that give rise to geometric problems.

In CG, the focus is more on discrete nature of geometricproblems as opposed to continuous issues.

People deal more with straight or flat objects (lines, linesegments, polygons) or simple curved objects as circles, thanwith high degree algebraic curves.

This branch of study is around thirty years old if one assumesMichael Ian Shamos’s thesis [6] as the starting point.

Page 5: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Computational Geometry (CG) involves study of algorithmsfor solving geometric problems on a computer. The emphasisis more on discrete and combinatorial geometry.

There are many areas in computer science like computergraphics, computer vision and image processing, robotics,computer-aided designing (CAD), geographic informationsystems (GIS), etc. that give rise to geometric problems.

In CG, the focus is more on discrete nature of geometricproblems as opposed to continuous issues.

People deal more with straight or flat objects (lines, linesegments, polygons) or simple curved objects as circles, thanwith high degree algebraic curves.

This branch of study is around thirty years old if one assumesMichael Ian Shamos’s thesis [6] as the starting point.

Page 6: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Computational Geometry (CG) involves study of algorithmsfor solving geometric problems on a computer. The emphasisis more on discrete and combinatorial geometry.

There are many areas in computer science like computergraphics, computer vision and image processing, robotics,computer-aided designing (CAD), geographic informationsystems (GIS), etc. that give rise to geometric problems.

In CG, the focus is more on discrete nature of geometricproblems as opposed to continuous issues.

People deal more with straight or flat objects (lines, linesegments, polygons) or simple curved objects as circles, thanwith high degree algebraic curves.

This branch of study is around thirty years old if one assumesMichael Ian Shamos’s thesis [6] as the starting point.

Page 7: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Computational Geometry (CG) involves study of algorithmsfor solving geometric problems on a computer. The emphasisis more on discrete and combinatorial geometry.

There are many areas in computer science like computergraphics, computer vision and image processing, robotics,computer-aided designing (CAD), geographic informationsystems (GIS), etc. that give rise to geometric problems.

In CG, the focus is more on discrete nature of geometricproblems as opposed to continuous issues.

People deal more with straight or flat objects (lines, linesegments, polygons) or simple curved objects as circles, thanwith high degree algebraic curves.

This branch of study is around thirty years old if one assumesMichael Ian Shamos’s thesis [6] as the starting point.

Page 8: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Any problem that is to be solved using a digital computer hasto be discrete in form. It is the same with CG.

For CG techniques to be applied to areas that involvescontinuous issues, discrete approximations to continuouscurves or surfaces are needed.

Programming in CG is a little difficult. Fortunately, librarieslike LEDA [7] and CGAL [8] are now available. These librariesimplement various data structures and algorithms specific toCG.

CG algorithms suffer from the curse of degeneracies. So, wewould make certain simplifying assumptions at times like nothree points are collinear, no four points are cocircular, etc.

Page 9: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Any problem that is to be solved using a digital computer hasto be discrete in form. It is the same with CG.

For CG techniques to be applied to areas that involvescontinuous issues, discrete approximations to continuouscurves or surfaces are needed.

Programming in CG is a little difficult. Fortunately, librarieslike LEDA [7] and CGAL [8] are now available. These librariesimplement various data structures and algorithms specific toCG.

CG algorithms suffer from the curse of degeneracies. So, wewould make certain simplifying assumptions at times like nothree points are collinear, no four points are cocircular, etc.

Page 10: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Any problem that is to be solved using a digital computer hasto be discrete in form. It is the same with CG.

For CG techniques to be applied to areas that involvescontinuous issues, discrete approximations to continuouscurves or surfaces are needed.

Programming in CG is a little difficult. Fortunately, librarieslike LEDA [7] and CGAL [8] are now available. These librariesimplement various data structures and algorithms specific toCG.

CG algorithms suffer from the curse of degeneracies. So, wewould make certain simplifying assumptions at times like nothree points are collinear, no four points are cocircular, etc.

Page 11: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

Any problem that is to be solved using a digital computer hasto be discrete in form. It is the same with CG.

For CG techniques to be applied to areas that involvescontinuous issues, discrete approximations to continuouscurves or surfaces are needed.

Programming in CG is a little difficult. Fortunately, librarieslike LEDA [7] and CGAL [8] are now available. These librariesimplement various data structures and algorithms specific toCG.

CG algorithms suffer from the curse of degeneracies. So, wewould make certain simplifying assumptions at times like nothree points are collinear, no four points are cocircular, etc.

Page 12: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

In this lecture, we touch upon a few simple topics for having aglimpse of the area of computational geometry.

First we consider some geometric primitives, that is, problemsthat arise frequently in computational geometry.

Page 13: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Introduction

In this lecture, we touch upon a few simple topics for having aglimpse of the area of computational geometry.

First we consider some geometric primitives, that is, problemsthat arise frequently in computational geometry.

Page 14: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Outline

1 Introduction

2 Area Computation of a Simple Polygon

3 Point Inclusion in a Simple Polygon

4 Convex Hull: An application of incremental algorithm

5 Art Gallery Problem: A study of combinatorial geometry

Page 15: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Area Computation

Problem

Given a simple polygon P of nvertices, compute its area.

Area of a convex polygon

Find a point inside P, draw ntriangles and compute the area.

A better idea for convex polygon

We can triangulate P bynon-crossing diagonals into n − 2triangles and then find the area.

A better idea for simple polygon

We can do likewise.

p1

p2pn

pn−1

Page 16: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Area Computation

Problem

Given a simple polygon P of nvertices, compute its area.

Area of a convex polygon

Find a point inside P, draw ntriangles and compute the area.

A better idea for convex polygon

We can triangulate P bynon-crossing diagonals into n − 2triangles and then find the area.

A better idea for simple polygon

We can do likewise.

Page 17: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Area Computation

Problem

Given a simple polygon P of nvertices, compute its area.

Area of a convex polygon

Find a point inside P, draw ntriangles and compute the area.

A better idea for convex polygon

We can triangulate P bynon-crossing diagonals into n − 2triangles and then find the area.

A better idea for simple polygon

We can do likewise.

Page 18: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Area Computation

Problem

Given a simple polygon P of nvertices, compute its area.

Area of a convex polygon

Find a point inside P, draw ntriangles and compute the area.

A better idea for convex polygon

We can triangulate P bynon-crossing diagonals into n − 2triangles and then find the area.

A better idea for simple polygon

We can do likewise.

p1

p2pn

pn−1

Page 19: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Area Computation

Result

If P be a simple polygon with n vertices with coordinates of thevertex pi being (xi , yi ), 1 ≤ i ≤ n, then twice the area of P is givenby

2A(P) =n∑

i=1

(xiyi+1 − yixi+1)

Page 20: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Polygon Triangulation

Theorem

Any simple polygon can be triangulated.

Theorem

A simple polygon can be triangulated into (n − 2) triangles by(n − 3) non-crossing diagonals.

Proof.

The proof is by induction on n.

Time complexity

We can triangulate P by a very complicated O(n) algorithm [2]OR by a more or less simple O(n log n) time algorithm [1].

Page 21: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Polygon Triangulation

Theorem

Any simple polygon can be triangulated.

Theorem

A simple polygon can be triangulated into (n − 2) triangles by(n − 3) non-crossing diagonals.

Proof.

The proof is by induction on n.

Time complexity

We can triangulate P by a very complicated O(n) algorithm [2]OR by a more or less simple O(n log n) time algorithm [1].

Page 22: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Polygon Triangulation

Theorem

Any simple polygon can be triangulated.

Theorem

A simple polygon can be triangulated into (n − 2) triangles by(n − 3) non-crossing diagonals.

Proof.

The proof is by induction on n.

Time complexity

We can triangulate P by a very complicated O(n) algorithm [2]OR by a more or less simple O(n log n) time algorithm [1].

Page 23: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Polygon Triangulation

Theorem

Any simple polygon can be triangulated.

Theorem

A simple polygon can be triangulated into (n − 2) triangles by(n − 3) non-crossing diagonals.

Proof.

The proof is by induction on n.

Time complexity

We can triangulate P by a very complicated O(n) algorithm [2]OR by a more or less simple O(n log n) time algorithm [1].

Page 24: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Outline

1 Introduction

2 Area Computation of a Simple Polygon

3 Point Inclusion in a Simple Polygon

4 Convex Hull: An application of incremental algorithm

5 Art Gallery Problem: A study of combinatorial geometry

Page 25: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Point Inclusion

Problem

Given a simple polygon P of npoints, and a query point q, isq ∈ P?

What if P is convex?

Easy in O(n). Takes a little effortto do it in O(log n). Left as anexercise.

Another idea for convex polygon

Stand at q and walk around thepolygon. We can show the sameresult for a simple polygon also.

q P

Page 26: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Point Inclusion

Problem

Given a simple polygon P of npoints, and a query point q, isq ∈ P?

What if P is convex?

Easy in O(n). Takes a little effortto do it in O(log n). Left as anexercise.

Another idea for convex polygon

Stand at q and walk around thepolygon. We can show the sameresult for a simple polygon also.

qp1p2 p3

p4

p5

p6

p7

p8

p9q

q is always to the right if q ∈ P ,else, it varies

Page 27: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Point Inclusion

Problem

Given a simple polygon P of npoints, and a query point q, isq ∈ P?

What if P is convex?

Easy in O(n). Takes a little effortto do it in O(log n). Left as anexercise.

Another idea for convex polygon

Stand at q and walk around thepolygon. We can show the sameresult for a simple polygon also.

q

p1p2 p3

p4

p5

p6

p7

p8

p9q

Total angular turn around q is 2π if q ∈ P ,else, 0

Page 28: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Point Inclusion

Another technique: Ray Shooting

Shoot a ray and count thenumber of crossings with edgesof P. If it is odd, then q ∈ P. Ifit is even, then q 6∈ P. Somedegenerate cases need to behandled. Time taken is O(n).

qP

q

Page 29: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Outline

1 Introduction

2 Area Computation of a Simple Polygon

3 Point Inclusion in a Simple Polygon

4 Convex Hull: An application of incremental algorithm

5 Art Gallery Problem: A study of combinatorial geometry

Page 30: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

Page 31: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

convex not convex

p

q

p

q

pqpq

Page 32: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

Page 33: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

Page 34: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

Page 35: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

Definition

A set S ⊂ R2 is convex If for anytwo points p, q ∈ S, pq ∈ S.

Definition

Let P be a set of points in R2.Convex hull of P, denoted byCH(P), is the smallest convexset containing P.

Hull edge

Hull vertex

Page 36: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Convex Hull Problem

Problem

Given a set of points P in the plane, compute the convex hullCH(P) of the set P.

Page 37: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Outline

Consider all line segmentsdetermined by

(n2

)= O(n2)

pairs of points.

If a line segment has all theother n − 2 points on oneside of it, then it is a hulledge.

We need(n2

)(n − 2) = O(n3) time.

Page 38: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Outline

Consider all line segmentsdetermined by

(n2

)= O(n2)

pairs of points.

If a line segment has all theother n − 2 points on oneside of it, then it is a hulledge.

We need(n2

)(n − 2) = O(n3) time.

p

q

Page 39: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Outline

Consider all line segmentsdetermined by

(n2

)= O(n2)

pairs of points.

If a line segment has all theother n − 2 points on oneside of it, then it is a hulledge.

We need(n2

)(n − 2) = O(n3) time.

p

q

Page 40: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Towards a Better Algorithm

How much betterment is possible?

Better characterizations lead to better algorithms.

How much better can we make?

Leads to the notion of lower bound of a problem.

The problem of Convex Hull has a lower bound of Ω(n log n).This can be shown by a reduction from the problem of sortingwhich also has a lower bound of Ω(n log n).

Page 41: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Towards a Better Algorithm

How much betterment is possible?

Better characterizations lead to better algorithms.

How much better can we make?

Leads to the notion of lower bound of a problem.

The problem of Convex Hull has a lower bound of Ω(n log n).This can be shown by a reduction from the problem of sortingwhich also has a lower bound of Ω(n log n).

Page 42: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Towards a Better Algorithm

How much betterment is possible?

Better characterizations lead to better algorithms.

How much better can we make?

Leads to the notion of lower bound of a problem.

The problem of Convex Hull has a lower bound of Ω(n log n).This can be shown by a reduction from the problem of sortingwhich also has a lower bound of Ω(n log n).

Page 43: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Towards a Better Algorithm

How much betterment is possible?

Better characterizations lead to better algorithms.

How much better can we make?

Leads to the notion of lower bound of a problem.

The problem of Convex Hull has a lower bound of Ω(n log n).This can be shown by a reduction from the problem of sortingwhich also has a lower bound of Ω(n log n).

Page 44: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Optimal Algorithms

Grahams scan, time complexity O(nlogn).(Graham, R.L., 1972)

Divide and conquer algorithm, time complexity O(nlogn).(Preparata, F. P. and Hong, S. J., 1977)

Jarvis’s march or gift wrapping algorithm, time complexityO(nh) where h is the number of vertices of the convex hull.(Jarvis, R. A., 1973)

Most efficient algorithm to date is based on the idea ofJarvis’s march, time complexity O(nlogh).(T. M. Chan, 1996)

Page 45: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 46: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 47: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 48: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 49: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 50: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Definitions

A better characterization

Consider a walk in clockwise directionon the vertices of a closed polygon.

Only for a convex polygon, we willmake a right turn always.

The incremental paradigm

Insert points in P one by one andupdate the solution at each step.

We compute the upper hull first. Theupper hull contains the convex hulledges that bound the convex hull fromabove.

Sort the points in P from left to right.

upper hull

lower hull

p1pn

Page 51: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 52: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 53: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 54: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 55: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 56: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 57: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 58: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

A Naive Algorithm

Input: A set P of n points in the plane

Output: Convex Hull of P

Sort P according to x-coordinate to generate

a sequence of points p[1], p[2], ..., p[n];

Insert p[1] and then p[2] in a list L_U;

for i = 3 to n

Append p[i] to L_U;

while(L_U contains more than two points AND

the last three points in L_U

do not make a right turn)

Delete the middle of the last

three points from L_U;

Page 59: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 60: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 61: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 62: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 63: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 64: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 65: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 66: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 67: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 68: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 69: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 70: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 71: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 72: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

The Algorithm in Action

p1pn

Page 73: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 74: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 75: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 76: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 77: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 78: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 79: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Analysis

Time complexity

Sorting takes time O(n log n).

The for loop is executed O(n) times.

For each execution of the for loop, the while loop isencountered once.

For each execution of the while loop body, a point getsdeleted.

A point once deleted, is never deleted again.

So, the total number of executions of the while loop body isbounded by O(n).

Hence, the total time complexity is O(n log n).

Page 80: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Outline

1 Introduction

2 Area Computation of a Simple Polygon

3 Point Inclusion in a Simple Polygon

4 Convex Hull: An application of incremental algorithm

5 Art Gallery Problem: A study of combinatorial geometry

Page 81: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

The problem

Given a simple polygon P of nvertices, find the minimum numberof cameras that can guard P.

Hardness

The above problem is NP-Hard.

Any solution?

Can we find, as a function of n,the number of cameras thatsuffices to guard P?

Recall P can be triangulatedinto n − 2 triangles. Place aguard in each triangle.

Page 82: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

The problem

Given a simple polygon P of nvertices, find the minimum numberof cameras that can guard P.

Hardness

The above problem is NP-Hard.

Any solution?

Can we find, as a function of n,the number of cameras thatsuffices to guard P?

Recall P can be triangulatedinto n − 2 triangles. Place aguard in each triangle.

Page 83: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

The problem

Given a simple polygon P of nvertices, find the minimum numberof cameras that can guard P.

Hardness

The above problem is NP-Hard.

Any solution?

Can we find, as a function of n,the number of cameras thatsuffices to guard P?

Recall P can be triangulatedinto n − 2 triangles. Place aguard in each triangle.

Page 84: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

The problem

Given a simple polygon P of nvertices, find the minimum numberof cameras that can guard P.

Hardness

The above problem is NP-Hard.

Any solution?

Can we find, as a function of n,the number of cameras thatsuffices to guard P?

Recall P can be triangulatedinto n − 2 triangles. Place aguard in each triangle.

Page 85: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

The problem

Given a simple polygon P of nvertices, find the minimum numberof cameras that can guard P.

Hardness

The above problem is NP-Hard.

Any solution?

Can we find, as a function of n,the number of cameras thatsuffices to guard P?

Recall P can be triangulatedinto n − 2 triangles. Place aguard in each triangle.

Page 86: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

Can the bound be reduced?

Place guards at vertices of thetriangulation T of P.

We do a 3-coloring of thevertices of T . Each triangle ofT has a blue, gray and whitevertex.

Choose the smallest color classto guard P.

Hence, bn3c guards suffice.

But, does a 3-coloring alwaysexist?

Page 87: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

Can the bound be reduced?

Place guards at vertices of thetriangulation T of P.

We do a 3-coloring of thevertices of T . Each triangle ofT has a blue, gray and whitevertex.

Choose the smallest color classto guard P.

Hence, bn3c guards suffice.

But, does a 3-coloring alwaysexist?

Page 88: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

Can the bound be reduced?

Place guards at vertices of thetriangulation T of P.

We do a 3-coloring of thevertices of T . Each triangle ofT has a blue, gray and whitevertex.

Choose the smallest color classto guard P.

Hence, bn3c guards suffice.

But, does a 3-coloring alwaysexist?

Page 89: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

Can the bound be reduced?

Place guards at vertices of thetriangulation T of P.

We do a 3-coloring of thevertices of T . Each triangle ofT has a blue, gray and whitevertex.

Choose the smallest color classto guard P.

Hence, bn3c guards suffice.

But, does a 3-coloring alwaysexist?

Page 90: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

Can the bound be reduced?

Place guards at vertices of thetriangulation T of P.

We do a 3-coloring of thevertices of T . Each triangle ofT has a blue, gray and whitevertex.

Choose the smallest color classto guard P.

Hence, bn3c guards suffice.

But, does a 3-coloring alwaysexist?

Page 91: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

Page 92: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

Page 93: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

Page 94: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

Page 95: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

Page 96: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Problem

A 3-coloring always exist

Consider the dual graph GT ofT of P.

GT is a tree as P has no holes.

Do a DFS on GT to obtain thecoloring.

Place guards at those verticesthat have color of the minimumcolor class. Hence, bn3c guardsare sufficient to guard P.

Necessity?

Are bn3c guards sometimesnecessary?

bn3 c prongs︷ ︸︸ ︷

Page 97: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Art Gallery Theorem

Final Result

For a simple polygon with n vertices, bn3c cameras are alwayssufficient and occasionally necessary to have every point in thepolygon visible from at least one of the cameras.

Page 98: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

References I

Mark de Berg, Marc van Kreveld, Mark Overmars and OtfriedSchwarzkof, Computational Geometry: Algorithms andApplications, Springer, 1997.

B. Chazelle, Triangulating a simple polygon in linear time,Discrete Comput. Geom., 6:485524, 1991.

Herbert Edelsbrunner, Algorithms in Computational Geometry,Springer, 1987.

Joseph O’Rourke, Computational Geometry in C, CambridgeUniversity Press, 1998.

Franco P. Preparata and Michael Ian Shamos, ComputationalGeometry: An Introduction, Springer-Verlag, New York, 1985.

Michael Ian Shamos, Computational Geometry, PhD thesis,Yale University, New Haven., 1978.

Page 99: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

References II

http://www.algorithmic-solutions.com

http://www.cgal.org

http:

//en.wikipedia.org/wiki/Computational_geometry

Page 100: Introduction to Computational Geometrycs.rkmvu.ac.in/.../nitk_igga/slides/ppg-introgeom.pdf · 2012-03-10 · Introduction Computational Geometry (CG) involves study of algorithms

Introduction Area Inclusion Hull Art Gallery

Thank you!