Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Course’s Name: Operation Research

Course's Number: 15041225


Instructor : Dr. Basheer Abdallah

Linear Programming Model in Equation Form


‫النموذج القياسي لمسألة البرمجة الخطية‬

LP modeL in equation Form


The development of the simplex method computations is facilitated by
imposing two requirements on the LP model:
1. All the constraints are equations with nonnegative right-hand side.
2. All the variables are nonnegative.
:‫يتميز الشكل القياسي لمسألة البرمجة الخطية بمايلي‬
‫)جميع القيود في المسألة تكون على شكل معادالت والطرف األيمن للقيد كمية موجبة‬1
‫)جميع المتغيرات هي موجبة‬2
Converting inequalities into equations with nonnegative right-hand
side.
‫تحويل المتباينات الى معادالت على أن يكون الطرف األيمن موجبا‬

Remark: To convert a (≤)-inequality to an equation, a nonnegative


slack variableis added to the left-hand side of the constraint.
Example, converted the following inequality into equation
6𝑥1 + 4𝑥2 ≤ 24
Solution: We add slack variable 𝑠1, then we have
6𝑥1 + 4𝑥2 + 𝑠1 = 24, 𝑠1 ≥ 0
The nonnegative variable s1 is the slack (or unused amount) of resource
M1.
‫ يمكن تحويل متباينات القيد (الشرط) على شكل (≤( الى معادلة وذلك باضافة‬:‫ملحوظة‬
‫( الى الطرف األيسر‬Slack variable) ‫المتغير المكمل‬
‫ حول المتبانة التالية الى معادلة‬:‫مثال‬
6𝑥1 + 4𝑥2 ≤ 24
‫𝑠 ثم نحصل على‬1‫ نضيف المتغير المكمل‬:‫الحل‬
6𝑥1 + 4𝑥2 + 𝑠1 = 24, 𝑠1 ≥ 0

Remark: To convert a (≥)-inequality to an equation, a nonnegative


surplus variable is subtracted to the left-hand side of the constraint.
Example, converted the following inequality into equation
5𝑥1 + 2𝑥2 + 4𝑥3 ≥ 10
Solution: We subtract surplus variable 𝑠2, then we have

5𝑥1 + 2𝑥2 + 4𝑥3 − 𝑠2 = 10


, 𝑠2 ≥ 0
The nonnegative variable s1 is the slack (or unused amount) of resource
M1.

‫ يمكن تحويل متباينات القيد (الشرط) على شكل (≥( الى معادلة وذلك بطرح‬:‫ملحوظة‬
‫( الى الطرف األيسر‬surplus variable) ‫المتغير الفائض‬

‫ حول المتبانة التالية الى معادلة‬:‫مثال‬


5𝑥1 + 2𝑥2 + 4𝑥3 ≥ 10
‫𝑠 ثم نحصل على‬2‫ نطرح المتغير الفائض‬:‫الحل‬
5𝑥1 + 2𝑥2 + 4𝑥3 − 𝑠2 = 10
, 𝑠2 ≥ 0

Dealing with unrestricted variables


Remark: If variable is unrestricted, then it can be converted to
Restricted variable
Example: If 𝑥𝑖 is unrestricted variable , the we can write 𝑥𝑖 as
𝑥𝑖 = 𝑥𝑖 + − 𝑥𝑖 − , 𝑥𝑖 + , 𝑥𝑖 − ≥ 0
‫التعامل مع المتغيرات غير المقيدة‬

‫ اذا كان المتغير غير مقيد فانه يمكن تحويله الى متغير محددوذلك بالتعويض عنه‬:‫ملحوظة‬
‫بمتغيرين مقيدين‬
‫ اذا كان 𝑖𝑥 متغير غير مقيد فانه يمكن كتابته كمايلي‬:‫مثال‬
𝑥𝑖 = 𝑥𝑖 + − 𝑥𝑖 − , 𝑥𝑖 + , 𝑥𝑖 − ≥ 0
Example: Convert the LPmodel into standard form
Min 𝑧 = 2𝑥1 + 4𝑥2
‫بحيث أن‬
𝑥1 + 2𝑥2 = 10 …(1)
−2𝑥1 + 3𝑥2 ≤ −5 …(2)

7𝑥1 − 5𝑥2 ≤ 6 ….(3)

𝑥1 𝑢𝑛𝑟𝑒𝑠𝑡𝑟𝑖𝑐𝑡𝑒𝑑 …(5)
𝑥2 ≥ 0 …(6)

Solution:We multiply the constraint(2) by(-1)


2x1 − 3x2 ≥ 5
We assume that x1 = x1+ − x1− , x1+ , x1− ≥ 0
We add slack variable s1 to constraint (3)
And we subtract s2 from constraint(1).
So, the standard form is
min z = 2x1+ − 2x1− + 4x2
subject to
x1+ − x1− + 2x2 = 10 …(1)
+ −
2x1 − 2x1 − 3x2 − s2 = 5 …(2)

7x1+ − 7x1− − 5x2 + s1 = 6 ….(3)

s1, s2, x1+ , x1− , x2 ≥ 0 …(6)


Transition from Graphical to Algebraic Solution
‫االنتقال من الطريقة البيانية الى الطريقة الجبرية‬

The maximum number of corner points is

‫أكبر عدد من النقاط الركنية هو‬

𝑛
𝑛!
𝐶𝑚 =
𝑚! (𝑛 − 𝑚)!

Example : Find the maximum number of corner points for the


following system
Max 𝑧 = 2𝑥1 + 3𝑥2
Subject to
2𝑥1 + 𝑥2 ≤ 4 …(1)
𝑥1 + 2𝑥2 ≤ 5 …(2)

𝑥1 , 𝑥2 ≥ 0 …(3)
Solution: m = 2 equations and n = 4 variables

So, the maximum number of the corner points is


4
4! 4! (4)(3)(2)(1)
𝐶2 = = = =6
2! (4 − 2)! 2! 2! (2)(1) (2)(1)

Basic and Non Basic Variables


Remark:
1) Basic variables are the variable that are not equal to zero
2) NonBasic variables are the variable that are equal to zero
‫) المتغيرات األساسية هي المتغيرات التي التساوي صفرا‬1:‫ملحوظة‬
‫) المتغيرات غير األساسية هي المتغيرات التي تساوي صفرا‬2
Example : Write the standard form for the following system
Then find the number of basic variables
Max 𝑧 = 2𝑥1 + 3𝑥2
Subject to
2𝑥1 + 𝑥2 ≤ 4 …(1)
𝑥1 + 2𝑥2 ≤ 5 …(2)

