340 likes | 354 Views
Lecture 8 Indicator Variables Traveling Salesman Problem. Outline. an indicator for =-constraint relationship between indicator and proposition statement sequencing jobs traveling salesman problem. An Indicator to Represent a =-Constraint. =-Constraint.
E N D
Outline an indicator for =-constraint relationship between indicator and proposition statement sequencing jobs traveling salesman problem 2
=-Constraint • an equality constraint an - constraint and an -constraint 4
Model = 1 =-Constraint • = 1 2x1 + 5x2 = 9 = 1 (2x1 + 5x2 9 and 2x1 + 5x2 9) • from the previous results 2x1 + 5x2 + M M + 9 and 2x1 + 5x2 + MM + 9 5
Model =-Constraint = 1 • 2x1 + 5x2 = 9 = 1 = 0 2x1 + 5x2 9 • 2x1 + 5x2 9: either 2x1 + 5x2< 9 or 2x1 + 5x2> 9, but not both • from previous results: 2x1 + 5x2 + M1 9 + , 2x1 + 5x2M2 + 9 , 1 + 2 = + 1 6
Model =-Constraint = 1 • to model 2x1 + 5x2 = 9 iff = 1 • 2x1 + 5x2 + M M + 9, • 2x1 + 5x2 + MM + 9, • 2x1 + 5x2 + M1 9 + , • 2x1 + 5x2M2 + 9 , • 1 + 2 = + 1. 7
Logical Proposition • a logical proposition is a statement with true/false value • examples of logical propositions • the sun rises in the north • the box is empty • container j is put on top of container k 9
Equivalence Between Logical Propositions and Indicators : 1 or 0 P: true or false P logical operations for P mathematical operations for (and other variables) 10
Logical Proposition • logical operations • (i.e., and), (i.e., or), ~ (i.e., negation), (i.e., implication), (i.e., equivalence) 11
Equivalence Between Logical Operations & Mathematical Operations (P1P2) (~P1P2) 12
A Two-Column, Four-Tier Stack • slots (i, j), i = 1 to 4 & j = 1, 2, for storing containers • logical proposition Pij: slot (i, j) is occupied • an indicator xij = 14
A Two-Column, Four-Tier Stack • (a). Pij is true xij = 1 • (b). Pij is false ~Pij is true 1-xij = 1 xij = 0 • (c). for slots (1, 1) and (1, 2), P11P12x11 + x12 2 • (d). (1, 1) and (1, 2) cannot be both empty, P11P12x11 + x12 1 • (e). exactly one of slots (1, 1) and (1, 2): P11 XOR P12 (i.e., (~P11P12) (P11 ~P12)) x11 + x12 = 1 • (f). a container cannot float in air, Pi,jPi-1,j ~ Pi,jPi-1,j (1 – xi,j) + xi-1,j 1 xi-1,jxi,j 15
Order of Jobs with Sequence-Independent Processing Times (First Formulation) 16
Order of Jobs with Sequence-Independent Processing Times • three truckloads of goods, beer, frozen meat, and ice cream, transported by a refrigerating truck • pk be the transportation time for type k goods, k {b, f, i} • find by an optimization model the transportation order of goods that minimizes the total completion time completion time of a job: the time that the job is completed 17
Order of Jobs with Sequence-Independent Processing Times • objective: minimizing the total completion time • s.t. a set of constraints that (i) determine the processing order of jobs, and (ii) completion times of jobs Job 1 2 . . . n Rank 8 11 . . . 2 an embedded assignment model: 18
Order of Jobs with Sequence-Independent Processing Times • objective: minimizing the total completion time • s.t. • each job can take one rank • each rank can be taken by one job • with the ranks of jobs known, the completion times of jobs can be found Job 1 2 . . . n Rank 8 11 . . . 2 an embedded assignment model: 19
Order of Jobs with Sequence-Independent Processing Times • tj: the completion time of the rank-j job 20
Order of Jobs with Sequence-Independent Processing Times (Second Formulation) 22
Order of Jobs with Sequence-Independent Processing Times • any idea to formulate other than the job-rank assignment? • yes, knowing the pairwise order 23
Order of Jobs with Sequence-Independent Processing Times • objective: summing the completion times • s.t. • completion time of an earlier job + processing time of a latter job completion time of the latter job 24
Order of Jobs with Sequence-Independent Processing Times • tk = the completion time of type k goods, k {b, f, i} • note: the definition cares only sending after or not, not necessarily immediately after 25
Order of Jobs with Sequence-Independent Processing Times • min tb+tf+ti, • s.t. • either beer before frozen meat, or frozen meat before beer, but not both • if beer before frozen meat, the completion time of frozen meat is no earlier than the completion time of beer + the transportation time for frozen meat • … 26
Order of Jobs with Sequence-Independent Processing Times • min tb+tf+ti, • s.t. • bf + fb = 1; bi + ib = 1; fi + if = 1; • tb + piti + M(1 bi); ti + pbtb + M(1 ib); • tf + piti + M(1 fi); ti + pftf + M(1 if); • tb + pftf + M(1 bf); tf + pbtb + M(1 fb); • kl {0, 1}, k, l {b, f, i}, kl; • tk 0, k {b, f, i}. 27
Questions • is it necessary to have bf + fb = 1; bi + ib = 1; fi + if = 1 in the second formulation? • yes, otherwise may have kl = 0 for all k, l • which is a better formulation, the first or the second? 28
Order of Jobs with Sequence-Dependent Processing Times(An Incomplete Formulation) 29
Order of Jobs with Sequence-Dependent Processing Times • three truckloads of goods, beer, frozen meat, and ice cream, to be transported • cleaning between two trips • no cleaning for the first trip • cleaning time ckl : depend on the types of goods k just sent and l to be sent • find by an optimization model the transportation order of goods that minimizes the total cleaning time 30
Order of Jobs with Sequence-Dependent Processing Times • need to model consecutive jobs k, l {b, f, i}. k l; s.t. something before a job something after a job kl {0, 1, k,l {b, f, i}, k l. What is wrong with this formulation? 31 The first job has none before it; the last job has none after it
Order of Jobs with Sequence-Dependent Processing Times k, l {b, f, i}. k l; s.t. kl {0, 1, k,l {b, f, i}, k l. 32 What is wrong with this formulation?
Order of Jobs with Sequence-Dependent Processing Times s.t. kl {0, 1, k,l {b, f, i}, k l. • the solution i = 1, bf = 1, fb = 1, i = 1 satisfies all constraints, but is physically unfeasible 33
Order of Jobs with Sequence-Dependent Processing Times • problem of sub-cycle • the set of constraints b + fb + ib = 1, f + bf + if = 1, i + bi + fi = 1 only specifies one job (or no job) before a given job • the set of constraints b + bf + bi = 1, f + fb + fi = 1, b + ib + if = 1 only specifies one job (or no job) after a given job • there is no guarantee that the sequence of job defined by kl satisfies the physical conditions, such as no sub-cycle • problem of a repeated job • the constraint b + f + i = 1 only specifies one job as the first one • the constraint b + f + i = 1 only specifies one job as the last one • there is no guarantee that the first job is different from the last job 34