0% found this document useful (0 votes)
6 views

Sol Assignment 5 24

Uploaded by

metavis527
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Sol Assignment 5 24

Uploaded by

metavis527
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ASSIGNMENT 5

Four problems, and then 12.9-8 of H&L

Q.1. Use the variable fixing technique to fix the values of the

variables as many as

possible in the following 0-1 constraints:

30x1-20x2 +40x3 + 17x4 -23x5 + 11x6 ≤ 70----------------(A)

23x1 +15x2 +30x3- 27x4+ 13x5- 21x6 ≥ 61----------------(B)

From (B) we must have x1=x3=1, since if either of them is 0,

LHS cannot add up to 61

Hence, the equations now become:

-20x2 + 17x4 -23x5 + 11x6 ≤ 0----------------(C)

15x2 - 27x4+ 13x5- 21x6 ≥ 8----------------(D)

From (D) we note that:

x4 = x6=0

(Since there is no way that (D) could otherwise be satisfied)

So the equations now reduce to:

-20x2 -23x5 ≤ 0----------------(E)

15x2 + 13x5 ≥ 8----------------(F)

(E) imposes no restrictions on the variables, but (F) indicates

that at least one of x2 and x5 must be non-zero

So finally, we have:
2

x1 = x3=1, x4 = x6=0 AND x2 + x5 ≥ 1

Q. 2. You have to transport 42 tons of freight using 8 trucks,

which come in 4 sizes, with various other information as per

Table below, so as to minimize costs (clearly, nos. of trucks

are INTEGERS), using Domain Reduction, Constraint

Propagation, Cutting planes and other techniques, NOT

software packages!):

Truck size (in No. Capacity Cost per

descending order) availabl (Tons) Truck (Rs.)

1 3 7 90

2 3 5 60

3 3 4 50

4 3 3 40

Let x’s denote no. of each truck, then:

min 90x1+60x2+50x3+40x4

s.t.

7x1+5x2+4x3+3x4 ≥42---------------------(I)

x1+x2+x3+x4≤8

All xi integer є {0, 1, 2, 3} for i={1, 2, 3, 4}


3

Consider x2, x3, x4

Now multiply availability and capacity: 3(5+4+3)=36,

whereas 42 tons need to be transported

Hence x1≥1 ----------------------(A)

Again, consider trucks 1 and 2 together: 3(7+5)=36, hence

cannot satisfy requirement of tonnage (=42)

Hence, (I) leads to:

4x3+3x4≥ (42-36=6),

Since capacities of x3 and x4 are individually less than 6, this

equation thus implies that:

x3+x4 ≥2 ----------------------(B)

Likewise, considering {1, 3} and {1, 4 } as sets we get

respectively: x2+x4 ≥2 and ----------------------(C)

x2+x3 ≥3 ----------------------(D)

Recall that in all, ONLY 8 trucks can be used

Looking at (B), (C), and (D), first we note that putting

x2=x3=x4=1 does not satisfy (D), so at least one of x2 or x3

must be increased Next, looking at cost/capacity ratio, we

note it is min for x2, also that putting x2=2 and x3=1, x4=1

(along with x1=1) satisfies all constraints, but doesn’t add up

to freight
4

So, it seems best to increase x2=2 further, so now x2=3, we

can do it without further violating any constraint.

At this stage (with x1=1 and x2=3), we have used up four

trucks, and we can check that no combination of x 3 and x4

adding up to 4 trucks can satisfy the remaining freight

requirement (=20 tons)

Hence, x1≥2

(If you get somewhere up to this point, you get FULL credit)

Proceeding in this way we will finally get {3, 3, 0, 2} as

optimal with a cost of 530

If we consider LP relaxation of the original problem, we get a

value of 523 1/3, so 530 seems good enough!

Proceeding by stopping at x2=2, we get alternate optimal

(3,2, 2, 1)

Q.3. Coach Night is trying to choose the starting lineup for

the basketball team. The team consists of seven players who

have been rated on a scale of 1(poor) to

3(excellent)according to their ball-handling, shooting,

rebounding, and defensive abilities. The positions that each

player is allowed to play and the player’s abilities are listed

in the Table below:


5

Of the seven players, Coach Night wishes to choose the best

four so as to maximize the ratings. He will decide the other

players and the remaining positions by a different system

later. In choosing the line-up, each of the four different

abilities must be represented. Specifically, one of the players

