Tải bản đầy đủ (.pdf) (13 trang)

Chương1: BÀI TOÁN QUY HOẠCH TUYẾN TÍNH ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (774.77 KB, 13 trang )

 02/09/2012



Chuongnn-hui.blogspot.com 1






j
(j=1,2, ,n)

i
(i = 1,2, ,m).
:

i


j
là: a
ij

i
là: b
i

j
là: c


j


Bài 




Nguyên

S
1
S
2

S
n


nguyên

N
1
a
11
a
12

a
1n

b
1
N
2
a
21
a
22

a
2n
b
2
  

 
N
m
a
m1
a
m2

a
mn
b
m




c
1
c
2

c
n




j

j
(j=1,2, ,n) 
j

N
1
dùng cho 
a
11
x
1
+ a
12
x
2
a
1n

x
n

1

N
2

a
21
x
1
+ a
22
x
2
a
2n
x
n
b
2


N
m

a
m1
x

1
+ a
m2
x
2
a
mn
x
n
b
m


lãi là:
f = f(x
1
, x
2
, , x
n
) = c
1
x
1
+ c
2
x
2
c
n

x
n







Tìm x = (x
1
, x
2

n
) sao cho
f(x) = c
1
x
1
+ c
2
x
2

n
x
n



a
11
x
1
+ a
12
x
2
a
1n
x
n
b
1
.
a
21
x
1
+ a
22
x
2
a
2n
x
n
b
2




a
m1
x
1
+ a
m2
x
2
a
mn
x
n
b
m

x
1
, x
2
x
n
.




 xí   lý  có n phân  S
j


(j=1,2,,n)  lý m   N
i
(i=1,2,,m).
:
+    N
i
mà   phân  S
j

  lý  cùng       vào các
phân  là: a
ij
+   N
i
     lý theo 
 lao  là: b
i

      xí  hoàn thành 
 lao       là  .

 02/09/2012



Chuongnn-hui.blogspot.com 2


Phân




S
1

S
2


S
n





N
1
a
11
a
12

a
1n
b
1
N
2

a
21
a
22

a
2n
b
2






N
m
a
m1
a
m2

a
mn
b
m





j

j
(j=1,2, ,n). x
j


1

a
11
x
1
+ a
12
x
2
a
1n
x
n

1

N
2

a
21
x

1
+ a
22
x
2
a
2n
x
n
 b
2


N
m

a
m1
x
1
+ a
m2
x
2
a
mn
x
n
 b
m



là:
f = f(x
1
, x
2
, , x
n
) = x
1
+ x
2
x
n







Tìm x = (x
1
, x
2

n
) sao cho
f(x) = x

1
+ x
2

n


a
11
x
1
+ a
12
x
2
a
1n
x
n
 b
1
.
a
21
x
1
+ a
22
x
2

a
2n
x
n
 b
2
.




a
m1
x
1
+ a
m2
x
2
a
mn
x
n
 b
m

x
1
, x
2

x
n
.




Xí     hàng hoá  m  phát
P
i
(i=1,2,,m)  n  thu T
j
(j=1,2,,n). 
+  hàng có   phát P
i
là: a
i
+  hàng     thu T
j
là: b
j
+ Phí     hàng  P
i
 T
j
là: c
ij

    hàng có  các  phát 
  hàng   các  thu.

Hãy      hàng hoá   chi
phí là   và   yêu  thu phát.



thu

phát
T
1
:b
1
T
2
:b
2
 T
n
:b
n
P
1
:a
1
c
11


c
12




c
1n


P
2
:a
2
c
21


c
22



c
2n


    
P
m
:a
m
c

m1


c
m2



c
mn






ij

i
(i=1,2, ,m)

j
(i=1,2, ,m). x
ij


i
là:
x
i1

+ x
i2
+ x
in
= a
i



j
là:
x
1j
+ x
2j

mj
= b
j


:
f = f(x
11
, x
12

mn
) = c
11

x
11
+ c
12
x
12
c
mn
x
mn




 02/09/2012



Chuongnn-hui.blogspot.com 3



Tìm x = (x
11
, x
12

mn
) sao cho
f(x) = c

11
x
11
+ c
12
x
12

mn
x
mn


x
11
+ x
12
x
1n
= a
1



