linear programming in computational geometry

Post on 20-Jun-2015

145 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

•PROBLEM OF MOLDING

LINEAR PROGRAMMING IN

COMPUTATIONAL GEOMETRY

•PROBLEM OF MOLDING

•HALF PLANE INTERSECTION SOLUTION

•INCREMENTAL LINEAR PROGRAMMING SOLUTION

•RANDOMIZATION

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

� 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.

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

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

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

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

Case 1Case 1Case 1Case 1

Case 2Case 2Case 2Case 2

Case 3Case 3Case 3Case 3

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.

� 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

� 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.

� 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.

Possible case of intersection:

� 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.

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.

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 .

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).

ACTUAL ALGORITHM:

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).

top related