De Branch-and-Bound methode



Vergelijkbare documenten
z x 1 x 2 x 3 x 4 s 1 s 2 s 3 rij rij rij rij

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

ALGORITMIEK: answers exercise class 7

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

1. Een kortste pad probleem in een netwerk kan worden gemodelleerd als a. een LP probleem. b. een IP probleem. c. een BIP probleem. d.

MyDHL+ Van Non-Corporate naar Corporate

Algorithms for Max-Flow

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 7 februari 2011

Four-card problem. Input

Classification of triangles

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Examination 2DL04 Friday 16 november 2007, hours.

Appendix A: List of variables with corresponding questionnaire items (in English) used in chapter 2

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 22 februari 2013

Handleiding Zuludesk Parent

Introductie in flowcharts

TW2020 Optimalisering

RECEPTEERKUNDE: PRODUCTZORG EN BEREIDING VAN GENEESMIDDELEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

The genesis of the game is unclear. Possibly, dominoes originates from China and the stones were brought here by Marco Polo, but this is uncertain.

DALISOFT. 33. Configuring DALI ballasts with the TDS20620V2 DALI Tool. Connect the TDS20620V2. Start DALISOFT

De grondbeginselen der Nederlandsche spelling / Regeling der spelling voor het woordenboek der Nederlandsche taal (Dutch Edition)

Group work to study a new subject.

Empowerment project. Driejarig project van Rotaryclub Rhenen-Veenendaal

S e v e n P h o t o s f o r O A S E. K r i j n d e K o n i n g

Branch-and-Bound en Cutting Planes

LDA Topic Modeling. Informa5ekunde als hulpwetenschap. 9 maart 2015

i(i + 1) = xy + y = x + 1, y(1) = 2.

Esther Lee-Varisco Matt Zhang

Bin packing and scheduling

Ontpopping. ORGACOM Thuis in het Museum

Cambridge Assessment International Education Cambridge International General Certificate of Secondary Education. Published

Opgave 2 Geef een korte uitleg van elk van de volgende concepten: De Yield-to-Maturity of a coupon bond.

MyDHL+ Uw accountnummer(s) delen

Chromosomal crossover

General info on using shopping carts with Ingenico epayments

CHROMA STANDAARDREEKS

Meetkunde en Lineaire Algebra

Online Resource 1. Title: Implementing the flipped classroom: An exploration of study behaviour and student performance

Preschool Kindergarten

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

04/11/2013. Sluitersnelheid: 1/50 sec = 0.02 sec. Frameduur= 2 x sluitersnelheid= 2/50 = 1/25 = 0.04 sec. Framerate= 1/0.

L.Net s88sd16-n aansluitingen en programmering.

1a. We werken het geval voor het tandenpoetsen uit. De concepten zijn (we gebruiken Engelse termen en afkortingen):

Zo werkt het in de apotheek (Basiswerk AG) (Dutch Edition)

HANDBOEK HARTFALEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Main language Dit is de basiswoordenschat. Deze woorden moeten de leerlingen zowel passief als actief kennen.

0515 DUTCH (FOREIGN LANGUAGE)

B1 Woordkennis: Spelling

Calculator spelling. Assignment

The colour of a pixel in a bit map picture can be presented in different ways. For this assignment, we distinguish two categories:

Example. Dutch language lesson. Dutch & German Language Education Pieter Wielick

Het is geen open boek tentamen. Wel mag gebruik gemaakt worden van een A4- tje met eigen aantekeningen.

It s all about the money Group work

VOORSTEL TOT STATUTENWIJZIGING UNIQURE NV. Voorgesteld wordt om de artikelen 7.7.1, 8.6.1, en te wijzigen als volgt: Toelichting:

Chapter 4 Understanding Families. In this chapter, you will learn

L.Net s88sd16-n aansluitingen en programmering.

Firewall van de Speedtouch 789wl volledig uitschakelen?

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

Opgave 2: Simplex-algoritme - oplossing

