Hemuppgift 2, ALTERNATIV B, SF1861 Optimeringslära för T, VT 2016 Examinator: Krister Svanberg, [email protected] Assistent för hemuppgiften: David Ek, [email protected]. Denna uppgift utförs i grupper om högst två personer. En rapport per grupp lämnas in. Matlabkod och utskrifter bifogas. Rapporten behöver inte vara lång, men svaren på frågorna skall finnas i rapporten, inte i koden eller utskrifterna. Det är tillåtet att diskutera uppgiften med andra grupper, men ej tillåtet att kopiera delar av någon annan grupps text, plottar eller matlabkod. Ange namn, personnummer och e-postadress på rapportens framsida. Rapporten, utskriven (eller prydligt handskriven) på papper, lämnas in senast tisdag 3 maj 2016 kl 17:00. Skicka dessutom er Matlabkod, med namn och personnr på första raden, till David Ek [email protected], senast tisdag 3 maj 2016 kl 17:00. Det ska vara enkelt för David att direkt köra er kod och erhålla de resultat ni presenterar i rapporten. Vissa studenter kommer att väljas ut för enskild muntlig redovisning av uppgifterna. Kallelse sker via e-post, så kontrollera regelbundet denna. Korrekt löst och redovisad uppgift ger fyra hemtalspoäng. In this home assignment you should formulate some network flow problems as LP problems, solve them using Matlab, and present the results. In the network with 9 nodes and 12 links shown at the top of the next page, you should simultaneously send a units of “red flow” from node 1 to node 9, and b units of “blue flow” from node 4 to node 6. Each link consists of two parallel “channels”, one for the red flow and one for the blue, so the different flows do not mix. As shown in the figure, the red flow can only go “south” (south-east and south-west) in the links, and the blue flow can only go “east” (north-east and south-east). The link load on a given link is defined as the sum of the sizes of the red and the blue flows in the link, regardless of if these two flows have the same or opposite directions. The node load on a given node is defined as the sum of the red and the blue flows through the node, regardless of flow directions. As an example, the red flow through node 1 is equal to the red flow into node 1 (= a) which in turn is equal to the red flow out from node 1 (= the red flow in the link between node 1 and node 2 plus the red flow in the link between node 1 and node 3). 1. (a) Your first task is to send the flows through the network in such a way that the maximal link load (over all links) becomes as small as possible. Formulate this problem as an LP problem, and motivate your formulation. Hint 1: There should be two non-negative variables associated to each link: one for the red flow (in the permitted direction for red flow) and one for the blue flow (in the permitted direction for blue flow). Hint 2: Study Example 3.7 on page 21 in the course compendium concerning how to formulate a problem of minimizing the maximum of a set of functions by introducing an additional variable w. 1 Sid 2 av 3 Hemuppgift 2, Nätverk och LP SF1861 a 1 2 b 3 5 4 6 b 8 7 9 a (b) Use the matlab function linprog to solve the problem for the different cases listed below. Illustrate your obtained solutions in separate figures like the one on the last page. On each link in that figure, write the size of the red flow with a red pen, the blue flow with a blue pen, and the link loads with a black pen. Also write the nine node loads with a fourth colour. Below, ` = 10 + d1 + d2 , where d1 ∈ {1, . . . , 31} is the day of the month the first member of your group was born, and d2 is the corresponding number for the second member. If there is no second member of the group then d2 = d1 . Case 1: a = 12 `, b = 12 `. Case 2: a = 16 `, b = 8 `. Case 3: a = 18 `, b = 6 `. (c) Your next task is to send the flows through the network in such a way that the maximal node load (over all nodes) becomes as small as possible. Formulate this problem as an LP problem, and motivate your formulation. (d) Use the matlab function linprog to solve this problem for the different cases listed in (b). Illustrate, like in (b), your obtained solutions in separate figures, and compare your obtained result in (d) with the corresponding results in (b). The matrices Redarc and Bluearc below define the directed arcs for the red flow and the blue flow. They can be used for generating the incidence matrices needed in the LP formulation of the problems, see pages 75-76 in course compendium. In column k of the the matrix Redarc you find the numbers of the starting node (row 1) and ending node (row 2) for the k:th red flow arc. Similarly, in column k of the the matrix Bluearc you find the numbers of the starting node (row 1) and ending node (row 2) for the k:th blue flow arc. Use a for-loop in matlab to generate your incidence matrices from Redarc and Bluearc. The matrices can be copied from the homepage of the course. Redarc=[1 1 2 2 3 3 4 5 5 6 7 8 Bluearc=[2 1 4 2 5 3 4 7 5 8 7 9 2 3 4 5 5 6 7 7 8 8 9 9]; 1 3 2 5 3 6 7 5 8 6 9 8]; SF1861 Hemuppgift 2, Nätverk och LP Sid 3 av 3 a 1 2 b 3 5 4 6 8 7 9 a b
© Copyright 2026 Paperzz