must be uniquely designated to take care of one of the

components (abilities).

PLAYER 1 2 3 4 5 6 7

Ball 3 2 2 1 1 3 3

handling

Shooting 3 1 3 3 3 1 2

Reboundin 1 3 2 3 1 2 2

Defense 3 2 2 1 2 3 1

How would you help Coach Night choose the four players?

Use global constraints to formulate a compact constraint

programming model for this problem

Let’s start with the conventional formulation, so we can

observe how we have improved it:

Let
6

xij=1 if ith ability is allotted to a player, and x ij=0, otherwise

tij=rating given to jth player in utilising ith ability

Ɐ means for all

We then have:

Max ∑tijxij, i=1 to 4, j=1 to 7

S.T.

∑xij=1, Ɐi separately, Summation j 1 to 7

(ensures each ability assigned to only one player)

∑xij≤1, Ɐj separately, Summation i 1 to 4

(ensures each player represents at most one ability)

For Constraint Programming formulation,

Let yi=Player who represents ability i

We then have:

Max Z=∑zi,

Element (yi, [ti1, ti2, ti3, ti4, ti5], zi], i= 1 to 4

All different (y1, y2, y3, y4, y5, y6, y7)

yi є {1, 2, 3, 4, 5, 6, 7}, i= 1 to 4

(Recall that Max can readily be converted to Min for

Assignment)
7

Q. 4. Problem 11.3-5 of H&L, with the following

modifications. Instead of solving the problem by Dynamic

Programming (which we have not covered so far), proceed

as follows: FORMULATE (do not solve) a compact Constraint

Programming model for this problem. By way of contrast,

also provide a conventional formulation, as if you were

unaware of Constraint Programming

Let xij=1 if i workers are assigned to precinct j, and x ij=0

otherwise

And let Πij be the total estimated increase in the plurality of

the party’s candidate if i workers are assigned to precinct j

Then we have Conventional formulation:

Max ΣΠijxij

ST:

xij BIN

Σxij ≤1 Ɐj separately, j є {1, 2, 3} Summation i 0 to 6

(A given precinct can get any no. of workers from 0 to 6)

Σxij ≤floor (6/i), Ɐ i є {1, 2, 3, 4, 5, 6} Summation j 1 to 4

(Floor means the INT part of a number, disregarding the

fractional part)

Σxij ≤ 6, i=0 Summation j 1 to 4


8

(The last two constraints ensure that allocation can’t exceed

5)

Now for Constraint Programming formulation,

Let yj=number of workers assigned to precinct j,

Then we have:

Max Σzjyj

Element (yj, [Π0j, Π1j, Π2j, Π3j, Π4j, Π5j, Π6j,], zj), i= 0 to 6

yj є {0, 1, 2, 3, 4, 5, 6}, j є {1, 2, 3, 4}

y1+y2+y3+y4=6

(‘=’ used instead of ‘≤’, since each entry in the table is

positive)

12.9-8 (H&L)

Let us number the cities 1 to n, and start and end the tour

with city 1

Introduce a dummy variable, call it ‘0’, and add a row of

costs, c[0][.], where ‘.’ reproduces the same costs as in the

row of costs of city 1

Let the diagonal elements have cost M, large enough that

they would never be considered (no city can be succeeded

by itself). Additionally, put cost c[0][1]=M, and put c[.]


9

[0]=M, where ‘.’ represents all cities (thus ensuring that

these journeys will never be undertaken).

Let x[j] represent the jth city on the route, set x[0]=0, and

x[n]=1

(Thus, ensuring that tour starts and ends at city 1)

Then, the objective function is:

Min Σ z[x[j]]

Summed over x[j], j є{0, 1, 2,…n-1}

(We are using bracket notation to avoid too many subscripts,

and to make the formulation more comprehensible)

With the variables defined and the constraints being as

under:

Element (x[j], k[j]; c[x[j][1], c[x[j]][2],…,c[x[j]][n], z[x[j]]),

x[j+1]=k[j], j є{0, 2,…n-1}

All different (x[j], j є{0, 1, 2,…n-1, n},

x[j], k[j] Integer

k[j] references the column from which the cost is chosen,

corresponding to the row of x[j] i.e., city at which the tour is,

at present, and thus giving us x[j+1], i.e., the next city that

would be visited. We need to add this variable in the

formulation, which was not required in the problems done in

class.
10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy