linear programming in computational geometry

25
PROBLEM OF MOLDING LINEAR PROGRAMMING IN COMPUTATIONAL GEOMETRY PROBLEM OF MOLDING HALF PLANE INTERSECTION SOLUTION INCREMENTAL LINEAR PROGRAMMING SOLUTION RANDOMIZATION

Upload: subhashis-hazarika

Post on 20-Jun-2015

151 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Linear programming in computational geometry

•PROBLEM OF MOLDING

LINEAR PROGRAMMING IN

COMPUTATIONAL GEOMETRY

•PROBLEM OF MOLDING

•HALF PLANE INTERSECTION SOLUTION

•INCREMENTAL LINEAR PROGRAMMING SOLUTION

•RANDOMIZATION

Page 2: Linear programming in computational geometry

MANUFACTURING WITH MOLDSa real life problem of computational geometry

� What is mold?

a cavity with same shape as that of object

� Restriction

� What is mold?

a cavity with same shape as that of object

� Restriction� Restrictionobject must have a horizontal top facet

� Castable object

� Restrictionobject must have a horizontal top facet

� Castable object

Page 3: Linear programming in computational geometry

� LEMMA

A polyhedra P can be removed from it’s mold if angle b/w d and n(f) is at least 90 for each ordinary facet ‘f’ of P

where d is the direction of translation of object

and n(f) is the outward normal of facet f

� It leads to the consequence that P can be removed by single

� LEMMA

A polyhedra P can be removed from it’s mold if angle b/w d and n(f) is at least 90 for each ordinary facet ‘f’ of P

where d is the direction of translation of object

and n(f) is the outward normal of facet f

� It leads to the consequence that P can be removed by single � It leads to the consequence that P can be removed by single translation if it can be removed by small translations.

� It leads to the consequence that P can be removed by single translation if it can be removed by small translations.

Page 4: Linear programming in computational geometry

If we consider the direction of movement as upward from origin then the d and n can be considered as

d=(dx, dy,1) &

n=(nx, ny, nz).

Now acc. to Lemma, we have

dx nx+ dyny+ nz<0

which is nothing but the eqn. of a half plane in plane

If we consider the direction of movement as upward from origin then the d and n can be considered as

d=(dx, dy,1) &

n=(nx, ny, nz).

Now acc. to Lemma, we have

dx nx+ dyny+ nz<0

which is nothing but the eqn. of a half plane in planewhich is nothing but the eqn. of a half plane in plane

Z=1

which is nothing but the eqn. of a half plane in plane

Z=1

Page 5: Linear programming in computational geometry

N facet polyhedra will have n-1 such half planes

Common intersection of these planes gives rise to the

region in which the value of

dx and dy lies

empty intersection implies object as empty intersection implies object as empty intersection implies object as empty intersection implies object as uncastableuncastableuncastableuncastable

N facet polyhedra will have n-1 such half planes

Common intersection of these planes gives rise to the

region in which the value of

dx and dy lies

empty intersection implies object as empty intersection implies object as empty intersection implies object as empty intersection implies object as uncastableuncastableuncastableuncastable

problem reduces to solving n-1 half plane eqns to get the common intersection

problem reduces to solving n-1 half plane eqns to get the common intersection

Page 6: Linear programming in computational geometry

ALGORITHM FOR HALF PLANE INTERSECTION

� INPUT := a set H of half planes in the plane

� OUTPUT := the convex polygonal region C

� ALGORITHM INTERSECTHALFPLANES(H)

if card(H) = 1

← ∈

� INPUT := a set H of half planes in the plane

� OUTPUT := the convex polygonal region C

� ALGORITHM INTERSECTHALFPLANES(H)

if card(H) = 1

← ∈then C← the unique half-plane h ∈ H

else Split H into sets H1 and H2 of size n/2 and n/2.

C1 ←INTERSECTHALFPLANES(H1)

C2 ←INTERSECTHALFPLANES(H2)C←INTERSECTCONVEXREGIONS(C1,C2)

Store C as left and right boundary with sorted list of half planes

then C← the unique half-plane h ∈ H

else Split H into sets H1 and H2 of size n/2 and n/2.

C1 ←INTERSECTHALFPLANES(H1)

C2 ←INTERSECTHALFPLANES(H2)C←INTERSECTCONVEXREGIONS(C1,C2)

Store C as left and right boundary with sorted list of half planes

Page 7: Linear programming in computational geometry

INTERSECTCONVEXREGIONS(C1,C2)

USE PLANE SWEEP ALGORITHM

ystart<= min(y1,y2)

where y1 and y2 upper end point of C1 and C2

at every event point, new edge e having p as upper end point appears on boundary

USE PLANE SWEEP ALGORITHM

ystart<= min(y1,y2)

where y1 and y2 upper end point of C1 and C2

at every event point, new edge e having p as upper end point appears on boundaryend point appears on boundary

following cases to be tested when e lies on left boundary of C1

continue

end point appears on boundary

following cases to be tested when e lies on left boundary of C1

continue

Page 8: Linear programming in computational geometry

Case 1Case 1Case 1Case 1

Page 9: Linear programming in computational geometry

Case 2Case 2Case 2Case 2

Page 10: Linear programming in computational geometry

Case 3Case 3Case 3Case 3

Page 11: Linear programming in computational geometry

LINEAR PROGRAMMING:

� In case of casting problem, however, we don’t need to know all solutions to the set of linear constraints; just one solution will do fine. This allows for a faster algorithm, expected time is linear.