𝑥1 , 𝑥2 ≥ 0 …(3)

Solution:

Max 𝑧 = 2𝑥1 + 3𝑥2


Subject to
2𝑥1 + 𝑥2 + 𝑠1 = 4 …(1)
𝑥1 + 2𝑥2 + 𝑠2 = 5 …(2)

𝑠1 , 𝑠2 ,𝑥1 , 𝑥2 ≥ 0 …(3)
The basic solutions are determined by setting n – m(= 4 - 2 = 2)variables
equal to zero and solving for the remaining m(= 2) variables. For
example, if we set x1 = 0 and x2 = 0, the equations provide the unique
basic solution
s1 = 4, s2 = 5

n - m (= 4 - 2 = 2)‫يتم تحديد الحلول األساسية عن طريق تحديد متغيرات‬


m (= 2)‫وحل للمتغيرات المتبقية‬
x1 = 0 ‫ و‬x2 = 0‫ إذا قمنا بتعيين‬، ‫على سبيل المثال‬
‫فإن المعادالت توفر الحل األساسي الفريد‬
s1 = 4 ‫ و‬s2 = 5

This solution corresponds to point A in the following Figure (convince


yourself that s1 = 4 and s2 = 5 at point A). Another point can be
determined by setting s1 = 0 and s2 = 0 and then solving the
resulting two equations
2x1 + x2 = 4
x1 + 2x2 = 5