AVG / GDPR -Algemene verordening gegevensbescherming -General data Protection Regulation

Het Effect van Verschil in Sociale Invloed van Ouders en Vrienden op het Alcoholgebruik van Adolescenten.

Quality requirements concerning the packaging of oak lumber of Houthandel Wijers vof ( )

Ae Table 1: Aircraft data. In horizontal steady flight, the equations of motion are L = W and T = D.

Sekseverschillen in Huilfrequentie en Psychosociale Problemen. bij Schoolgaande Kinderen van 6 tot 10 jaar

MyDHL+ ProView activeren in MyDHL+

Invloed van het aantal kinderen op de seksdrive en relatievoorkeur

After that, the digits are written after each other: first the row numbers, followed by the column numbers.

Quick start guide. Powerbank MI Mah. Follow Fast All rights reserved. Page 1

Bijlage 2: Informatie met betrekking tot goede praktijkvoorbeelden in Londen, het Verenigd Koninkrijk en Queensland

150 ECG-problemen (Dutch Edition)

Understanding and being understood begins with speaking Dutch

Engels op Niveau A2 Workshops Woordkennis 1

Value based healthcare door een quality improvement bril

Pure Bending. A beam satisfying above given requirements are shown below: Why this surface is called neutral will be explained later in the lecture.

voltooid tegenwoordige tijd

Meetkunde en Lineaire Algebra

IDENTITEIT IN DE METHODE?

Vergaderen in het Engels

Borstkanker: Stichting tegen Kanker (Dutch Edition)

Systeem Wand Samenstellings Applicatie. Cabinet configuration tool. Nederlandse handleiding

LONDEN MET 21 GEVARIEERDE STADSWANDELINGEN 480 PAGINAS WAARDEVOLE INFORMATIE RUIM 300 FOTOS KAARTEN EN PLATTEGRONDEN

The downside up? A study of factors associated with a successful course of treatment for adolescents in secure residential care

OUTDOOR HD BULLET IP CAMERA PRODUCT MANUAL

2019 SUNEXCHANGE USER GUIDE LAST UPDATED

Archief Voor Kerkelijke Geschiedenis, Inzonderheid Van Nederland, Volume 8... (Romanian Edition)

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

AE1103 Statics. 25 January h h. Answer sheets. Last name and initials:

NUCHTER, EEN HELDERE KIJK EN NO-NONSENSE

ANT S KINGDOM Here is some advice for setting up your Master Ant Farm!

