0% found this document useful (0 votes)
4 views39 pages

Understanding Goal-Oriented Programming

The document discusses various programming techniques used for optimization problems, including Linear Programming, Integer Programming, Goal Programming, and Dynamic Programming. It outlines the conditions under which Linear Programming can be applied, introduces Goal Programming for multiple objectives, and provides examples of how to formulate problems in these contexts. Additionally, it includes exercises that illustrate the application of these techniques in real-world scenarios, such as tax income optimization and food menu planning.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views39 pages

Understanding Goal-Oriented Programming

The document discusses various programming techniques used for optimization problems, including Linear Programming, Integer Programming, Goal Programming, and Dynamic Programming. It outlines the conditions under which Linear Programming can be applied, introduces Goal Programming for multiple objectives, and provides examples of how to formulate problems in these contexts. Additionally, it includes exercises that illustrate the application of these techniques in real-world scenarios, such as tax income optimization and food menu planning.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Goal-Oriented Programming

When can Linear Programming be used?


A problem can be solved using Linear Programming if it meets
certain conditions.
It must have limited resources.
2. It must have an explicit objective (such as maximizing utility, or minimizing
the costs).
3. There must be linearity, (for example, if it takes two hours to
to produce one item, 4 will be required to manufacture two, etc.
4. There must be homogeneity, that is, the products manufactured in a
The machines are identical or the hours worked by each worker are the same.
productive.
5. There must be divisibility, it is assumed that the products or processes are
they can be divided into fractions.
Integer programming.
When subdivision is not possible, Integer Programming is used which is
a modification of Linear Programming.

Goal programming.
When there are several objectives, goal programming is used. This is
a difference in relation to linear programming which has a unique objective
to maximize or minimize.

Dynamic programming.
It is used when the problem is best solved in stages or deadlines.

There are other variants such as:


Non-Linear Programming
Quadratic Programming.
Goal Programming

Goal Programming (abbreviated GP) originally appeared in a


article by Charnes, Cooper, and Ferguson in 1955 (Romero, 2002). is used
when there are several objectives or goals and a satisfactory solution is desired
and enough (satisfactory).

The structure of each goal would follow this model:

fi(x) + ni - pi = ti

Where:
fi(x) represents the mathematical expression of the goal.
deviation variables (ni and pi).
it represents a missing value to reach the goal.
pi, deviation variable, represents an excess value above the target.
For example,
suppose that a company has two products: the first one leaves it 3 soles of
profit and the second only produces 1 sol. It is desired to obtain 50 soles from
profit. The goal would be represented by

3x1 + x2 + n - p = 50
Maybe someone in the company suggests (assumed) that they should produce 10.
products x1 and 15 products x2. This would imply:

3(10) + 1(15) + n–p = 50


30 + 15 + n - p = 50
45 + n - p = 50

Five is needed to reach the goal. In other words, the


The profit ended up 5 soles below expectations because there was a shortfall.
Now imagine that another person in the company suggests that 15 should be manufactured.
products of each type. The goal would be represented by:

3(15) + 1(15) + n–p = 50


60 + n - p = 50
Now the goal is set 10 units above what was expected.
Assume that we left the production plan at

10x1y 20x2.

This would imply:


50 + n - p = 50
Therefore, both n and p are equal to 0. (There are no shortages or surpluses).
Undesired deviation variables
Sometimes, for achieving the goal, it is more convenient for us than certain
the variable reaches its smallest value, which is zero. That variable is a variable
of unintended deviation. The situations that may arise are the following:

1. When the goal is fi(x) >= ti, the unwanted variable (y that will be sought
minimize) will be the variable n (the one that indicates a missing item).

2. When the goal is fi(x) <= ti, the undesirable variable will be p (surplus).

3. When the goal is to reach exactly the aspiration level, fi(x) = ti,
both variables (n and p) will be undesirable and therefore, variables to
minimize.

The general purpose of the PM is to minimize a function of the


undesirable deviation variables. This function is named
achievement function" (Romero, 2002).
Exercise (Taha)

In a certain country with 20,000 inhabitants, the following tax bases are established:
550 million for property tax. 35 million for food and medicine. 55 million
for sales. The annual gasoline consumption is 7.5 million gallons.

The following goals are set:

Having a tax income of 16 million.

2. That the tax on food and medicine does not exceed 10% of the total of
taxes

3. That the sales tax does not exceed 20% of the total taxes.

4. That the tax on gasoline does not exceed 2 cents per gallon.
The variables would be:
. X1 = tasa tributaria predial
. X2 = tax rate for food and medicines
. X3 = tax rate on sales
. X4 = tax for gasoline in cents per gallon.

The goals would be expressed in the following way:

To have a tax income of 16 million.

550x1 + 35x2 + 55x3 + 0.075x4 ≥16


The tax on food and medicines should not exceed 10% of the total taxes.

35x2 ≤ 0.1(550x1 + 35x2 + 55x3 + 0.075x4)

Developing the operations and simplifying, the previous goal would be:
55x1 - 31.5x2 + 5.5x3 + 0.0075x4 ≥ 0
3. That the sales tax does not exceed 20% of the total taxes.

55x3 ≤ 0.2 (550x1 + 35x2 + 55x3 + 0.075x4)

Doing the corresponding operations and simplifying, the goal


previous would remain:

110x1 + 7x2 - 44x3 + 0.015x5 ≥ 0

4. That the tax on gasoline does not exceed 2 cents per gallon.

x4 ≤ 2
Goal planning (including deviation variables) would be:

550x1 + 35x2 + 55x3 + 0.075x4 + n1 –p1 = 16

55x1 –31.5x2 + 5.5x3 + 0.0075x4 +n2 –p2 = 0

110x1 + 7x2 –44x3 + 0.015x4 +n3 –p3 = 0

X4 + n4–p4 = 0

The unwanted deviation variables would be: n1, n2, n3, n4.

The achievement function would be:

Min g(n1, n2, n3, n4)


EXERCISES.1.
MTV Steel Company produces three sizes of pipes: A, B, and C, which are
sold, respectively at $10, $12, and $9 per foot. To manufacture each foot.
0.5 minutes of processing time is required from tube A on a
particular type of modeling machine. Each foot of tube B requires 0.45
minutes and each foot of tube C requires 0.6 minutes. After the
production, each foot of pipe, regardless of type, requires 1 ounce of
welding material. The cost is estimated at $3, $4, and $4 per foot for tubes A, B
and C respectively.
For the following week, MTV Steel has received exceptionally high orders.
large that total 2000 feet of tube A, 4000 feet of tube B, and 5000 feet
from tube C. as only 40 hours of machine time are available this
week and there are only 5500 ounces of welding material in stock, the
the production department will not be able to meet this demand, which requires
a total of 97 hours of machine time and 11,000 ounces of material from
to solder.
This high level of demand is not expected to continue. Instead of expanding the
production facility capacity, the management of MTV Steel is
considering the purchase of some of these tubes from suppliers in Japan
a delivery cost of $6 per foot of tube A, $6 per foot of tube B, and $7 per foot
of tube C. Suppose that the company has set a goal of
profit of $55,000 and wants the import costs not to exceed
$40,000. Formulate this model as a goal problem, knowing that
The profit target is twice as important as the cost target.
import

Demand Price Type Time of Material for Cost of Cost of


Sale (S/ k) (k) Maquina (Min/k) soldar (oz/k) Producción (s/ k) compra (s/k)
A 10 2000 0.50 1 3 6
B 12 4000 0.45 1 3 6
C 9 5000 0.60 1 4 7
. Identification of the variables.
AP = número de pies de Tubo A por producir
BP = number of feet of Tube B to be produced.
CP = number of feet of Tube C to be produced.
AJ = number of feet of Tube A to be purchased from Japan.
BJ = number of feet of Tube B to be purchased from Japan.
CJ = número de pies de Tubo C por comprar a Japón.

Decision variables.
n+ = amount of dollars by which the profit exceeds the target of $55000
n - = amount of dollars needed to reach the target profit of $55000
p+ = amount of dollars by which imports exceed the target of $40,000
p = amount of dollars needed for imports to reach the
goal of $40000.
Identification of the Objective Function
Minimize Z = (n+) + (n-) + (p+) + (p-)

Identification of the Restrictions

Demand Restrictions

AP + AJ = 2000 (Type A demand)


BP + BJ = 4000 (Type B demand)
CP + CJ = 5000 (Type C demand)

Resource Restrictions
0.5AP + 0.45BP + 0.6CP ≤ 2400 (machine time)
AP + BP + CP ≤ 5500 (welding material)
Goal Restrictions

7AP + 8BP + 5CP + 4AJ + 6BJ + 2CJ–n+ + n- = 55000 (meta de ganancia)

6AJ + 6BJ + 7CJ–p+ + p- = 40000 (meta de


importation

Logical Restrictions

AP, BP, CP, AJ, BJ, CJ, n+, n-, p+, p- ≥ 0


EXERCISES.2.

The nutrition department of Mountain View General Hospital is


preparing a food menu that will be served one day each month. The
the department has determined that this food must provide 63000
milligrams (mg) of protein, 10 mg of iron, 15 mg of niacin, 1 mg of
thiamine and 50 mg of vitamin C. To achieve this goal, the food must
consist of a certain amount of spaghetti, turkey meat, potatoes
gratinated, spinach, and apple pie. Every 100 grams of these
foods provide the amount of each nutrient indicated in the
next table:
Proteínas Hierro Niacina Tiamina Vitamina C Grasa
Espagueti 5000 1.1 1.4 0.18 0.0 5000
Turkey 29300 1.8 5.4 0.06 0.0 5000
Potatoes 5300 0.5 0.9 0.06 10.0 7000
Spinach 3000 2.2 0.5 0.02 28.0 300
Cake of 4000 1.2 0.6 0.15 3.0 14300
Apple

The department knows that it must provide a well-balanced meal that


pleased the patient. With this goal in mind, the department will no longer serve.
300 grams of spaghetti, 300 grams of turkey, 200 grams of potatoes, 100
grams of spinach and 100 grams of apple pie. As the director of
nutrition department, you wish to determine the composition of a
food that meets nutritional requirements and provides the
minimum amount of fats.
Decision variables
SPAG = the number of 100 grams of spaghetti to include
PAVO = el número de 100 gramos de pavo que incluir
PAPA = the number of 100 grams of potato to include
SPIN = the number of 100 grams of spinach to include
MANZ = the number of 100 grams of apple pie to include

Identification of the Objective Function To Minimize


0.09F+ + 0F- + C+ + 0C-

Identification of the constraints


Goals Restrictions
5000SPAG + 5000PAVO + 7900PAPA + 300SPIN + 14300MANZ–F+ + F- =
55000 (fat)
0.15SPAG + 0.80PAVO + 0.12PAPA + 0.20SPIN + 0.51MANZ–C+ + C- = 2
(cost)
Nutrient Restrictions

5000SPAG + 29300PAVO + 5300PAPA + 3000SPIN + 4000MANZ ≤ 100000


(max. of proteins)

5000SPAG +29300PAVO +5300PAPA +3000SPIN +4000MANZ ≥ 80000


(min. of proteins)

1.1SPAG + 1.8PAVO + 0.5PAPA + 2.2SPIN + 1.2MANZ ≥ 10 (iron)

1.4SPAG + 5.4PAVO + 0.9PAPA + 0.5SPIN + 0.6MANZ ≥ 15 (niacin)

0.18SPAG + 0.06PAVO + 0.06PAPA + 0.07SPIN + 0.15MANZ ≥ 1 (tiamina)

10PAPA + 28SPIN + 3MANZ ≥ 50 (vitamin C)


Limit Restrictions

SPAG less than or equal to 3

PEACOCK ≤3
DAD less than or equal to 2

SPIN <= 1
MANZ ≤1

Logical Restrictions

SPAG, PAVO, PAPA, SPIN, MANZ, F+, F-, C+, C-≥ 0


EXERCISES.3.
A chemical company produces four different chemical products (1 and 2).
For every hour that process 1 is carried out, it produces 400kg of A and 100kg of B.
And 100kg of C. Process 2 delivers 100kg of A, 100kg of B, and 100kg of D for
hour. The company's marketing department has specified that the
Daily production must be no more than 500kg of B and 300kg of C and at least
800kg of A and 100kg of D. One run of process 1 has a cost of 500 s/hr.
And a run of Process 2 costs 100 s/hr. Assume that one kg of
each chemical A, B, C can be sold for 1, 5, 5, and 4 soles, respectively and
that the sales of process 1 are 1400 s/hr and 1000 s/hr, as well as the
earnings from process 1 are 900 and from process 2 900 soles.
Formulate a linear programming model to achieve the following goals:
That the costs are below 30,000 soles, that sales
increase to 100,000 soles and that profits increase to 200,000 soles
Solution: • First, the data from the exercise must be organized in a table.
to visualize them better.

Product Process k/h


1 2 Producción k/día Ventas S/kg
A 4000 100 800 1
B 100 100 500 5
C 100 300 5
D 100 100 4
Cost S/hr 500 100
Sales 1400 1000
Profits 900 900
Then the variables to be used must be defined.
T1= Tiempo de producción del proceso 1 (hr)
T2=Tiempo de producción del proceso 2 (hr)

• The Objective Function (O.F) is placed:

Minimize Z1=500 T1+100 T2 Costs

Maximize Z2 = 1400 T1 + 1000 T2 Sales

Maximize Z3=900 T1+900 T2 Profits


Subject to:

400 T1 + 100 T2 >= 800

100 T1 + 100 T2 <= 500


RESTRICTIONS
100 T2<=300

100T1 >= 100

T1, T2>=0
Next, a table with the goals is created.

F.O. < > Meta


+ -
Z1 X1 X2 30000
Z2 X3 X4 100000
Z3 x5 X6 200000

After the table is created, the variables that exceed the


meta or the variables that represent the amount needed to reach the goal,
to penalize them by then. In this case, the variables are those that are within
from the red box, since X2 exceeds the cost target, X3 is about
below the sales target set, just like X5 on the part of
profits
F.O. < > Meta
+ -

Z1 X1 X2 30000

Z2 X3 X4 100000

Z3 X5 X6 200000
Reasoning

500 T1+100 T2+ X1- X2= 30.000 For the costs


1400 T1 + 1000 T2 + X3 - X4 = 100,000 For Sales
900 T1+900 T2+ X5- X6= 200.000 For the profits
T1, T2 X1, X2, X3, X4, X5, X6 >= 0

The objective functions are eliminated, but I must have one, for that I need
minimize violations by penalizing the variables that do not help me
agree

• I finally achieve my Objective Function:

Minimize Z4 = X2 + X3 + X5
In a plant, two different products (1 and 2) can be manufactured. The time
what each product requires in each of the two machines is shown
in the attached table. Each machine is available for 220 minutes for each product.
Formulate a linear programming model to achieve the following goals:

ProducciónTotal: 14 unidades
Of Product 1: 8 units.
Of Product 2: 9 units

Machine (minutes)
Product 1 2
1 20 15
2 14 18
Tiempo Disponible (min) 220 220

Note: For each goal, an objective function is identified, or vice versa.


• Variables:
X1= Cantidad del producto 1. (Unidades)
X2= Cantidad del producto 2. (Unidades)
.
Goals.
ProducciónTotal: 14 unidades
Product 1: 8 units.
Producto 2: 9 unidades

• Objective functions for each goal:


Maximize Z1 = X1 + X2
Maximize Z2 = X2
Maximize Z3 = X1

Restrictions:
20 X1 + 14 X2 <= 220
15X1 + 18X2 <= 220
F.O. < > Meta
+ -

Z1 X3 X4 14

Z2 X5 X6 8

Z3 X7 X8 9

The 6 variables are penalized since some exceed the targets (x4, x5, x8).
just as there are variables that are below the target x3,
x5, x7
Reasoning:

X1+X2+X3-X4=14
X2+X5-X6 =8
X3 + X7 - X8 = 9

20 X1 + 14 X2 <= 220
15X1 + 18X2 <= 220
X1, X2, X3, X4, X5, X6, X7, X8 >= 0

• Finally, I achieve the General Objective Function:

Minimize Z4 = X3 + X4 + X5 + X6 + X7 + X8
5. A company is considering new products, it is
seeking to determine the optimal mix of products considering 3
factors:
a) Maintain the current employment level of 400 workers.
b) Keep the capital investment below 60 million soles.