A‫في الشكل السابق يتوافق هذا الحل مع النقطة‬


s1 = 0 ‫ و‬s2 =0 ‫يمكن تحديد نقطة أخرى وذلك بفرض‬

‫ثم حل المعادلتين التاليتين‬


2𝑥1 + 𝑥2 + 𝑠1 = 4 …(1)
𝑥1 + 2𝑥2 + 𝑠2 = 5 …(2)

s1=0, s2=0
to obtain
2x1 + x2 = 4

x1 + 2x2 = 5
The associated basic solution is (x1 = 1, x2 = 2), or point C in the
Figure (1)

)1(‫ كما في الشكل‬C‫( أو النقطة‬x1 = 1 ، x2 = 2)‫الحل األساسي المرتبط هو‬


Nonbasi Basic Basic Associate feasibl Objectiv
c (zero) variabl Solutio d corner e e
variable e n point value(z)
s
(𝑥1 , 𝑥2 ) (𝑠1 , 𝑠2 ) (4,5) A yes 0
(𝑥1 , 𝑠2 ) ( 𝑥2 , 𝑠2 ) (4, −3) F No
(𝑥1 , 𝑠2 ) ( 𝑥2 , 𝑠1 ) (2.5 ,1.5) B yes
( 𝑥2 , 𝑠1 ) (𝑥1 , 𝑠2 ) (2 ,3) D yes
( 𝑥2 , 𝑠2 ) (𝑥1 , 𝑠1 ) (5, −6) E No
(𝑠1 , 𝑠2 ) (𝑥1 , 𝑥2 ) (1 , 2) C yes

The path is 𝐴 → 𝐵 → 𝐶
‫الشكل (‪)1‬‬

‫المتغيرات‬ ‫المتغيرات‬ ‫الحل‬ ‫النقطة‬ ‫منطقة‬ ‫اقتران‬


‫غير‬ ‫االساسية‬ ‫االساسي‬ ‫الركنية‬ ‫الحل‬ ‫)‪(z‬الهدف‬
‫االساسية‬ ‫المرتبطة‬ ‫المتاح‬
‫) ‪(𝑥1 , 𝑥2‬‬ ‫) ‪(𝑠1 , 𝑠2‬‬ ‫)‪(4,5‬‬ ‫𝐴‬ ‫‪yes‬‬ ‫‪0‬‬
‫) ‪(𝑥1 , 𝑠1‬‬ ‫)‪( 𝑥2 , 𝑠2 ) (4, −3‬‬ ‫‪F‬‬ ‫‪No‬‬
‫) ‪(𝑥1 , 𝑠2‬‬ ‫)‪( 𝑥2 , 𝑠1 ) (2.5 ,1.5‬‬ ‫‪B‬‬ ‫‪yes‬‬ ‫‪7.5‬‬
‫) ‪( 𝑥2 , 𝑠1‬‬ ‫)‪(𝑥1 , 𝑠2 ) (2 ,3‬‬ ‫‪D‬‬ ‫‪yes‬‬ ‫‪4‬‬
‫) ‪( 𝑥2 , 𝑠2‬‬ ‫)‪(𝑥1 , 𝑠1 ) (5, −6‬‬ ‫‪E‬‬ ‫‪No‬‬ ‫‪-‬‬
‫) ‪(𝑠1 , 𝑠2‬‬ ‫)‪(𝑥1 , 𝑥2 ) (1 , 2‬‬ ‫‪C‬‬ ‫‪yes‬‬ ‫‪8‬‬

‫المسار هو 𝐶 → 𝐵 → 𝐴‬
2𝑥1 + 𝑥2 + 𝑠1 = 4 …(1)
𝑥1 + 2𝑥2 + 𝑠2 = 5 …(2)

X1=0, s1=0
X2=4
2x2+s2=5
2(4)+s2=5
S2=5-8=-3

You might also like