Hoe met Windows 8 te verbinden met NDI Remote Office (NDIRO) How to connect With Windows 8 to NDI Remote Office (NDIRO

Shipment Centre EU Quick Print Client handleiding [NL]

Verschil in Perceptie over Opvoeding tussen Ouders en Adolescenten en Alcoholgebruik van Adolescenten

2000 Volkswagen Passat GLS

Transcriptie:

De Branch-and-Bound methode Een eigenschap van het ILP probleem is dat er meestal maar een eindig aantal mogelijke oplossingen toegelaten zijn, of op zijn slechtst zijn de oplossingen aftelbaar (eventueel oneindig). In het bijzonder zijn er voor een 0-1 ILP met n binaire variabelen hooguit 2 n mogelijke toegelaten toepassingen. Dus 1024 bij 10 binaire variabelen, > 1.000.000 bij 20 binaire variabelen en > 10 40 bij 150 variabelen. Gegeven dat de snelste huidige computers 10 12 operaties per seconde kunnen uitvoeren, betekent dat alle mogelijke oplossingen nagaan en de beste selecteren 10 28 seconden duurt wat aardig in de buurt komt van de laatste schattingen omtrent het bestaan van het universum. Daar kunnen we dus niet op wachten. Het kan bij sommige ILP problemen nog een optie zijn om te doen alsof er helemaal geen geheeltalligheidsrestricties zijn, het probleem op te lossen als een gewoon LP-probleem (dit heet de zogenaamde LP-relaxatie van het ILP probleem) en achteraf de oplossing af te ronden. Meestal verliezen we dan de garantie dat dit de optimale oplossing geeft voor het ILP probleem. Bij de meeste 0-1 ILP problemen is het echter verre van duidelijk hoe af te ronden tot een toegelaten oplossing: Stel dat in een optimale oplossing van de LP-relaxatie de waarden van alle variabelen kleiner dan 1/2 zijn dan is direct afronden geen optie want alles zou naar 0 afgerond worden en dat geeft een niet-toegelaten oplossing. Slechte afronding bij het 0-1 Knapzak probleem. Er bestaat een theorie dat ILP een probleem is waarvoor geen echt efficient algoritme bestaat. We zullen een algoritme bestuderen dat op een impliciete manier alle mogelijke oplossingen afgaat en de beste selecteert. Dit algoritme heeft het nadeel dat in het algemeen slechts kleinere probleeminstanties opgelost kunnen worden. Er zijn ook algoritmen toegesneden op het specifieke ILP probleem die sneller werken. Voor veel problemen geven deze algoritmen niet persé de optimale oplossing maar een benadering. Deze aspecten zullen buiten dit college blijven. A general purpose solution method for ILP is Branch-and-Bound (B&B). This method enumerates all possible feasible solutions of an ILP-problem instance in a smart way, trying to save as much as possible. It does so by dividing the original problem into sub-problems by imposing mutually excluding restrictions on values of some of the decision variables. The method 1

will be explained at the hand of a 0-1 ILP problem instance, extracted from [Hillier and Lieberman] Chapter 11. Remember that we argued that a 0-1 ILP instance with n variables has 2 n possible solutions. We will see that B&B tries to avoid evaluating all of them. Branch-and-Bound for 0-1 ILP Consider the following problem instance: max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 s.t. 6x 1 + 3x 2 + 5x 3 + 2x 4 10 + x 3 + x 4 1 x 1 + x 3 0 x 2 + x 4 0 x 1, x 2, x 3, x 4 {0, 1}. The LP-relaxation of this problem obtained by relaxing the constraints x i {0, 1}, i = 1,..., 4, to 0 x i 1, i = 1,..., 4, appears to have an optimal solution (x 1, x 2, x 3, x 4 ) = ( 5, 1, 0, 1) with value ZLP 6 0 = 16 1. 2 Lemma 0.1 Een optimale oplossing van de LP-relaxatie is altijd beter dan de optimale oplossing van het bijbehorende ILP-probleem. Dus in geval van maximaliseren zegt dit lemma dat de optimale waarde van de LP-relaxatie altijd een bovengrens geeft op de optimale waarde van het ILP-probleem. Dit is wel logisch als we even andersom denken, namelijk dat de ILP-formulering uit de LP-relaxatie wordt verkregen door de extra restrictie toe te voegen dat alle variabelen geheeltallig moeten zijn. Een probleem zal nooit een betere oplossing krijgen door extra restricties toe te voegen. In het gunstigste geval blijken die extra restricties geen invloed op de optimale oplossing te hebben. Omdat het ILP-probleem nooit een betere oplossing kan hebben dan de LPrelaxatie, geldt ook het volgende lemma. 2

Lemma 0.2 Als de LP-relaxatie een geheeltallige optimale oplossing heeft, dan is dat ook de optimale oplossing van het ILP-probleem. Thus, we know that no feasible solution of the original integer problem will have a value higher than 16 1. Denoting the optimal value of the ILP problem by Z I we have Z I 16 1. Actually we even have 2 ZI 16 since the 2 objective coefficients are all integer, whence any integer solution should have an integer objective value. In this way we have bounded the optimal value from above. Clearly, the optimal solution of the LP-relaxation is not all-integer. Now we divide the problem into two sub-problems, while enforcing one of the variables into an integer value. I.e.: in sub-problem 1 we enforce x 1 = 0, whereas in sub-problem 2 we enforce x 1 = 1. This is the way we do our first branching. Thus Sub-problem 1 becomes the original problem with the extra constraint x 1 = 0 and Sub-problem 2 becomes the original problem with the extra constraint x 1 = 1. In principle we could remove x 1 from these sub-problems. E.g. this would give for Sub-problem 2: max Z = 5x 2 + 6x 3 + 4x 4 + 9 s.t. 3x 2 + 5x 3 + 2x 4 4 + x 3 + x 4 1 x 3 1 x 2 + x 4 0 x 2, x 3, x 4 {0, 1}. It is left to the student to formulate Sub-problem 1 without x 1. The optimal solution of the LP-relaxation of Sub-problem 1 is (x 1, x 2, x 3, x 4 ) = (0, 1, 0, 1) with value Z LP 1 = 9. The optimal solution of the LP-relaxation of Sub-problem 2 is (x 1, x 2, x 3, x 4 ) = (1, 4, 0, 4 ) with value ZLP 5 5 2 = 16 1. 5 The calculations are represented in a so-called branch-and-bound search tree. The root-node (mother-node), called node 0, represents the original problem. 3

From this node there are two edges leading to the two (children) nodes, nodes 1 and 2, representing Sub-problems 1 and 2, respectively. The edges are labelled according to the branching they imply. Thus the edge between node 0 and node 1 is labelled x 1 = 0, and the other edge is labelled x 1 = 1. In the root-node we read the number 16 indicating an upper bound on the optimal value of the whole problem. In node 2 we read again 16, which indicates that once we prefix the value of x 1 to 1 we cannot attain a solution with value higher than 16. In node 1 we read 9, indicating an upper bound of 9 on the value of any feasible solution of the problem with the property that x 1 = 0. However, there is something special in node 1. The upper bound of 9 is attained in a solution that is integer: (x 1, x 2, x 3, x 4 ) = (0, 1, 0, 1). Thus, according to Lemma 0.2 we have already found the best possible solution given that x 1 = 0. Hence, it does not make any sense to further consider sub-problems that have x 1 = 0. We say that we prune the search tree in this node. It also give us the value of a feasible solution, which so far is the best feasible solution. We have encountered one pruning criterion, based on which we can discard parts of the tree. We list all pruning criteria below. They are very logical once thinking about them a little bit and are based on Lemmas 0.2 and 0.1. The B&B search tree is pruned in a node if (P1) The upper bound on the solution value of the sub-problem in that node is attained by a feasible integer solution; (P2) The upper bound on the solution value of the sub-problem in that node is lower than or equal to the value of the best feasible (integer) solution found so far; (P3) The sub-problem in that node is infeasible. Continuing with the example only node 2 remains to be branched from. We define Sub-problems 2.1 and 2.2 by adding, respectively, the constraints x 2 = 0 and x 2 = 1 to Sub-problem 2. The optimal solution of Sub-problem 2.1 is (x 1, x 2, x 3, x 4 ) = (1, 0, 4, 0) with 5 value Z2.1 LP = 13 4. 5 The optimal solution of Sub-problem 2.2 is (x 1, x 2, x 3, x 4 ) = (1, 1, 0, 1) with 2 value Z2.2 LP = 16. 4

None of these two nodes can be pruned. We have to choose which of the two nodes to branch from. There is no optimal criterion to guide this choice. Usually, one takes the node with highest potential, i.e. the one with the highest upper bound. Thus, we choose to branch from the node corresponding to Sub-problem 2.2, by setting x 3 = 0 and x 3 = 1, leading to Sub-problems 2.2.1 and 2.2.2, respectively. The optimal solution of Sub-problem 2.2.1 is (x 1, x 2, x 3, x 4 ) = (1, 1, 0, 1 2 ) with value Z LP 2.2.1 = 16. For Sub-problem 2.2.2 there is no feasible solution. Thus, this node can be pruned by criterion P3. There are still three nodes that are active: nodes (sub-problems) 1, 2.1, and 2.2.1. The first one has been pruned for further investigation. The second and the third one are still open. Since the 2.2.1 has the higher upper bound we branch from that one, by setting x 4 = 0 and x 4 = 1, leading to Sub-problems 2.2.1.1 and 2.2.1.2, respectively The optimal solution of Sub-problem 2.2.1.1 is (x 1, x 2, x 3, x 4 ) = (1, 1, 0, 0) with value Z LP 2.2.1.1 = 14. Sub-problem 2.2.1.2 is infeasible. Of course, the optimal solution of Sub-problem 2.2.1.1 is attained in an integer point. It gives a solution with value 14, the best solution found so far. First of all this means that Node 1, can be discarded. Secondly, Node 2.1 can be pruned on basis of criterion P2 since the upper bound of 13 is lower than 14. Since we don t have any further active nodes, the problem is solved and the optimal solution value is 14. In the example the branching was done based on the values of the upper bounds in the nodes. This is not necessarily the best strategy. The two most extreme branching strategies are depth-first search (DFS) and breadth-first search (BFS). DFS has the advantages of giving a feasible solution quickly, which can be used for pruning the tree, and it requires little computer space for intermediate storing of unpruned nodes. With respect to bounding it is always better to try to achieve the best possible bounds. In maximization, the best upper bounds are not necessarily achieved through LP-relaxations. One could often improve enormously on this bound by adding cuts (see later), or by considering other relaxations (see later as well). For finding good lower bounds we may rely on good approximation 5

algorithms. Both in computing lower- and upper bounds there is always the trade-off between quality and time. Within the context of B&B the aim of good bounds is to save computing time, and therefore the time used for computation of the bounds should not be higher than the time saved by having these stronger bounds available. Tuning the B&B method to the specific practical applications is a matter of craftmanship, attainable through working a lot with the technique. Branch-and-bound voor het knapzak probleem Het 0-1 Knapzak probleem was het probleem van het selecteren van items, waarbij ieder item j een gewicht a j heeft en een waarde c j. De knapzak heeft gewichtscapaciteit b. Gevraagd wordt een selectie te maken met maximale totale waarde, waarvan het totale gewicht b niet overschrijdt. Met behulp van de 0-1 beslissingsvariabelen x j, waarbij x j = 1 aangeeft dat item j geselecteerd wordt en x j = 0 dat item j niet geselecteerd wordt, kunnen we het volgende 0-1 ILP model opstellen: max s.t. n j=1 c jx j n j=1 a jx j b, 0 x j 1, x j Z, j = 1, 2,..., n. De LP-relaxatie van dit probleem wordt verkregen door de restricties x j Z te laten vervallen: max s.t. n j=1 c jx j n j=1 a jx j b, 0 x j 1, j = 1, 2,..., n. De LP-relaxatie heeft de plezierige eigenschap dat het heel gemakkelijk op te lossen is zonder daarvoor het LP-probleem met behulp van LP-methoden op te lossen. Om de LP-relaxatie op te lossen moeten we ons bedenken dat de capaciteit volledig benut zal worden, omdat we eventueel een item slechts gedeeltelijk mee mogen nemen. Het beste is dus om items te selecteren die een zo hoog mogelijke waarde per eenheid gewicht geven. Deze twee observaties geven precies het algoritme wat de LP-relaxatie oplost: Greedy Algoritme: Orden de items op afnemende ratio c j /a j in een lijst en voeg de items in die volgorde aan de selectie toe zolang dat past. Voor 6

het eerste item dat niet meer past wordt bepaald welke fractie van dit item nog wel meegenomen kan worden en deze fractie wordt geselecteerd waarmee de capaciteit b bereikt wordt. Laten we dit illustreren aan de hand van het volgende voorbeeld. Gegeven een verzameling van 5 items met item 1 2 3 4 5 c j 9 7 6 5 7 a j 4 3 3 2 4 De capaciteit van de knapzak b = 11. Om de LP-relaxatie van de ILP-formulering van dit knapzak problem op te lossen, moeten we eerst de items ordenen op afnemende ratio c j /a j. Dit geeft item 4 2 1 3 5 c j 5 7 9 6 7 a j 2 3 4 3 4 Om de oplossing voor de LP-relaxatie te bepalen gaan we deze lijst af: Item 4 past en wordt opgenomen, dus x 4 = 1. Dit geeft restcapaciteit 11 2 = 9. Dus wordt item 2 ook opgenomen, x 2 = 1 wat restcapaciteit 9 3 = 6 geeft. Dus wordt item 1 ook opgenomen, x 1 = 1 wat restcapaciteit 6 4 = 2 geeft. We zien dat item 3, het vierde item in de geordende lijst, niet meer in zijn geheel opgenomen kan worden want het heeft gewicht 3. Dit item nemen we dan dus slechts gedeeltelijk mee. Dat is niet toegelaten voor het ILP probleem maar wel voor de LP-relaxatie. We nemen dit item dus voor 2/3 op, x 3 = 2/3. De overige items worden niet geselecteerd, x 5 = 0. De totale waarde is dan Z LP = 5+7+9+6 2 = 25. 3 Maar op een simpele manier kunnen we hier nog meer informatie uithalen. Namelijk door de gevonden oplossing naar beneden af te ronden krijgen we een oplossing die waarschijnlijk niet optimaal, maar wel toegelaten is voor het oorspronkelijke geheeltallige probleem: x 4 = 1, x 2 = 1, x 1 = 1, x 3 = 0, x 5 = 0 met waarde Z = 21. Dit vormt een mooie start voor de Branch-and-Bound methode om het knapzak probleem op te lossen. We weten dus uit de eerste zoekknoop, het 7

probleem wat we juist opgelost hebben, dat de optimale oplossing een waarde zal hebben van hooguit 25. Maar in dit geval hebben we met de afronding een toegelaten oplossing waarmee we iedere knoop kunnen wegsnoeien, die een waarde krijgt lager dan 21. Dit voorbeeld probleem laat zien dat we niet altijd een heel korte Branchand-Bound boom hebben, maar soms heel veel knopen uit moeten zoeken. We branchen op x 3 en creëren twee subproblemen. Subprobleem 1 met x 3 = 0: en Subprobleem 2 met x 3 = 1: max 9x 1 + 7x 2 + 5x 4 + 7x 5 s.t. 4x 1 + 3x 2 + 2x 4 + 4x 5 11, 0 x j 1, x j Z, j = 1, 2, 4, 5 max 9x 1 + 7x 2 + 5x 4 + 7x 5 + 6 s.t. 4x 1 + 3x 2 + 2x 4 + 4x 5 8, 0 x j 1, x j Z, j = 1, 2, 4, 5 Gebruikmakend van de oplossingsmethode zoals hierboven beschreven lossen we de LP-relaxaties van deze twee subproblemen op: LP Oplossing Subprobleem 1 : x 4 = 1, x 2 = 1, x 1 = 1, x 5 = 2 4, x 3 = 0 met waarde Z LP = 24 1 2. LP Oplossing Subprobleem 2 : x 4 = 1, x 2 = 1, x 1 = 3 4, x 5 = 0, x 3 = 1 met waarde Z LP = 24 3 4. Dit geeft bovengrens 24 voor Subprobleem 1 en 24 voor Subprobleem 2. De afronding van de oplossing van Subprobleem 1 geeft een toegelaten oplossing x 4 = 1, x 2 = 1, x 1 = 1, x 5 = 0, x 2 = 0 met waarde 21. De afronding van de oplossing van Subprobleem 2 geeft een toegelaten oplossing x 4 = 1, x 2 = 1, x 1 = 0 10 13, x 4 = 0, x 5 = 0, x 1 = 0, x 2 = 1 met waarde 45. 8

We zullen eerst Subprobleem 1 verder onderzoeken door te branchen op x 5. Dit geeft Subprobleem 1.1 met x 5 = 0 en Subprobleem 1.2 met x 5 = 1 max 9x 1 + 7x 2 + 5x 4 s.t. 4x 1 + 3x 2 + 2x 4 11, 0 x j 1, x j Z, j = 1, 2, 4 max 9x 1 + 7x 2 + 5x 4 + 7 s.t. 4x 1 + 3x 2 + 2x 4 7, 0 x j 1, x j Z, j = 1, 2, 4 Oplossingen van de LP-relaxaties worden: LP Oplossing Subprobleem 1.1 : x 4 = 1, x 2 = 1, x 1 = 1, x 3 = 0, x 5 = 0 met waarde Z LP = 21. LP Oplossing Subprobleem 1.2 : x 4 = 1, x 2 = 1, x 1 = 2 4, x 3 = 0, x 5 = 1, met waarde Z LP = 23 1 2. Er is een optimale oplossing gevonden van de LP-relaxatie van Subprobleem 1.1 die geheeltallig is. De best gevonden oplossing tot nu toe blijft waarde 21 hebben. We zullen Subprobleem 1.2 onderzoeken door te branchen op x 1. Dit geeft Subprobleem 1.2.1 met x 1 = 0 en Subprobleem 1.2.2 met x 1 = 1 max 7x 2 + 5x 4 + 7 s.t. 3x 2 + 2x 4 7, 0 x j 1, x j Z, j = 2, 4 max 7x 2 + 5x 4 + 16 s.t. 3x 2 + 2x 4 3, 0 x j 1, x j Z, j = 2, 4 9

Oplossingen van de LP-relaxaties worden: LP Oplossing Subprobleem 1.2.1 : x 4 = 1, x 2 = 1, x 1 = 0, x 3 = 0, x 5 = 1 met waarde Z LP = 19. LP Oplossing Subprobleem 1.2.2 : x 4 = 1, x 2 = 1 3, x 1 = 1, x 3 = 0, x 5 = 1 met waarde Z LP = 23 1 3. Subprobleem 1.2.1. kan weer gesnoeid worden vanwege een geheeltallige oplossing. De waarde is slechter dan de beste tot nu toe gevonden. Bovengrens voor Subprobleem 1.2.2 is 23. De afronding van de oplossing van Subprobleem 1.2.2 geeft een toegelaten oplossing x 4 = 1, x 2 = 0, x 1 = 1, x 3 = 0, x 5 = 1 met waarde 21. Nu doe ik nog de branching van Subprobleem 1.2.2 en branch ik op x 2. Dit geeft Subprobleem 1.2.1.1 met x 2 = 0 en Subprobleem 1.2.1.2 met x 2 = 1 max 5x 4 + 16 s.t. 2x 4 3, 0 x j 1, x j Z, j = 4 max 5x 4 + 23 s.t. 2x 4 0, 0 x j 1, x j Z, j = 1, 2, 4 Beiden hebben een geheeltallige oplossing en kunnen dus gesnoeid worden. Subprobleem 1.2.1.1 heeft oplossing x 4 = 1, x 2 = 0, x 1 = 1, x 3 = 0, x 5 = 1 met waarde Z LP = 21. Subprobleem 1.2.1.2 heeft oplossing x 4 = 0, x 2 = 1, x 1 = 1, x 3 = 0, x 5 = 1 met waarde Z LP = 23. Dit is de best gevonden waarde waarmee we een ondergrens van 23 hebben nu. Helaas is dat niet voldoende om het enige open subprobleem te kunnen snoeien. We moeten Subprobleem 2 dus onderzoeken. Daartoe branchen we op x 1. Ik zal stoppen met de subproblemen uit te schrijven en verwacht ook niet van de studenten op het tentamen dat alle subproblemen uitgeschreven 10

worden. Hooguit zal ik expliciet vragen er een of twee uit te schrijven. Dus Subprobleem 2.1 heeft x 1 = 0 en x 3 = 1 en restcapaciteit van de knapzak is 8. Dus de oplossing van dit probleem wordt x 4 = 1, x 2 = 1, x 5 = 3, x 4 1 = 0, x 3 = 1 met waarde Z LP = 23 1. Dit kan gesnoeid worden op het 2de snoeicriterium: de bovengrens voor deze knoop is 23, de afronding van 23 1, en 4 4 dit is gelijk aan de waade van de beste reeds gevonden oplossing. Subprobleem 2.2 heeft x 1 = 1 en x 3 = 1 en restcapaciteit van de knapzak is 4. Dus de LP-oplossing van dit probleem wordt x 4 = 1, x 2 = 2, x 3 5 = 0, x 1 = 1, x 3 = 1 met waarde Z LP = 24 2. De afronding van de oplossing heeft een 3 waarde van 18. Wederom kan deze knoop niet gesnoeid worden. We branchen op x 2. Subprobleem 2.2.1 heeft dan x 2 = 0 en x 1 = 1 en x 3 = 1 en restcapaciteit van de knapzak 4. De LP-oplossing van dit probleem wordt x 4 = 1, x 5 = 2, x 3 2 = 0, x 1 = 1, x 3 = 1 met waarde Z LP = 23 1. Dit kan 2 gesnoeid worden op het 2de snoeicriterium: de bovengrens voor deze knoop is 23, de afronding van 23 1, en dit is gelijk aan de waade van de beste reeds 2 gevonden oplossing. Subprobleem 2.2.2 heeft dan x 2 = 1 en x 1 = 1 en x 3 = 1 en restcapaciteit van de knapzak 1. De LP-oplossing van dit probleem wordt x 4 = 1, x 2 5 = 0, x 2 = 1, x 1 = 1, x 3 = 1 met waarde Z LP = 24 1. De afronding van de oplossing heeft een waarde van 18. Wederom kan deze knoop niet gesnoeid 2 worden. Om Subprobleem 2.2.2 verder te onderzoeken branchen we nog op x 4. Subprobleem 2.2.2.1 heeft dan x 4 = 0 en x 2 = 1 en x 1 = 1 en x 3 = 1 en restcapaciteit van de knapzak 1. De LP-oplossing van dit probleem wordt x 5 = 1, x 4 4 = 0, x 2 = 1, x 1 = 1, x 3 = 1 met waarde Z LP = 23 3. Dit kan weer 4 gesnoeid worden op het 2de snoeicriterium. Subprobleem 2.2.2.2 heeft dan x 4 = 1 en x 2 = 1 en x 1 = 1 en x 3 = 1 en dit is niet toegelaten en kan dus gesnoeid worden op grond van snoeicriterium 3. Aangezien geen knopen meer open zijn, kunnen we concluderen dat we de optimale oplossing gevonden hebben en deze is dus x 4 = 0, x 2 = 1, x 1 = 1, x 3 = 0, x 5 = 1 met waarde Z LP = 23. 11

0-1 Knapzak Opgaven K1: Los het volgende 0-1 Knapzak probleem op met behulp van de Branchand-Bound methode. max Z = 7x 1 + 5x 2 + 6x 3 + 8x 4 + 2x 5 s.t. 4x 1 + 3x 2 + 4x 3 + 5x 4 + 2x 5 11 x 1, x 2, x 3, x 4, x 5 {0, 1} K2: Los het volgende 0-1 Knapzak probleem op met behulp van de Branchand-Bound methode. max Z = 13x 1 + 7x 2 + 2x 3 + 6x 4 + 5x 5 + 4x 6 + 11x 7 s.t. 5x 1 + 2x 2 + 4x 3 + 3x 4 + x 5 + 2x 6 + 3x 7 10 x 1, x 2, x 3, x 4, x 5, x 6, x 7 {0, 1} K3: Los het volgende 0-1 Knapzak probleem op met behulp van de Branchand-Bound methode, waarbij de nutten en de gewichten van 6 items gegeven zijn door item 1 2 3 4 5 6 c j 26 30 25 20 16 15 a j 19 16 13 11 9 7 De capaciteit van de knapzak b = 33. Bij deze opgave wordt duidelijk dat de Branch-and-Bound soms heel veel knopen moet berekenen. 12