You are on page 1of 4

Practice Problem Set 1

OA4201 Nonlinear Programming


1. Is the standard branch-and-bound algorithm you learned in OA3201 Linear
Programming an exact algorithm, an approximation algorithm, or a heuristic? Why?
Consider modifying the branch-and-bound algorithm so that it terminates after a fixed
number of branches, say 20. Would this modified algorithm be an exact algorithm, an
approximation algorithm, or a heuristic? Why?

2. This problem is simply a GAMS warmup. If you haven’t already done so,
download and install GAMS on your computer, or use a lab computer that already has
GAMS installed. To download the complete GAMS package, visit
http://www.gams.com/download. When prompted for a license, use the gamslice.txt file
available on the course website. Email me if you have any questions or problems.

In class we discussed the problem of minimizing the variance of the value of a portfolio
consisting of Lockheed Martin and Delta stocks. Recall that Lockheed Martin and Delta
have an expected value next year per dollar invested of 1.05 and 1.08, respectively. The
corresponding standard deviations are 0.1 and 0.2. The correlation coefficient between
the stocks is -0.5. Use GAMS to implement and solve the model derived in class, and
confirm the optimal solution of 33% LMT and 67% DAL.

What happens if you require an expected value of the portfolio of 1.07? How much does
the standard deviation of the value of the optimal portfolio go up? (This modification
should be straightforward, but if it’s not, please email me.) What happens if you require
an expected value of 1.09? (Look at the “Model Status” line under “Solution Report.”)
Why does this happen?
Practice Problem Set 1 Solution

OA4201 Nonlinear Programming

1. Is the standard branch-and-bound algorithm you learned in OA3201 Linear


Programming an exact algorithm, an approximation algorithm, or a heuristic? Why?
Consider modifying the branch-and-bound algorithm so that it terminates after a fixed
number of branches, say 20. Would this modified algorithm be an exact algorithm, an
approximation algorithm, or a heuristic? Why?

Solution: As we discussed in class, the standard branch-and-bound algorithm is exact


since an optimal solution is guaranteed to be found. However, there are heuristic
algorithms based on similar ideas, which do not explore the complete enumeration tree –
stopping after a fixed number of enumerations would be an example of such a heuristic
approach, since the solution quality cannot be guaranteed a priori for all problem
instances.

2. This problem is simply a GAMS warmup…

If you have trouble implementing the model, use the code below. After opening the
GAMS IDE, simply open a blank .gms file and copy-and-paste the code on the second
page of these solutions into the file. To solve the model, press the “Run GAMS” button
found along the top of the screen. To view the solution, look for “Display” along the left
side of the IDE, click the “+” to open it, and click on one of the variable names.

What happens if you require an expected value of the portfolio of 1.07? How much does
the standard deviation of the value of the optimal portfolio go up? What happens if you
require an expected value of 1.09? Why does this happen?

Solution:

With a required expected value of 1.06, the optimal portfolio is 67% Lockheed and 33%
Delta, with variance 0.0044 and standard deviation 0.066.

With a required expected value of 1.07, the optimal portfolio is 33% Lockheed and 67%
Delta, with variance 0.0144 and standard deviation 0.12.

With a required expected value of 1.09, the problem is infeasible. Since the maximum
expected return of either stock is 1.08, the average expected return cannot exceed 1.08.
$TITLE Investment Example

POSITIVE VARIABLES
X1 value in Lockheed
X2 value in Delta
;

VARIABLES
Z objective function
;

EQUATIONS
OBJ portfolio variance value
BUDGET budget constraint
EXPVAL expected value of portfolio
;

OBJ..
Z =E= power(0.1*X1,2) + power(0.2*X2,2) + 2*(-
0.5)*0.1*X1*0.2*X2
;

BUDGET..
X1 + X2 =E= 1
;

EXPVAL..
1.05*X1 + 1.08*X2 =G= 1.06
;

MODEL minvar /ALL/;

SOLVE minvar USING NLP MINIMIZING Z;

DISPLAY X1.l, X2.l, Z.l;

You might also like