Docsity

Optimización - Parte 1, Apuntes de Métodos Matemáticos para Análisis Numérico y Optimización

Vista previa parcial del texto

¡Descarga Optimización - Parte 1 y más Apuntes en PDF de Métodos Matemáticos para Análisis Numérico y Optimización solo en Docsity!

14/11 Dd. Simplex Algorikhm ito e We start from a verkex PA We explore adj vertices, we move do khe verkex wi£h Lie BEST overall improvemeist over khe OBIECTIVE 15) FUNCTION we Lerminake 18 we cannok improve Lu arrank elution, he ¿tonvex sek and conver objective function) AS WORST CASE : Exponential AVERAGE CASE : Polynomial «STEP 4: SLandard Form 2 > IXL+ UML maxE = 3X44 1 X2 + Xo, subject do: der ds AA IxL 4x2 GD X1+ 2Xz < 7 —— A + sa 4 0 ea Xa+53=6 po with: pode A Xa,X2,X3 0 1,X2,X% > 31,52,57 7+<0 1] “STEP 2: Tnibial tabléaw 4] CONSTI/VAR. Xu [X21X3 51 52 53 SOLUTION EA Ad a a! to Se 0.1.0 3 o 0x4 6 2 0:00 Q 4 maz (4) -STEP 3: Opkimaliky P The current solution 1s oplimal ¿£ 1 Melare mainizing and all reduced costes are » O Xa =X2=X3=0 0 are minimizing_ amd all reduced coskó ore <0 z=-0 5=40,%9.=8,93=6 - GTEP LU: Select variable Lo ente- Lh2 basis To charge e current solution ko an adiacent one we nted a change of basis: A NVB entes Lie basis and a Bv leaves Ehe basis. ' To selgce Lhe NVB trar entes the basis : «The smallesh reduced cosk for maximitabion - The larqusk reduced cosb for minimizaLion + BreaX bí05 ín Any way we sect «UL Le column. TE becomes £he PIVOT CoLUMn. Y) 3, Simplex Algorílm - STEP 51 Select variablo to law +he basis TM variable Lhad leaves Lhe basis ls Le one wikh bie lowtsé DIVISION between Me Solubion column and e pivob column. CONST./VAR — Xa ¿X2 X9 51 72, .% SoLuTION X1=X2=X3=0 an Él 4o/4 40 A 52 e 8/2 (0) 512105 52>8 17 Sa o 2-0 aj-Cj No | Pivor o [ The comparison ont affecks STRÍCLY POSITIVE coeficiente for the pivok column I * STEP G: Chorgr of basis we seel a "4 ne ehe intersection belween chosen column and row. We divide Lhe whole row by £he COEFFICIENT ati che INTERSECTION cf bokh. R2' =R2/2 CONST./VAR ' Xz ; xo! Xx» $. 5 ' $, ' SoLuTion 54 slatdia io” das S2 Ex: 100% 0 4] SS 0404012. 01.04 6 > ao ya E 000. 0 Now we aim ko pe a NEW TDENTITY MATRIX column in L£he PivoT COn AN We make "0" any oler corfficiene in he column by deíng. LINEAR ComBINATIONS o£ £he chose, row and Ln other row frvolved.. RA Ra Ra, ll aj-cjY = (ejer URZ' 2. X1:2X320;YX2=4 CONST.[VAR Xa ¡X2l X3 1 2 %3 SOLUTION S1:65$2=0; = da 5 ¡0182 1 -%0 crea Ed 4 Xz [272 ¡430 . 00% q Y], Ra q 9 (SA 6 , 4-5 0 00.020 46 (2j-cj)= (apo) UR2! + STEP : Opkimality P ad We uplake basic and non- basic variables , 05 well as khe OBFTECTIVE FUNCTION TS bhe new solution OPTÍMAL P NOT YETI We have somo NEGATIVE reduced costs. . We opuate agria the ¿kunkion: CONST./VAR E XA! X2 Xx 31 Se 99 SOLUTION Q Variable o enter: xa Sa Usnajo 4 1-40. 6% (variable to loave: sa (6/(5/2) =12/5) xa MWaejpara 0.0tv4W0 y ulimt (E) Change of bags 53 0:0 4000141 6 RA! = RA/(5/2) 2404: Mia vo 4.10. 2 0 16 R2' =R2- Y, Ra! ajaj! (2j-cj) + 7 4, branch and Bowd We skark wiéh an always improvable best solution 2% (00 for max, +00 For mín) and inibialize a SEARCH TREE wikbh bhe original problem without Erben Lit, con kminks. We pick Le neck node to explore and solve Le without integrabity constraints. L, TE £ha problem is infeasible, we prune by Factibilitey 2.36 uz solutios Found complica wikh original integmnlity conmsbraímts, ve may UPDATE Z* and prune by integrability %.T£ Eh solution ¡5 worse khan bh bost solution found =-% BIFURCATION BRANCHING X1=> Ola Prune by bound z=-1+ In£i0sible. Prune by Fockibiliky X1=4 x-45 29! 2-15 dz ka =2 | frune by integrability 2-48): OPTIMAL SOLUTION FOUND | Y.4. Hewistics for node exploration + The most RECENT bound. Choose always Líhz LAST ONE thab has been enrerabed. Asjume Lhab khe < child ¿s preratrd first and £nen £he > child. «The BEST bound. Choose Le ong with £he most PROMISINGO bound. When exploring , one praks and explores £he two children, m A 24/44 Brarch arde Bound 15. The following diagram contains Lhe Branch and Bound solution of Lhe problem. max? = 7'99X419X2 subjach to: 5X1+ 2%, y 3 CXL+ 4x2 <2o Us +2X2 45 with X4,XL>0 X1=2'66 X1=93 Xz=0 Unfeasible 2= 149/16 -Whakis Luz opkimal solubion and bhe upper bound of £he decision variables in Le opmadl solution? E h PG. X422,X.=2,2=149'5. OPTÍMAL FOLUTION FOUND! UPPER BOUND: X1<2 "What are the conskmmints applicd to ¿ach of the branches of the tree? 221333 16. An integer programmes. problem has been solve wiLh he following nee ralals and objeckive Punchion. TL solve hos ted kables for each ol Lie states Reprodure Lie tree and kh2 comstrain ts applied in ordlr Lo find Le optimal solution: AE PG, Lg First tntegkr solution ía Sound and £herntere Ene elevalbión used to prunz zz updaced.. An integral pruniag 15 perfermbd. P9,P_PQ are pruned due Lo non -Peasibilily Pio ás a non-integt- solution , where pruniag. ¡5 perfomid by Upper bound since the upptr bound of bm obizchive function is less Lnar 2% at har Lime. Pla provides an integer solution, «Mrmough ie 15 NOT betto- Lhan 2450 2% ¿snotb updabed.. we max = 20X1 + 14324 5Xo prune by tatregrality. subizek do: The kres ls complere. The solution found £s Xa+ X24Xo =5 e ó MA e Os ln Ze 2x1 + 9/5 X2 +X3 < 24'5 e A A 3X1+ IX2+X3 <24 5 Pa Í OPTIMIZATION 22/44 Unit 5: Metahtuwiskics and putie algoritms * Exack method Euarmnters obtnining khe OPTIMAL SOLUTION. AS we í increase £he SIZE of kte problem, so docs the EXECUTION TÍME, For some problems, khe yorth of Lhe execution may be PROHIBITIVE. + Approximate Approximate methods D0 NOT Le cbtniniag Lie OPTIMAL SOLUTION, We obtain a solution that is "good enough" or "close" ko Lu Ophiral, solu bion. REASONABLE COMPUTATIONAL COST. Two FAMILIES : HEURISTICS E METAHEURÍSTICS. HEURISTICS A heuristic i5 a practical and not necessarily rational problom- solving Srta, For Fiading an usually APPROXIMATE, SOLUTION do a, proble, Soma he2wigtics are SPECIFIC to Ele prblam beng solved , while oler may be more qertric and based on £he search process ibsele. METAHEURISTICS A mobaheuwristic is a sembegy formed by khe TOÍNT ACTÍON 0£ a SET Of strategies or HEURISTICS. There ae Mary mebahuuwristios: Genebic Algorikhms, Simulabid, Ameabiag ... mos£ autbabuuristios are GENERIC and have a SCHEME of OPERATION Thy ore ADAPTABLE € «almost any opbimizalios problem. Te is possible ko HYBRIDIZE problem / domain Knowledge, ta Lhe Baja hibrido ¿ESeLe to oblain BETTER PERFORMANCE: pa 2. Genetic Algorithms TE ls a kype or mebabiuriskios inspired by Lhe process of EVOLUTÍON £a nakwe. Fask match oP concepts: GA keurm > Optimization Lum Enviconmint > Problem > The fadividual acts ín an environaent, which! de kumines how he car ack: Ta Lhis cast, he Pramework ¿5 Ene problem. Individual > Solubion > Iadividulals at solutions bo Eme ppt. those, thak we want Lo yrdualy improve and evolve. Chromosorwe /Genotype > Solution encoding > How we internal, repre solutions Gure > Decision variable 1 Alelle > Variable domain Fitness Function > Objective Puvokiona!=> Measures ble, quality of a solukíon Phenotype > Board configuradions > External representadión o£ Le solution The phinokypic space contains all be possible phenolypes Ehak car be qenrembed. 2.Genebic rithms GENERAL SCHEMA START TNITIALIZE random population of solubions EVALUATE. each solution REPEAT UNTÍL (Termination condition): SELECT parent solutions CROSSOVER paírs 0£ parents MUTATE. resulting childres EVALUATE new solubions REPLACE popula Lions END CROSSOVER Population Y SELECT farants y CROSSOVER Children Y MUTATÍON Mutbaked children Y EVALUATE Childre, evaluated Y REPLACE Néw populalion Crossover operation taKes Un” PARENTS! Ieipically 2Mue 3 jhes Un CHILDREN (ipicolly 2D. TL consists of INHERIÍTING geetic matturial, From th£ PARENTS. UTE the partes have od ¿enelic material , bno mieture oF genebia maternal" From bokk' purtntg will also be good y EFFECT ON SEARCH: Explore atw sechión of Lu search space w!Lh PROMÍSINO maternal. MUTATION muralion opumntion Lakes ONE PARENT and porte ONE CHÍL.D. Ib consisko of making a SmaALL PERTURBATION ía, £he, prente. Uxc ene selrched parent has good qunetic mákerial and E chenge ie A sUghidy y dee vesubling, child showril «lio conta good jentkio mates al, EFFECT ON SEARCH : Explore la Lim NEIGHBORHOOD 0£ a promising. Solukion. ELECTION The parent selecióo operalion requires selectiag a tobal o£ "n” PARENTS. Tie parents will partecipabe ía bhe CROSSOVER, and Lheir CHILOREN la Lhe MUTATÍON. rhere are vartow selection slmtrgia alimough Eney tend to select “good” PARENTS. There is som£ RANDOMNES?. “Te I selce good puramves, lb w mutbabion assumpions . ¿U be tasier Lo meet Lhe crossover anal EFFECT ON SEARCH: Explore la PROMISING AREAS. Ly, Chromosomwe £ypos + BINARY REPRESENTATION —> 044104 -Apprepiake when £he problem has a natural RiNARY ENCODING or YES/NO decisions + PERMUTATION REPRESENTATION Solutions are ercoded 05 a ptrmutabos o£ vals. Employed when we decide £hp ORDER of EVENTI or ACTIONS, we debermine a PATH ora series of consecukive achions , L-L ASSIGNMENTS, * INTEGER, REPRESENTATION A vector 0£ nkegars de employed . whure ¿ach inteqer may apptar multiple kimeh. - FLOAT REPRESENTATION A vector of floaks is employtd to encode £ne problem 5. Mukubioa opembors Birwise MUTATION (Binary representation) INPUT: 4 parent, pobito (probabilicy o£ mubatiag a bit) OUTPUT: L child START Child <- Parte For each bit: 20d Change bit wiéh a probabiliby o£ p-bit A p-bit= 20% e EToToTzToTz) Prep: A , , , o ol MUTATE BIT RNG : 0'5,0'33,0'14, 045,067, 089,024 ,04,1.- (random generated numbir) Sh a ? [1 To T1ToTo Tx] RANDOM RESETTING (Intrg4 representacion) VAN] Similos bo bibwise mutntion, but uniformly changing Lrom MULTIPLE VALUES, INPUT: OUTPUT: START Child <- Parent For 2ach Rardomly reset Lie pe with a probabilicy po END pm = 107% and us bounded between O and 10 BllETTST3] Floak RING: 0'25, 9/04, 013, 0/05, 030, 040,045,0656, ... IM RNG; 10,2,+,9,5/6,2,4... EPI da 23/14 5. Mutadion opurakors CREEP MUTATION (Integt- represcatadion) Requires a diskribution centered arvund O that tends to Jentraee small values ralkher Lhan ones Dis Eribytion ocamples : NORMAL DISTRIBUTION DISCRETIZED INPUT: 4 parent, pm (probability ob mubating a pu), 1 distribution D OUTPUT: 4d child START Child <- Parent For gach ene: 7 Change pe by adding number sampled from D with probabidity pon END 1 pm = 45% Eo Ta]5J2] Floak RNG: 0'95,92,047,008,0'93,0+,0»4, 0/04... Distribution RNG: 2,-1,9,2,2,4,-4,4.... PETATs pz) UNIFORM MUTATION (Floq+ representa ion) Whla mubnbing a gene, one asigna EL¿,UL] spucibic to ench position í. Símilar to rundom reseltino and bibwist mutation IvPuT: 4 punt, pa ¿probability 1 untformby a mumber Lom a bounded renga or mutqbiag al pre) OUTPUT: 4 child START Child <- Parent 1 For each nz: Randomby sample from DivUlL¿/UL wién probability pm 7 pm=25 % NN Li and Us busween -9 und 9 TRATA Flat RING (0-1): 924, 01,943,025, 045, 079,049, 06.. Floak RNG (-3,3) : -22,-419,3,42,0/56,-095,2'5, 4... [TT Tra3T2] 29/11 5. Mutakion op untors SCRAMBLE (Purmutution reprosenta bion) Two genes ramdomly seltched.The conkne butuesn bekh ís SHUFFLED INPUT: 4 parint OUTPUT: 4 child START 4. Copy perent inko child 2. Seluck ravdon position A ».5$llek random position 4 j U. GhuLrle content bebween posilrioni 4 and y. END G=EETIEE Eatiger PNG: IS [spaBrzTeral INVERSION (Permutnbios representation) Two gens e randemly selected. The order between those is inverbed. INPUT: A purernt OUTPUT: 4 child START 1.Copy porentiiato hidra 1 2.sleck random position £ » Gelecth random position E á ie U. Taverí ordor belwezn positions L wm Enp [sParTurep] Inbeglr ANG : 316,112.49, 2160- [s T2p»Te TuT2] G. Crossove- operators ONE -POÍINT CROSGOVER h Can be used for inbtaer, binary and Sloakb represintabioss.. ENPUT | | ouUTPUT START 4. Child 4 <- Parent 4; Child 2 <-Parend 2 2.Randomby select position í D. Copy contrint £rom Parent 2 nto Child 4 From ¿+4 ton 4. Copy. tonkene Prom Parent L ínko Child 2 Prom +4 ton (1 1] To T1ATO 12] l1]l-ToT4T0To] — rea Takegar RNG : 4,412,1,919,,... 14 | G. Crossover operators K-PoiNT CROSSOVER ceerabizas one-point crossover Lo mert than a cub poin Es. | The vector is putitiond tado Kr4 parks tnat are inburilad albirsatively From puants. INPUT; 2 puentes OUTPUT: 2 children START Select K rardom pos“ bloms Ko LA ..n-1) child 1 <- Print; child 2 <- Parent2 ; For EREETEA COTETMIEIOIO)o ;* > K=2 II TitegWr RNG 12/96 TEA UNIFORM CROSSOVER Ench ghz is treated t ividually and RANDOMLY inheritad fm ong 6f Lhe wo parents y ; | Twe is a DISTRIBUTION BÍAS ,0s ie Leds Lo ganemér apprrximately 50 Y prabic material Som vach park: INPUT: 2 parents | DUTPUT: 2 children Í START ends <-Parerka ; Child2 <-Parent2 For tach ás Swap genes bubmten children wikh a probability of 50%, END ETcToLE) [op RATO] 0) — [of To1t]J0 To] [To ToT=11T01 Float RNG : 024,04, 9/8,0'68,9/45,0'9, 049,05... du Tabegtr ANG; 4d 16, +. o e a 6. Crossover opuators WHOLE ARITHMETIC RECOMBINATIÍON The weigheed Sum í5 computed, on te whole vector. when 0:05, eh Lwo Children we IDENTICAL. ENPUT: 2 paurints, x.£ 0/1] OUTPUT: 2 children START Cuilda <- Parental , Child 2 <- Parent Cnild a <- pe. Parent + (1-5) :ParentZ Child2 <- A: Parene2 + (4-00) - Partnel END BLEND CROSSOVER (BLX-) Values may be sigla outside Lt range defiaed by Lhe values of both parents How far may be Le value respiel to En parents runge ep ends on rx. INPUT: 2 prento, e [o,11 OUTPUT: 2 children START child <- Y ; child2< Y For tach qe De Li € min (ParecaLil, Parene2 041); au E max (Parenk1 Cil, Parene2[i1) di < mi-lú Cuild 4141 e Rardomty sampled £rom VU lli-xdi, Mi+ordi) cnild2C¿] + Rardon ty semple, Lom VUlli- «di, uirordi) x=0'5 Eo'sT=/2ToT-1T0"210%] dí] =3'%Y - 1-05) = 9% cata] =(-0'5-0'5.9'9, 394 +05.3'9) =1(-2145,5'35) Lower upper AL] - 45-42 = 0 Bonds" Bolinel ciL27 = (4112-05-09, 415+ 05-03) = (1105,4/65) END Assumes a PERMUTATION GENOTYPE . Copy Fire seqmtnk of parentel into CWild 4, same for Child2. Scan Prom second sequnent oP Partnel and EQ with values mor prosent fa CmLda y shipping Ehose already in. Game For Parent and childa. ErRIcnTa ELRDDT] OTE EA 29/14 EDGE CROSSOVER Permutatioa problema where adyacincy 45 importante, INPUT: 2 purtnés OUTPUT: 4 child START For tach value, build tmble o£ adjacerte values Prom bokh paurnts. Child <- 8 X<- Tnitial clemente From one OL Lhe bwo parents While Ichildl l=5n: cuild <- child U X REMOVE all refurences Lo X in adjacincy imbl TL X has a common adjacent value fa both parents : X <- Common adjacert value ía bokh parents Obherwise, ¿if X has non -empky, » e list ' X <- Elemine from adjacint lick wikn Ehe shorkest adjacent list Olturwise, 14 the adjacent disk is empig X <- Random value nok ¿n child Tabegtr RNG:2/7,1,9,4,6,.... Ed Terarsta (ejuji2 151513] VALUES | ADJACENTS 4 218.B,0 A/A B1f Randem bebween 2 Le TA IA RRA AAA Nosop o 12 OPTIMIZATION 7. Selection EXPONENTIAL RANKING SELECTION Similar to linear selection, bub with an EXPONENTÍAL behaviour, T£ depends on a hyporparamiber c, Occ er 299 UElY- (54) Qers = De -« UF (0) O ae ealís) x= 02 ] ) (O -(8-oa(e2)- (22) - Gecord ibunktion : a ga] (0 o (3) Cs) - Calcula tion op 0% for both components : 017 -0r- 4418 =0, 2e= 04440 04M-0-04=0; = 025