Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

CVL609 Civil Engineering Systems

Ryerson University

Lab 8 IP, DP, GA

Integer Programming
Capital Budgeting Example - ABC manufacturing Co. (example of binary variables)
ABC manufacturing Co is considering in setting up 4 production lines with following net present
value (NPV) payoff and upfront cash investment. It cannot setup eg. three line 1, only one can
be setup for each line. ABC has $14,000 is available cash at present. Formulate an IP whose
solution will tell ABC which lines it should set up to maximize NPV.
NPV
Upfront cash

line 1
16,000
5,000

line 2
22,000
7,000

line 3
12,000
4,000

line 4
8,000
3,000

Example: Multiple Choice, Mutually Exclusive Constraints


Modify above problem to:
(a) ABC can invest in at most 2 lines

(b) If ABC invests in line 2, they must also invest in line 1

(c) If ABC invests in line2, they cannot invest in line 4 and vice versa

CVL609 Civil Engineering Systems

Ryerson University

(d) Cannot invest in line 1 unless also invest in line 3 and 4.

Dynamic Programming
Characteristics of Dynamic Programming Applications
Characteristic 1

The problem can be divided into stages with a decision required at each stage.

Characteristic 2

Each stage has a number of states associated with it.

By a state, we mean the information that is needed at any stage to make an optimal
decision.

Characteristic 3
If the states for the problem have been classified into on of T stages, there must be a
recursion that relates the cost or reward earned during stages t, t+1, ., T to the cost or
reward earned from stages t+1, t+2, . T.

Example - Equipment Replacement Problems

Companies need to determine how long a machine should be utilized before trade in for a
new one.

Problems of this type are called equipment replacement problem


Example
An auto repair shop requires use of an engine analyzer. Analyzers are kept for 1, 2 or 3 years.
Given that a new machine has just been purchased, the shop wants to determine a replacement
policy that minimizes net costs for next 5 years. New analyzer cost = $1000
mi = cost of maintaining an iith year old analyzer:

m1 = $60, m2 = $80, m3 = $120

si = salvage value for a ith year old analyzer:

s1 = $800, s2 = $600, s3 = $500

CVL609 Civil Engineering Systems

Ryerson University

Net cost = maintenance cost + replacement cost salvage value


NETWORK EXAMPLE

GENETIC ALGORITHM
The problem here is
Max Z = 2x1 + 3x2 - x12 - x22
S.T.
x 1 + x2 2
x1, x2 0
CODE
clc;
close all
clear all;
%Defining function
lb = zeros(2,1);
A = [1 1]; % Constraint
b = 2; % RHS of constraint
z = @(x) (-2*x(1) - 3*x(2) + x(1)^2 + x(2)^2); % Obj Function
[x, fval] = ga(z,2, A, b, [],[], lb)

You might also like