x
m1
+ x
m2
x
mn

= a
m
x
11
+ x
21
x
m1
= b
1

x
1n
+ x
2n

mn
= b
n
x
11
, x
12

mn
.



:



nguyên 
20, 40, 30. 


xí 

lãi B lãi C lãi
.




là: D1D2 và
D3D1D2
D3D1
D2 D3




cho 



lý 
III 

AB

C, phân AB,
C, phân A, 1
C.
Xí 


hoàn 
.



5000 
nhóm II và 2000 
trang .

nhóm nhóm nhóm III.

nhóm nhóm nhóm III.
 bán giá 
nhóm nhóm nhóm III.
















.
 02/09/2012



Chuongnn-hui.blogspot.com 4





3



3



3



.


















600m/phút và có

có giá là 22 
máy B có giá 42 

.


BÀI 



Tìm x = (x
1

, x
2

n
) sao cho
f(x) = c
1
x
1
+ c
2
x
2

n
x
n
max(min) (1)

a
i1
x
1
+ a
i2
x
2
a
in
x

n
b
i
, i  I
1
(2)

a
i1
x
1
+ a
i2
x
2
a
in
x
n
b
i
, i  I
2
(3)

a
i1
x
1
+ a

i2
x
2

in
x
n
= b
i
, i  I
3
(4)

x
j
 0, j  J
1
(5) .
x
j
 0, j  J
2
(6) .
x
j
 , j  J
3
(7) .

1

I
2
I
3

