0% found this document useful (0 votes)
107 views5 pages

IT Report

The document discusses two linear programming problems. The first problem involves determining the optimal placement of fire stations among six cities to minimize costs, with the optimal solution being to place stations in cities 2 and 4. The second problem involves determining the optimal quantities of various food items to minimize costs, subject to nutritional constraints, with the optimal solution being butter=0, bread=3, orange juice=1, fat=0, with a minimum cost of $9.

Uploaded by

ahmedmidoo1595
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)
107 views5 pages

IT Report

The document discusses two linear programming problems. The first problem involves determining the optimal placement of fire stations among six cities to minimize costs, with the optimal solution being to place stations in cities 2 and 4. The second problem involves determining the optimal quantities of various food items to minimize costs, subject to nutritional constraints, with the optimal solution being butter=0, bread=3, orange juice=1, fat=0, with a minimum cost of $9.

Uploaded by

ahmedmidoo1595
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
You are on page 1/ 5

Linear Programming

Prepared for

Prof. Mousa Mohamed Mousa

Ahmed Mohamed AbdulDayem


SEC. 2
Problem 1

let xi ϵ {0, 1} so that xi = 1 means that a fire station is built in city i.


Min Z=x1+ x2+ x3+ x4+ x5+ x6
Constraints
 x1 + x2 >= 1 (City 1)
 x1 + x2 + x6 >= 1 (City 2)
 x3 + x4 >= 1 (City 3)
 x3 + x4 + x5 >= 1 (City 4)
 x4 + x5 + x6 >= 1 (City 5)
 x2 + x5 + x6 >= 1 (City 6)
xi = 0 or 1 ( i = 1 ,2 ,3 ,4 ,5 , 6)
MATLAB

• Optimal: 2 fire station at least, x2=x4=1, x1=x3= x5=x6= 0, Thus,


Menoufia Governorate can build two fire stations: one in city2
and one in city 4.
LiPS

>> Optimal solution FOUND


>> Minimum = 2
*** RESULTS - VARIABLES ***
╔═════════════╤═════════════╤═════════════╤═════════════╗
║ Variable│ Value│ Obj. Cost│ Reduced Cost║
╠═════════════╪═════════════╪═════════════╪═════════════╣
║ X1│ 0│ 1│ -1║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X2│ 1│ 1│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X3│ 0│ 1│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X4│ 1│ 1│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X5│ 0│ 1│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X6│ 0│ 1│ 0║
╚═════════════╧═════════════╧═════════════╧═════════════╝
*** RESULTS - CONSTRAINTS ***
╔═══════════╤═══════════╤═══════════╤═══════════╗
║ Constraint│ Value│ RHS│ Dual Price║
╠═══════════╪═══════════╪═══════════╪═══════════╣
║ Row1│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ Row2│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ Row3│ 1│ 1│ 1║
╟───────────┼───────────┼───────────┼───────────╢
║ Row4│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ Row5│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ Row6│ 1│ 1│ 1║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X1│ 0│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X2│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X3│ 0│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X4│ 1│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X5│ 0│ 1│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ BND.X6│ 0│ 1│ 0║
╚═══════════╧═══════════╧═══════════╧═══════════╝
Problem 2
Variables
x1: The number of scoops of butter.
X2: The number of slices of bread.
X3: The number of bottles of orange juice.
X4: the number of slices of fat.
Min Z=5x1+ 2x2+ 3x3+ 8x4
Constraints
• 400x1 + 200x2 +150x3 +500x4 >= 500 (Calories)
• 3x1 + 2x2 >= 6 (Sugar)
• 2x1 + 2x2 + 4x3 + 4x4 >= 10 (Carbohydrates)
• 2x1 + 4x2 + 1x3 + 5x4 >= 8 (Fat)
MATLAB

• Optimal: x1=0 ; x2=3 ; x3=1 ; x4=0 and The minimum cost equal
$9.
LiPS

>> Optimal solution FOUND


>> Minimum = 9

*** RESULTS - VARIABLES ***


╔═════════════╤═════════════╤═════════════╤═════════════╗
║ Variable│ Value│ Obj. Cost│ Reduced Cost║
╠═════════════╪═════════════╪═════════════╪═════════════╣
║ X1│ 0│ 5│ -2.75║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X2│ 3│ 2│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X3│ 1│ 3│ 0║
╟─────────────┼─────────────┼─────────────┼─────────────╢
║ X4│ 0│ 8│ -5║
╚═════════════╧═════════════╧═════════════╧═════════════╝
*** RESULTS - CONSTRAINTS ***
╔═══════════╤═══════════╤═══════════╤═══════════╗
║ Constraint│ Value│ RHS│ Dual Price║
╠═══════════╪═══════════╪═══════════╪═══════════╣
║ Row1│ 750│ 500│ 0║
╟───────────┼───────────┼───────────┼───────────╢
║ Row2│ 6│ 6│ 0.25║
╟───────────┼───────────┼───────────┼───────────╢
║ Row3│ 10│ 10│ 0.75║
╟───────────┼───────────┼───────────┼───────────╢
║ Row4│ 13│ 8│ 0║
╚═══════════╧═══════════╧═══════════╧═══════════╝

You might also like