Combnng Opmzaon and Consran Programmng J. N. Hooker Carnege Mellon Unvers 4 h Inernaonal Conference on Operaons Research March Havana
Some work s jon wh Ignaco Grossmann Carnege Mellon Unvers Hak-Jn Km Carnege Mellon Unvers María Aulo Osoro Unversdad Auónoma de Puebla Greger Oosson Uppsala Unverse Erlendur Þorsensson Carnege Mellon Unvers
Opmzaon and consran programmng Opmzaon s an old feld relaed o mahemacs and engneerng. Uses such echnques as lnear neger and nonlnear programmng. Consran programmng s a relavel new feld ha developed n he compuer scence and arfcal nellgence communes. Uses search and consran propagaon o solve problems formulaed n a programmng language.
Opmzaon Lnear and med neger programmng models use a resrced modelng vocabular. Equaons nequales numerc funcons. Models are declarave. Soluon mehods eplo he srucure of problem classes Job shop schedulng problems ravelng salesman problems ec.
Consran Programmng Versale modelng framework. Logcal condons all-dfferen consrans varable ndces. Models are wren n a programmng language. Soluon mehod eplos he srucure of parcular consrans. All-dfferen cumulave (for schedulng) elemen (for varable ndces) ec.
A Modelng Eample Travelng salesman problem: Le c j dsance from c o c j. Fnd he shores roue ha vss each of n ces eacl once.
Ineger Programmng Model Le j f c mmedael precedes c j oherwse mnmze subjec o j j V j W j c j j j j all j all j {} all dsjon V W { n } Subour elmnaon consrans
Consran Programmng Model Le k he kh c vsed. The model would be wren n a specfc consran programmng language bu would essenall sa: Varable ndces mnmze subjec o c k k k all - dfferen( { n } k n ) Global consran
Consran Programmng Model The ravelng salesman problem can also be wren mn s.. j j c j j crcu { } { n } n Where j s he c ha follows c j. The crcu consran requres ha n defne a Hamlonan ccle.
Inegraon of opmzaon and consran programmng Opmzaon and consran programmng have complemenar srenghs. There s much neres n combnng hem. OPL combnes mahemacal programmng from CPLEX wh consran programmng from ILOG Solver bu n a lmed wa. ECLPSe wll combne mahemacal programmng from XPRESS MP wh consran programmng from CHIP. Man problems are beng addressed wh hbrd mehods.
Complemenar srenghs Opmzaon ecels a problems n whch he consrans (or objecve funcon) ma conan man varables as n cos or prof funcons. Relaaon echnques are useful. Consran sasfacon s more effecve on problems n whch he consrans conan few varables. Doman reducon and consran propagaon are useful.
Complemenar srenghs Relaaon removes some consrans o make he problem easer. For eample a connuous relaaon drops negral consrans on varables o oban a lnear or nonlnear programmng problem. Solvng he relaaon gves a bound on he opmal value whch s useful n a branch-and-bound search. Relaaon s especall useful when consrans conan man varables; for eample cos consrans.
Complemenar srenghs The doman of a varable s he se of values can have. Doman reducon deduces ha a gven varable n a consran can ake onl ceran values f ha consran s o be sasfed. Consran propagaon passes he reduced domans o oher consrans where he can be reduced furher. Doman reducon and consran propagaon are useful when he consran conans onl a few varables. For eample n bnar consrans whch conan wo varables.
Complemenar srenghs Opmzaon reles on deep analss of he mahemacal srucure of specfc classes of problems. Parcularl polhedral analss whch elds srong cung planes. Consran sasfacon denfes subses of problem consrans ha have specal srucure. Represens hem wh global consrans (for eample all-dfferen cumulave) and apples alor-made doman-reducon algorhms.
Complemenar srenghs Opmzaon can be ver fas when he problem has specal srucure. Consran sasfacon becomes faser when more consrans are added even f he are unsrucured.
One scheme for negraon Use boh consran propagaon and relaaon durng branch-and-bound search. Use boh relaaons and global consrans o eplo srucure. Appl specal-purpose opmzaon mehods o relaaons. Assocae doman reducon echnques and specalpurpose relaaons wh global consrans.
A movang eample mn subjec o 5 8 5 3 5 3 all- dfferen{ { 4} j 3 3 3 3 } Formulae and solve 3 was: a consran programmng problem an neger programmng problem a combned approach
Solve as a consran programmng problem 4} { } all - dfferen{ 3 5 3 4 8 5 3 3 3 j z Sar wh z. Wll decrease as feasble soluons are found.
Use doman reducon Bounds propagaon on 5 3 8 5 4 For eample 5 3 mples 3 3 3 3 3 5 3 5 8 So he doman of s reduced o {34}. 3 3 z 3
Use doman reducon Manan hperarc conssenc on all - dfferen{ 3 Suppose for eample: 3 4 Doman of Doman of Doman of 3 Then one can reduce he domans: 3 4 }
Use doman reducon Ccle hrough doman reducons and bounds propagaon unl a fed pon s obaned
Doman of Doman of 4 3 4 3 3 4 3 4. z 3 4 3 4 3 4 Doman of 3 D {3} D {4}. z D {} D {3} 3. z 4. z D {} 4 Doman of 7. z 5 3 8. z 5 9. z 5 nfeasble 5 nfeasble 5 4 D {3} 3 4
Solve as an neger programmng problem Le j be f j oherwse. mn 4 subjec o 4 j 5 jk 3 j j 5 j 3 {} 5 4 j 3 3 7 3 all j k
Connuous relaaon Use a lnear programmng algorhm o solve a connuous relaaon of he problem a each node of he search ree o oban a lower bound on he opmal value of he problem a ha node. mn subjec o 4 4 j 5 j j j 3 5 j j 5 4 3 3 7 3 3 all j Rela negral
Branch and bound The ncumben soluon s he bes feasble soluon found so far. A each node of he branchng ree: If Opmal value of relaaon Value of ncumben soluon There s no need o branch furher. No feasble soluon n ha subree can be beer han he ncumben soluon.
3 49 3 / 3 / z 3 4 5 / / z 49.4 9 / / z 5 / / z Infeas. 5.8 3 / /5 z Infeas. Infeas. Infeas. Infeas. Infeas. 5.4 9 / / z z 5 z 54 Infeas. Infeas. Infeas. z 5
Combned approach Use connuous relaaon of orgnal knapsack consran 3 5 3 3 (do no use j s). Use bounds propagaon. Manan hperarc conssenc for all-dfferen. Branch on nonnegral varable when possble; oherwse branch b splng doman.
3 4 ( 4 3) z 54 3 4 3 4 3 4 3 (.7 4 ) z 49.3 3 3 4 3 3 4 3 4 3 4 3 4 (3 3.8 ) z 49.4 nfeasble z 4 3 4 (3 4 ) z 5
Cooperaon beween opmzaon and consran programmng Eplong problem srucure: Global consrans provde a praccal means o ake advanage of specalzed algorhms (opmzaon needs hs). Relaaon echnolog: Opmzaon can suppl connuous relaaons and back propagaon for global consrans (consran programmng needs hs). Inference echnolog: Consran programmng can suppl nference mehods o reduce he search e.g. doman reducon (cung planes srenghen he relaaon).
Cooperaon beween opmzaon and consran programmng Eplong problem srucure: Global consrans provde a praccal means o ake advanage of specalzed algorhms (opmzaon needs hs). Relaaon echnolog: Opmzaon can suppl connuous relaaons and back propagaon for global consrans (consran programmng needs hs). Inference echnolog: Consran programmng can suppl nference mehods o reduce he search e.g. doman reducon (cung planes srenghen he relaaon).
Eplong problem srucure Consran programmng generall processes consrans locall or one a a me (resuls are propagaed hrough he consran sore -- more on hs laer). A global consran represens a specall-srucured se of consrans (all-dfferen crcu elemen cumulave ec.). B processng a global consran one eplos he global srucure of he se of consrans represens. Ever global consran brngs wh a se of procedures (an dea suggesed b he pracce of modelng n a programmng language).
Eplong problem srucure One can also assocae relaaons and back propagaon mehods wh global consrans. (More on hs laer.) Ths provdes a prncple for movng research oupu no commercal code. Doman reducon mehods are normall pu o use rgh awa alhough as a resul man are proprear. Cung plane mehods end o appear n he open leraure bu man are no used n commercal codes (he are desgned for specal problems raher han specal consrans).
Eplong problem srucure One can assocae specalzed cung planes ec. wh global consrans represenng consran ses for whch he cung planes are desgned. For eample he global consran crcu( n ) requres ha n represen a hamlonan ccle on a graph where j vere ha follows vere j. I could nvoke a connuous relaaon ha conans some TSP (separang) cus. Ths can pu o use he large bod of resuls n polhedral analss ha are now emploed onl n specalzed codes.
Eplong problem srucure Ths approach creaes a growng vocabular of global consrans. Ths can ge ou of hand bu consder: The modelng language can eplo he eperse of he user A doman eper horoughl undersands he srucure of he problem n he real world (as opposed o he srucure of s mahemacal represenaon) and global consrans can capure hs srucure.
Eplong problem srucure Eample: cumulave(( n )(d d n )(r r n )L) sar me of job d duraon r rae of resource consumpon L lm on oal rae of resource consumpon a an me Use cumulave(( n )(d d n )( )m) for m-machne schedulng.
Eplong problem srucure The user need onl have advanced knowledge of he vocabular ha apples o hs/her own applcaon doman. A powerful feaure of ordnar language s ha we denf useful conceps ha abbrevae clusers of more elemenar conceps. Ths requres learnng more words bu s nseparable from he ask of learnng how o do he ask a hand. Perhaps s he same wh modelng. The aomsc approach of opmzaon modelng msses hs opporun.
Cooperaon beween opmzaon and consran programmng Eplong problem srucure: Global consrans provde a praccal means o ake advanage of specalzed algorhms (opmzaon needs hs). Relaaon echnolog: Opmzaon can suppl connuous relaaons and back propagaon for global consrans (consran programmng needs hs). Inference echnolog: Consran programmng can suppl nference mehods o reduce he search e.g. doman reducon (cung planes srenghen he relaaon).
Relaaons (IP CP) I s useful o work wh an eample: relaaon of he elemen consran whch s mporan because mplemens varable ndces. Varable ndces are a ke modelng devce for CP. A few models wll llusrae her use.
Varable ndces Travelng salesman problem mn s.. c j j j { n } { n } all- dfferen j or... mn s.. j j c j j crcu { } { n } n
Varable ndces Quadrac assgnmen problem mn s.. j j v c j j all- dfferen { n } { } n se assgned o facl v j raffc beween facl and j c kl dsance beween locaon k and l
Varable Indces Assgnmen problem wh wo lnked formulaons mn some objecve s.. consrans on 's consrans on j 's j j all j emploee assgned me slo j me slo assgned emploee j
Varable Indces The lnkage of wo models mproves consran propagaon. Here a varable (raher han a consan) has a varable subscrp.
Elemen consran The consran c 5 can be mplemened: z 5 elemen( ( c c n ) z ) The consran 5 can be mplemened: z 5 elemen( ( ) n z ) (hs s a slghl dfferen consran)
elemen can be processed wh a dscree doman reducon algorhm ha manans hvperarc conssenc. The more neresng case s oherwse } { f } { { j j j j z D j z z D j D D D D D j D D D D D Elemen consran ) ) ( ( elemen z n
Eample... elemen ( ( 3 4 ) z ) The nal domans are: The reduced domans are: D D D D D D z 3 4 {3689} {34} {5} {} {4589} {457} D D D D D D z 3 4 {89} {3} {5} {} {89} {457}
Connuous relaaon of elemen elemen ( ( c c ) z n ) s rval. The conve hull relaaon s mn { c } z ma { } c elemen ( ( ) z ) has he followng relaaon n m m m D D m D D z z k provded m (and where k D ). k
If m for all hen he conve hull relaaon of elemen ( ( ) z n ) s j D j ( k ) m z D j j plus bounds where k D.
Eample... 5 5 ) ) ( elemen( z The conve hull relaaon s: 5 5 5 z If he above remans vald and we have 4 4 5 9 4 5 z
Dscree lo szng eample Manufacure a mos one produc each da. When manufacurng sars ma connue several das. (R mnmum run lengh). Swchng o anoher produc ncurs a cos. There s a ceran demand for each produc on each da. Producs are sockpled o mee demand beween manufacurng runs. Mnmze nvenor cos changeover cos.
Dscree lo szng eample 3 4 5 6 7 8 job A B A A A A B B A dumm job
{} all all all all all all all all all all s.. mn j r j j j j j j j j s z C R r z z z z s d s q s h δ δ δ δ δ IP model (from L. Wolse)
The model mn s.. oal nvenor changeover cos u v s ( u q v h s C all all d s s ( ) ( ) all all all ( ) ( ) all sock level ) changeover cos dal producon nvenor balance R
Relaaon Pu no relaaon mn s.. u v s u q v h s C all d s s ( ) ( ) all all all ( ) ( ) all ( ) all R Generae nequales o pu no relaaon Appl consran propagaon o everhng
To solve he eample A each node of search ree: Appl doman reducon and consran propagaon. Generae and solve connuous relaaon o ge bound. Characerscs: Relaaon s somewha weaker han n IP because logcal consrans are no all relaed. Bu LP relaaons are much smaller--quadrac raher han cubc sze. Doman reducon helps prune ree.
Back propagaon A global consran can also be assocaed wh a back propagaon scheme whch reduces domans based on soluon of he relaaon. A smple eample s varable fng usng reduced coss now used n boh opmzaon and consran programmng. For nsance one can gve crcu( n ) an assgnmen relaaon. The value of he relaaon ma be useless bu he reduced coss can allow one o eclude values of. Varables j n assgnmen problem need no be defned. Jus use approprae daa srucure o solve problem.
A peek a a modelng framework for negraon Le ever consran have condonal form h ( ) S ( Or be reducble o a se of condonals. ) h () - hard consran (belongng o NP); conans varables ( m ). S () - se of eas consrans (belongng o NP and co-np?) ha wll go no relaaon; conans varables ( n ). The objecve funcon has he form f() g().
The basc search algorhm Branch on domans of varables j. Use nference o deduce when possble wheher parall specfed varables j sasf consrans h (). Solve he relaed problem of mnmzng f() wh respec o subjec o he S () s ha are enforced b rue h () s. Ths relaaon can be srenghened or augmened b oher relaaons f desred. Back-propagae from he soluon of he relaaon. Search for value of conssen wh hs soluon. Connue n a branch-and-rela fashon.
Cooperaon beween opmzaon and consran programmng Eplong problem srucure: Global consrans provde a praccal means o ake advanage of specalzed algorhms (opmzaon needs hs). Relaaon echnolog: Opmzaon can suppl connuous relaaons and back propagaon for global consrans (consran programmng needs hs). Inference echnolog: Consran programmng can suppl nference mehods o reduce he search e.g. doman reducon (cung planes srenghen he relaaon).
Inference (CP IP) Inference acceleraes search b makng he consran se more nearl conssen--.e. b makng mplcaons eplc. The mos popular approach s o reduce domans (am for hperarc conssenc) whch reduces branchng. The research projec of fndng doman reducon algorhms s analogous o dscover of good cung planes. The srucural analss assocaed wh cung plane heor (e.g. specal subgraphs ec.) ma sugges consrans ha are good n he sense ha he move closer o conssenc. For eample alernang pahs n machng correspond o derved consrans (whch srcl domnae facedefnng cus).
Inference (CP IP) 3 Conve hull descrpon of hs machng problem: 3 3 Alernang pah shown corresponds o 3. Ths srcl domnaes boh faces (n - sense). I clearl domnaes. I also ecludes () whch sasfes s face and () whch sasfes nd face.
Inference (CP IP) Doman reducon can be regarded as consran (cu) generaon. To reduce he doman of j s o pos an n-doman consran j D j. The generaed n-doman consrans are normall regarded as formng a consran sorewhch allows communcaon among consrans. Bu he can be regarded as formng a dscree relaaon (.e. opmzaon problem solved o ge a bound) Each doman elemen belongs o some feasble soluon bu smpl pckng an elemen from each doman ma no eld a soluon.
Inference (CP IP) One mgh solve hs relaaon o opmal (usuall rval) and generae separang n-doman consrans. Soluon of relaaon would gude doman reducon. One mgh also allow a broader class of eas consrans n he consran sore. For eample consrans whose dependenc graph has lmed nduced wdh o be solved b nonseral dnamc programmng.