I
1
I
2
I
3
=
và J
1
J
2
J
3
={1,2
J
1
J
2
J
3
=



+ f(x) = x

1
 2x
3
 x
4
 2x
6
 max
x
1
+ 2x
2
 x
4
+ x
5
 8
x
1
 3x
3
 x
4
+ 3x
6
 2
2x
1
+ x
2

+ x
3
 x
4
= 5
 x
1
+ x
3
+ 2x
4
 3x
5
 6
2x
2
 2x
3
 x
4
 2x
6
 11
x
1
, x
4
 0
x
2

, x
3
, x
6
 0
x
5

 02/09/2012



Chuongnn-hui.blogspot.com 5



: hàm f(x) = c
1
x
1
+ c
2
x
2

n
x
n



1
, x
2

n







.



Tìm x = (x
1
, x
2

n
) sao cho
f(x) = c
1
x
1
+ c
2
x

2

n
x
n
(min)
a
i1
x
1
+ a
i2
x
2

in
x
n
= b
i
, i m

x
j
 0, j n .
hay
f(x) = c
j
x
j

max(min)
a
ij
x
j
= b
i


x
j
 n .
 
.




+  max thành g  
g =  f.
+ a
ij
x
j
b
i
thành a
ij
x
j

+ x
n+i
= b
i

sung thêm 
n+i
 0.
+ a
ij
x
j
 b
i
thành a
ij
x
j
 x
n+i
= b
i

sung thêm x
n+i
 0.
+ 
j
 0 thành 
j

 0 
j
=  x
j

+ 
j
  thành 
j
 
j

j
, 
j
 0

j
 
j
= x
j



 
+ f(x) = x
1
 3x
2

+ 2x
3
 x
4
 max
2x
1
+ x
2
+ x
3
 x
4
 8

x
1
 x
3
+ x
4
= 5
x
1
 2x
2
 x
3
+ 3x
4

 7
x
1
, x
3
 0
x
2
 0
x
4

g(x) =  x
1
 2x
3
 3x
7
+ x
8
 x
9
 min
2x
1
+ x
3
+ x
5
 x

7
 x
8
+ x
9
= 8

x
1
 x
3
+ x
8
 x
9
= 5
x
1
 x
3
 x
6
+ 2x
7
+ 3x
8
 3x
9
= 7
x

j
 


+ f(x) = 2x
1
 x
2
+ x
3
 3x
4
 min
x
1
+ 2x
2
+ 2x
3
 x
4
 6

2x
1
 x
2
 2x
3
+ x

4
= 9
3x
1
x
2
+ x
3
+ 2x
4
 12
x
2
, x
4
 0
x
1
 0
x
3

f(x) =  x
2
 3x
4
 2x
7
+ x
8

 x
9
 min
2x
2
 x
4
 x
5
 x
7
+ 2x
8
 2x
9
= 6

 x
2
+ x
4
 2x
7
 2x
8
+ 2x
9
= 9
x
2

+ 2x
4
+ x
6
 3x
7
+ x
8
 x
9
= 12
x
j
 
 
tìm min.


biên
Xét bài toán
f(x) = c
j
x
j
in
a
ij
x
j
= b

i


x
j
 n .
 liên    x
j
là   A
j
= [a
ij
]
m1

có các thành  là       x
j
.
 án  biên:  án mà   liên
  các  x
j
> 0  thành    
  tính.

 02/09/2012



Chuongnn-hui.blogspot.com 6



   là  x
j
> 0,  A
j
  
    là     phi   là 
x
j
= 0.
 án  biên không suy  là  án
có  m   ,      bé  m
ta có  án  biên suy .
 các  án  biên   bài toán quy
  tính là  .


Ví :
+ Xét bài toán
f(x) = 4x
1
+

x
2
+ x
3
 min
x
1

+2x
2
 x
3
= 5
x
1


x
2
+ 2x
3
= 5
x
j
 0, j=1,2,3
 nào sau là  án  biên không suy
: x
0
= (1, 4, 4), x
1
= (5, 0, 0), x
2
= (0, 5, 5)?
: x
2
= (0, 5, 5)




+ Xét bài toán
f(x) = x
1
+ 2x
2
 x
3
 min
x
1
+ x
2
+ x
3
= 4
x
1


x
2
= 0
x
j
 0, j=1,2,3
 nào sau là  án  biên không suy
: x
0
= (1, 1, 2), x

1
= (2, 2, 0), x
2
= (0, 0, 4)?
: x
1
= (2, 2, 0)



 Cách 
bài toán quy 
+ Xác 
+ Tìm các con {A
i



+    b theo  con {A
i
}  trên, ta
 các    . Thành   x có các
thành  là    .

còn .


Tìm các bài toán
+ f(x) = 2x
1

+

x
3
+ 5x
4
 min
x
1
+ x
3
+ x
4
= 5
x
2


x
3
+ 2x
4
= 1
x
j
 0, j=1,2,3,4
+ f(x) = 2x
1



x
3
+ 2x
4
 min
x
1
+ x
2
+ x
3
+ x
4
= 10
2x
2
+ x
3


x
4
= 6
x
j
 0, j=1,2,3,4
 (5, 1, 0, 0), (


, 0, 0,



),
(0, 6, 5, 0), (0, 0, 3, 2)
: (0, 0, 8, 2), (0,


, 0,


),
(4, 0, 6, 0), (7, 3, 0, 0)



Do  thành      án 
biên không suy  là  m nên suy ra  thành
  0  là n  m.
  suy ra  tìm  án  biên ta có
 cho n  m thành   0  tính giá  
m thành  còn   cách   m 
trình m .
 02/09/2012



Chuongnn-hui.blogspot.com 7


Tìm các bài toán

+ f(x) = x
1
+

6x
3
 5x
4
 min
x
1
+ 2x
3
+ 3x
4
= 5
3x
2


x
3
+ 2x
4
= 8
x
j
 0, j=1,2,3,4
+ f(x) = x
1

 6x
3
+ x
4


x
5
 max
x
1
+ 2x
4
+ x
5
= 8
x
2
+ x
4


x
5
= 4
x
3
+ x
4
+ x

5
= 6
x
j
 0, 
 (5,


, 0, 0), (0,


,


, 0),
(0,


, 0,


)
: (8,4,6,0,0), (2,10,,0,6),
(0,0,2,4,0), (0,6,0,2,4)




+  các  án  bài toán quy  
tính là     là  x, y là hai 

án    bài toán thì    x + (1 )y,
  : 0    1  là   án  bài
toán.
+  các  án    bài toán quy
  tính  là   .
+  bài toán quy   tính  chính
 có   án khác  thì nó có ít 
  án  biên.


+    và   bài toán quy  
tính  chính  có  án   là nó có
  án khác  và hàm  tiêu  .
+  bài toán quy   tính  chính
 có  án   thì nó có ít  
 án  biên là  án  .
 ý:   ta có   bài toán quy 
 tính  chính    nó có 
án    cách tìm   các  án 
biên  bài toán,  án   là  án
mà giá  hàm  tiêu   (hay  .


toán 
+ f(x) = x
1
+

6x
3

 5x
4
 min
x
1
+ 2x
3
+ 3x
4
= 5
3x
2


x
3
+ 2x
4
= 8
x
j
 0, j=1,2,3,4
+ f(x) = x
1
 6x
3
+ x
4



x
5
 max
x
1
+ 2x
4
+ x
5
= 8
x
2
+ x
4


x
5
= 4
x
3
+ x
4
+ x
5
= 6
x
j
 0, 
 x* = (0,



, 0,


),
f
min
= 



: x* = (0,6,0,2,4),
f
max
= 2




:
+ f(x) = 2x

+3y

 min
3x

+ y


 3
x

 4y

 6
x

+ 2y

 6
x  0, y  0
f
min



+ f(x) = x

+ 3y

 max
x

+ 2y

 6
2x

+ y


 10
 4
x  0, y  0
f
max

 02/09/2012



Chuongnn-hui.blogspot.com 8






hình
 vào  án  có, ta tìm cách  giá
 án  có là  án   hay 
  án  xét  là  án   thì
   ta      là 
án   thì ta thay   nó   án 
 .
Xét bài toán chính 
f(x) = c
j
x
j

in
a
ij
x
j
= b
i


x
j
 





 










1
, x

2

m


i








 




  




.







 



  



 



j
= (x
1j
, x
2j
, x
mj

j


i

j
.
 {A
i

}

ij
= a
ij
.


( 
 





 


  là 
(P) sao cho 
j

thì .
lý: 
 ngoài   liên    án  biên
  j sao cho 
j
> 0 và x
j
 0  là x

ij
 0 
 i = 1,2,,m thì (P) không có  án  .
Rõ  là hàm  tiêu không    trên
  án.



+ Xét bài toán
f(x) = x
1
+ 6x
2
+ 9x
3
in
x
1
+ 2x
3
= 6
x
2
+ x
3
= 8

x
j
 0, j = 1, 2, 3.


không?

min
= 54.


+ Xét bài toán
f(x) = 7x
1

2
+ 9x
3
in
x
1
 2x
2
= 5

2
+ x
3
= 7

x
j
 0, j = 1, 2, 3.


không?

 02/09/2012



Chuongnn-hui.blogspot.com 9



biên
j sao cho 
j
> 0 và x
ij
> 0 i
thì 




hình
Xét bài toán
f(x) = c
j
x
j
in
a
ij

x
j
= b
i


x
j
 
b
i
 


i




 





 






hình








án
x
1
x
2
 x
n



c
1
c
2
 c
n

x
1
c

1





x
11

x
12

 x
1n

x
2
c
2





x
21

x
22


 x
2n

      
x
m

c
m




x
m1

x
m2


x
mn

f(x
0
) 
1

2
 

n



+  
quay:
Xác 
s
> 0 
x
s
vào.
Dòng quay r là dòng mà 
r








,
x
r
.
x
rs






1












 












 


 















x
ij










 











 

 
















+ f(x) = x

1

2

4
+ 2x
5

6
in
x
1
+ x
4
+ x
5
 x
6
= 2
x
2
+ x
4
+ x
6
= 12
x
3
+ 2x
4

+ 4x
5
+ 3x
6
= 9

x
j
 0, j = 1, 
(0, 8, 0, 3, 0, 1). 
f
min

 02/09/2012



Chuongnn-hui.blogspot.com 10


+ f(x) = 
1

2
+ x
3
x
4
min
x

1
+ 3x
2
+ x
5
= 4
2x
1
+ x
2
x
3
+ x
6
= 3
x
2
+ 4x
3
+ x
4
= 3

x
j
 0, j = 1, 
(1, 1, 0, 2, 0, 0)
f
min






i
 
ta 


: bài toán
+ f(x) = 
1
+ x
2
+ 3x
3

4
min
x
1
+ 2x
2
 x
3
+ x
4
= 2
2x
1


2
+ 3x
3
+ 3x
4
= 9
x
1
 x
2
+ x
3

4
= 6

x
j
 0, j = 1,2,3,4.




1
+ x
2
+ 3x
3


4
in
x
1
+


x
4
= 3
x
2



x
4
= 2
x
3



x
4
= 5

x
j
 0, j = 1, 2, 3, 4.



+ f(x) = 3x
1

2

3
+ 6x
4
min
x
1
+ x
2
+ x
3
+ 13x
4
= 14
2x
1
+ x
2
+ 14x
4
= 11
3x
2
+ x

3
+ 14x
4
= 16

x
j
 0, j = 1,2,3,4.



f(x) = 3x
1

2

3
+ 6x
4
min
x
1
+


x
4
= 4
x
2

+


x
4
= 3
x
3
+


x
4
= 7

x
j
 0, j = 1, 2, 3, 4.



Xét bài toán
f(x) = c
j
x
j
in
a
ij
x

j
= b
i
, i = 1, 2, m

x
j
 

i
 


n+i


g = c
j
x
j
+ Mx
n+1
+ Mx
n+2

n+m


 02/09/2012




Chuongnn-hui.blogspot.com 11



g(x) = c
j
x
j
+ Mx
n+1
+ Mx
n+2

n+m
min
a
ij
x
j
+ x
n+i
= b
i
, i = 1, 2, m

x
j
 0, j = n+m


0
t = (x
n+1

n+m
) thì bài toán chính không có



.




+  k

+ 
j
x
j

= AM + B, 
j
= 
j
M+ 
j
.
+ có



  






 


 

 





 




 







A, B, ,  trình bày trên 2 dòng.


Ví : bài toán
+ f(x) = 
1
+ x
2
+ 3x
3

4
min
x
1
+ 2x
2
 x
3
+ x
4
= 2
2x
1

2
+ 3x
3

+ 3x
4
= 9
x
1
 x
2
+ x
3

4
= 6

x
j
 0, j = 1,2,3,4.
(3, 2, 5, 0)

min
= 8.


+ f(x) = 3x
1

2

3
+ 6x
4

in
x
1
+ x
2
+ x
3
+ 13x
4
= 14
2x
1
+ x
2
+ 14x
4
= 11
3x
2
+ x
3
+ 14x
4
= 16

x
j
 0, j = 1,2,3,4.
: (4, 3, 7, 0)


min
.




j
n

j
< 0 mà
x
j


s

: bài toán
+ f(x) = 2x
1
+ 3x
2
+ x
3
ax
x
1
 5x
2
+ x

3
= 6
2x
1
+ 2x
2
+ x
4
= 7
x
1
+ 2x
2
+ x
5
= 5

x
j
 0, j = 1,2,3,4,5.


(


,


,



, 0, 0). 
f
max
=


.
+ f(x) = 3x
1
x
2
2x
3
ax

1
+ 3x
2
+ x
3
+ x
4
= 7
3x
1

2
+ 8x
3

+ x
5
= 10
4x
1

2
+ x
6
= 12

x
j
 0, j = 
: (5, 4, 0, 0, 11, 0). 
f
max
= 11.
 02/09/2012



Chuongnn-hui.blogspot.com 12



-ins Solver
-Ins
-Ins.
-Ins

-In.
tính






j
.









Max/Min/Equal To
By Changing Cells:  
ban 
Subject to the Constraints: các ràng 









Cell Reference: 


 có 




 02/09/2012



Chuongnn-hui.blogspot.com 13





Keep Solver Solution: 

 tình 

 xem 
 Có 
Limits.





Nguyên

A B

nguyên


I 2 1 8
II 0 6 24
III 4 0 12
 

3 5






Tìm x = (x
1
, x
2
) sao cho
f(x) = 3x
1
+ 5x
2



2x
1
+ x
2

6x
2
24
4x
1
12
x
1
, x
2



:
 công ty   2     và 
ngoài    2  nguyên  A, B  
 là 6  và 8 .       2
 nguyên  A và 1  nguyên  B,  
 ngoài   1  nguyên  A và 2 
nguyên  B.     không  
ngoài  quá 1        là 2
. Giá bán      là 2000USD, giá
bán    ngoài  là 3000USD.





Bài 

j
(j=1,2, ,n)

i
(i = 1,2, ,m). 
N
i

S
j
là: a
ij
N
i
là: b
i
lãi S
j
là: c
j



×