� In case of casting problem, however, we don’t need to know all solutions to the set of linear constraints; just one solution will do fine. This allows for a faster algorithm, expected time is linear.

� Finding a solution to a set of linear constraints is LINEAR PROGRAMMING or LINEAR OPTIMIZATION.

� Finding a solution to a set of linear constraints is LINEAR PROGRAMMING or LINEAR OPTIMIZATION.

Page 12: Linear programming in computational geometry

� BASIC CONSTRUCT OF A LP:

� Maximize{Objective function}: c1x1+c2x2+・・・+cdxd

� Subject to {Linear contraints}:

a1,1x1+・・・+a1,dxd ≤ b1a x +・・・+a x ≤ b

� BASIC CONSTRUCT OF A LP:

� Maximize{Objective function}: c1x1+c2x2+・・・+cdxd

� Subject to {Linear contraints}:

a1,1x1+・・・+a1,dxd ≤ b1a x +・・・+a x ≤ ba2,1x1+・・・+a2,dxd ≤ b2

...

an,1x1+・・・+an,dxd ≤ bn

a2,1x1+・・・+a2,dxd ≤ b2...

an,1x1+・・・+an,dxd ≤ bn

Page 13: Linear programming in computational geometry

� Our solution will be the point that maximizes the Objective Function.

� Objective Function can be viewed as a direction c(c1, c2,…, cd ) in the d-dimension plane.

The set of points satisfying the constraints is called feasible

� Our solution will be the point that maximizes the Objective Function.

� Objective Function can be viewed as a direction c(c1, c2,…, cd ) in the d-dimension plane.

The set of points satisfying the constraints is called feasible � The set of points satisfying the constraints is called feasible region else infeasible region.

� Hence our soln. is the point in the feasible region that is extreme in the direction c.

� The set of points satisfying the constraints is called feasible region else infeasible region.

� Hence our soln. is the point in the feasible region that is extreme in the direction c.

Page 14: Linear programming in computational geometry
Page 15: Linear programming in computational geometry

� In case of molding we have n linear constraints in two variables and we want to find one solution to the set of constraints. We can do this by taking an arbitrary objective function, and then solving the linear program defined by the objective function and the linear constraints.

� We use following conventions:

� In case of molding we have n linear constraints in two variables and we want to find one solution to the set of constraints. We can do this by taking an arbitrary objective function, and then solving the linear program defined by the objective function and the linear constraints.

� We use following conventions:

� H is the set of n linear constraints i.e, half-planes: h1 , ... , hn

� Vector defining objective function: c(cx , cy)

� Our goal is to find out point (px , py ) such that cx px +cy pyis max.

� H is the set of n linear constraints i.e, half-planes: h1 , ... , hn

� Vector defining objective function: c(cx , cy)

� Our goal is to find out point (px , py ) such that cx px +cy pyis max.

Page 16: Linear programming in computational geometry

Possible case of intersection:

Page 17: Linear programming in computational geometry

� To make sure that we get a unique soln. we have to impose restrictions on case ii & iii.

� Case ii) we add to our linear program two additional constraints that will guarantee that the linear program is bounded. For example, if cx > 0 and cy > 0 we add the constraints px ≤M and py ≤ M, for some large M ∈ R. let these constraints be m1 & m2 .

� To make sure that we get a unique soln. we have to impose restrictions on case ii & iii.

� Case ii) we add to our linear program two additional constraints that will guarantee that the linear program is bounded. For example, if cx > 0 and cy > 0 we add the constraints px ≤M and py ≤ M, for some large M ∈ R. let these constraints be m1 & m2 .

constraints be m1 & m2 .

� Case iii) we take the lexicographically smallest value.

constraints be m1 & m2 .

� Case iii) we take the lexicographically smallest value.

Page 18: Linear programming in computational geometry

Basis of the algorithm:� Let 1≤ i≤ n, and let Ci and vi be feasible region & optimal point of

each step. Then we have (i) If vi−1 ∈ hi, then vi = vi−1. (ii) If vi−1 ∈ hi, then either Ci = 0 or vi ∈ li, where li is the line bounding hi.

� Let 1≤ i≤ n, and let Ci and vi be feasible region & optimal point of each step. Then we have (i) If vi−1 ∈ hi, then vi = vi−1. (ii) If vi−1 ∈ hi, then either Ci = 0 or vi ∈ li, where li is the line bounding hi.

∈ ∈

bounding hi.∈ ∈

bounding hi.

Page 19: Linear programming in computational geometry

Case ii): finding p on li� It can be reduced to 1-D LP problem of finding p on li that maximizes the OF subject to constraints p ∈ Hi-1 .

Page 20: Linear programming in computational geometry

The interval [ xleft : xright ] is our feasible region and xleft or xright the optimal soln. .It take linear time to calculate this ,i.e: O(n).

Page 21: Linear programming in computational geometry

ACTUAL ALGORITHM:

Page 22: Linear programming in computational geometry
Page 23: Linear programming in computational geometry

RANDOMIZED LINEAR PROGRAMMING:

� Worst case time complexity of Increamental LP is O(n2 ) this can be improved if the order of half planes are suitably changed.

� Worst case time complexity of Increamental LP is O(n2 ) this can be improved if the order of half planes are suitably changed.

� We use a randomize algorithm to get a random sequence of these half planes. Finally, we get an expected time of O(n).

� We use a randomize algorithm to get a random sequence of these half planes. Finally, we get an expected time of O(n).

Page 24: Linear programming in computational geometry
Page 25: Linear programming in computational geometry