Docsity

Linear Programming Assignment: Optimization Problems in Scientific Computing, Exams of Operational Research

Toggle sidebar
bg1
Uppsala University
Information Technology
Scientific Computing
November 2, 2010
Optimization
Martin Berggren, Katharina Kormann
Per L¨otstedt, Eddie Wadbro
Assignment 1: Linear Programming
Hand in a written report containing a short presentation of the problem, results, discus-
sion, source code, and a print-out of the result from your Matlab sessions. You must
state which version of Matlab you are using. Answer all questions and comment your
results. If the report is incomplete, we will return it for completion before starting to
grade it. You may work alone or in groups of two or three. All members of a group
should contribute to the solution and the report. Discussions between the groups are
encouraged. If you receive substantial help from another group, say so in the report.
You are not allowed to copy solutions or computer codes from others. Please check the
homepage for more information.
The absolute deadline for submitting this year’s assignments is 2011-01-24. You will
obtain a 1/2 bonus point on the final exam on 2010-12-13, if a correct solution for this
assignment is handed in at the latest 2010-11-15.
1. Solve the linear program
max x1−x2−x3
subject to x1−2x2+x3≤4,
x1−x2−2x3≤3,
−x1+ 2x2+ 2x3≤2,
x1, x2, x3≥0
(1)
by the simplex method, accounting for every iteration. Use the slack variables as
basis variables to initiate the simplex and update the basis following Bland’s rule.
The problem should be solved “by hand”, but you may use Matlab or some other
tool to solve the linear system and to perform matrix–vector products, if you like.
The purpose of this exercise is to understand how the simplex algorithm works.
In practice problems are solved on the computer (like you will do in part 2 of the
exercise).
Verify your result by using the Matlab Optimization Toolbox routine linprog
(note that the optimization toolbox is only available on the Sun-system). Type
doc linprog (or help linprog) at the Matlab prompt to get information on
how linprog is used.
Also write down the dual problem to problem (1) (not the transformed one!) and
determine the solution to the dual problem from your previous computations.
Please download the document simplex template from the course homepage and
present each step of the simplex algorithm on one such page. In addition you
should motivate your choices. If you type your solution, you do not have to use
the template, as long as your presentation follows the same scheme. A hand-
written presentation not following the template will not be graded.
2. The Skellefte˚a Subway System (SSS) has been awarded the contract to operate
the subway in the Greater Skellefte˚a Metropolitan Area. The Traffic Planning
Department has estimated that at least the following number of staff is needed
each four-hour interval throughout a standard 24-hour period:
1
pf2

Partial preview of the text

Download Linear Programming Assignment: Optimization Problems in Scientific Computing and more Exams Operational Research in PDF only on Docsity!

Uppsala University Information Technology Scientific Computing

November 2, 2010 Optimization Martin Berggren, Katharina Kormann Per L¨otstedt, Eddie Wadbro

Assignment 1: Linear Programming

Hand in a written report containing a short presentation of the problem, results, discus- sion, source code, and a print-out of the result from your Matlab sessions. You must state which version of Matlab you are using. Answer all questions and comment your results. If the report is incomplete, we will return it for completion before starting to grade it. You may work alone or in groups of two or three. All members of a group should contribute to the solution and the report. Discussions between the groups are encouraged. If you receive substantial help from another group, say so in the report. You are not allowed to copy solutions or computer codes from others. Please check the homepage for more information. The absolute deadline for submitting this year’s assignments is 2011-01-24. You will obtain a 1/2 bonus point on the final exam on 2010-12-13, if a correct solution for this assignment is handed in at the latest 2010-11-15.

  1. Solve the linear program

max x 1 − x 2 − x 3 subject to x 1 − 2 x 2 + x 3 ≤ 4 , x 1 − x 2 − 2 x 3 ≤ 3 , −x 1 + 2x 2 + 2x 3 ≤ 2 , x 1 , x 2 , x 3 ≥ 0

by the simplex method, accounting for every iteration. Use the slack variables as basis variables to initiate the simplex and update the basis following Bland’s rule. The problem should be solved “by hand”, but you may use Matlab or some other tool to solve the linear system and to perform matrix–vector products, if you like. The purpose of this exercise is to understand how the simplex algorithm works. In practice problems are solved on the computer (like you will do in part 2 of the exercise). Verify your result by using the Matlab Optimization Toolbox routine linprog (note that the optimization toolbox is only available on the Sun-system). Type doc linprog (or help linprog) at the Matlab prompt to get information on how linprog is used. Also write down the dual problem to problem (1) (not the transformed one!) and determine the solution to the dual problem from your previous computations. Please download the document simplex template from the course homepage and present each step of the simplex algorithm on one such page. In addition you should motivate your choices. If you type your solution, you do not have to use the template, as long as your presentation follows the same scheme. A hand- written presentation not following the template will not be graded.

  1. The Skellefte˚a Subway System (SSS) has been awarded the contract to operate the subway in the Greater Skellefte˚a Metropolitan Area. The Traffic Planning Department has estimated that at least the following number of staff is needed each four-hour interval throughout a standard 24-hour period:

Time period Staff 06–10 700 10–14 200 14–18 800 18–22 300 22–02 100 02–06 100

All staff works in 8-hour shifts. There are six possible shifts that start on the hour in the beginning of each 4-hour period in the table. All staff has the same hourly salary, except that the hourly salary is 50 % higher between 20.00 and 24.00. Moreover, the hourly salary is 100 % higher between 24.00 and 6.00.

(a) Find how many employees are needed for each of the six shifts in order to minimize the salary costs for SSS, while at the same time satisfying the staffing requirements. Note: When solving the resulting LP in Matlab, use the following command before calling linprog: options = optimset(’LargeScale’,’off’); and call linprog with options as the last argument (see doc linprog for more information). (b) The company is considering to double the number of tours between 10 and

  1. For this, they would need 400 workers for this shift. Run the resulting optimization problem and report the increase in labor costs. Explain your result! (c) Try running problem (a) with the default large-scale algorithm (a so-called interior-point method) instead of the algorithm of simplex type which is used by setting options as in (a). To use the large-scale algorithm, set options = optimset(’LargeScale’,’on’); and call linprog with options as the last argument. Compare with the result you obtained in (a). Can you think of any reason for the difference?