In the face of doubt about not being able to achieve the goals, the following are established.
penalties: 5 if the profit target is not reached (per million soles
less); 2 for exceeding the employment target (per hundred workers); 4 for
fall below that same goal; 3 for exceeding the investment goal
of capital (per million soles more).
The contribution of each investment and utility product is presented in the
next table.
1 2 3
Utility to 12 soles 9 soles 15 soles At least
long term 120,000,000
Level of 5 3 4 Maintain
employment 4000
Investment of 5 7 8 Less than
Capital 60,000,000
The variables are defined

X1=Cantidad de producto 1
X2= Cantidad de producto 2
X3= Cantidad de producto 3

Note: if there are no restrictions, they are not needed.

Objective Functions

Max Z1=12 X1+9 X2+12 X3


Z2 = 5X1 + 3X2 + 4X3
Mini Z3=5X1+7X2+8X3
Se realiza la tabla de las metas.

F.O. < > Meta


+ -

Z1 X4 X5 120,000,000

Z2 X6 X7 4000

Z3 X8 X9 60,000,000
In this case, X4 is penalized since the goal is that the profit is at least
120,000,000 soles, so it can be more than that and therefore X4
find below the goal.

X6 and X7 are penalized because the goal is to keep the level at 4000.
employment, and these variables do not comply with this, but rather one is above
below the goal and the other above the goal.

X9 is penalized because it is above the target.


• The objective functions are placed with their new variables of
penalization and the goals.

12X1+9 X2+12 X3+ X4- X5 = 120.000.000


5X1+3X2+4 X3+ X6- X7 = 4000
5X1+7X2+8X3+ X8- X9 = 60.000.000
X1, X2, X3, X4, X5, X6, X7, X8, X9 >= 0

• Finally, the general objective function is set with the values of


penalties assigned to the variables for not complying with the
goals.

Z4 = 5 X4 + 4 X6 + 2 X7 + 3 X9

You might also like