线性规划问题
A库货物12吨,B库货物8吨,分别按7吨,8吨,5吨调运给甲,乙,丙三个商店,从A库到商店甲,乙,丙,每吨运费分别为8元,6元,9元,从B库到甲,乙,丙三店运费分别为3元...
A库货物12吨,B库货物8吨,分别按7吨,8吨,5吨调运给甲,乙,丙三个商店,从A库 到商店甲,乙,丙,每吨运费分别为8元,6元,9元,从B库到甲,乙,丙三店运费分别为3元,4元,5元,问如何调度,才能使两库货物到三个商店的运费最少。
展开
2个回答
展开全部
设从A库运到商店甲,乙,丙分别为X11、X12、X13,设从B库运到商店甲,乙,丙分别为X21、X22、X23。
则有目标方程min Z=8*X11+6*X12+9*X13+3*X21+4*X22+5*X23
条件:X11+X12+X13=12(A库货物12吨)
X21+X22+X23=8(B库货物12吨)
X11+X21=7(甲商店7吨)
X12+X22=8(乙商店8吨)
X13+X23=5(丙商店5吨)
求解方程可得X11=0、X12=8、X13=4,X21=7、X22=0、X23=1,总费用为110元,最小。如下所示。
甲 乙 丙
A 0 8 4
B 7 0 1
法二:从运费来看,甲仓库8元,6元,9元,乙仓库3元,4元,5元。6比8和9少2和3,而3比4和5少1和2,从最小值出发,首先分配给6元得乙商店全值8吨,那么乙商店已满,甲仓库还剩4吨。
但是剩下8元、9元和3元和5元对比,9比8大1,5比3大2,从最小值出发, 把甲剩下的4吨给丙,那么5元得吨数就少,总费用小。然后得到如下结果:
甲 乙 丙
A 0 8 4
B — — —
根据守恒,填完B仓库这一列,即得到结果。
则有目标方程min Z=8*X11+6*X12+9*X13+3*X21+4*X22+5*X23
条件:X11+X12+X13=12(A库货物12吨)
X21+X22+X23=8(B库货物12吨)
X11+X21=7(甲商店7吨)
X12+X22=8(乙商店8吨)
X13+X23=5(丙商店5吨)
求解方程可得X11=0、X12=8、X13=4,X21=7、X22=0、X23=1,总费用为110元,最小。如下所示。
甲 乙 丙
A 0 8 4
B 7 0 1
法二:从运费来看,甲仓库8元,6元,9元,乙仓库3元,4元,5元。6比8和9少2和3,而3比4和5少1和2,从最小值出发,首先分配给6元得乙商店全值8吨,那么乙商店已满,甲仓库还剩4吨。
但是剩下8元、9元和3元和5元对比,9比8大1,5比3大2,从最小值出发, 把甲剩下的4吨给丙,那么5元得吨数就少,总费用小。然后得到如下结果:
甲 乙 丙
A 0 8 4
B — — —
根据守恒,填完B仓库这一列,即得到结果。
展开全部
下面是最小费用的两组解,对应的最小费用为1008元:
,,}
,,},
,,},
下面是所有满足情况的解(不排除有些重复解):
,,}
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,}
下面是按照车费由小到大排序的结果:
,,}
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,}
附上Mathematica 程序,因为程序很小, 所以没有简化程序.没有剔除重复解.
arr = {};
For[m = 0, m <= Ceiling[480/16] && m <= 7, m++,
For[p = 0, p <= Ceiling[480/16] && p <= 5, p++,
For[n = 0, n <= Ceiling[480/32] && n <= 4, n++,
For[q = 0, q <= Ceiling[480/32] && q <= 3, q++,
If[m*p*16 + n*q*32 >= 480,
arr =
Append[arr, , {n, q, 32*n*q,
60*n*q}, }];
Break[]
]
]
]
]
]
arr
Sort[arr, #1[[-1]][[-1]] < #2[[-1]][[-1]] &]
,,}
,,},
,,},
下面是所有满足情况的解(不排除有些重复解):
,,}
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,}
下面是按照车费由小到大排序的结果:
,,}
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,},
,,}
附上Mathematica 程序,因为程序很小, 所以没有简化程序.没有剔除重复解.
arr = {};
For[m = 0, m <= Ceiling[480/16] && m <= 7, m++,
For[p = 0, p <= Ceiling[480/16] && p <= 5, p++,
For[n = 0, n <= Ceiling[480/32] && n <= 4, n++,
For[q = 0, q <= Ceiling[480/32] && q <= 3, q++,
If[m*p*16 + n*q*32 >= 480,
arr =
Append[arr, , {n, q, 32*n*q,
60*n*q}, }];
Break[]
]
]
]
]
]
arr
Sort[arr, #1[[-1]][[-1]] < #2[[-1]][[-1]] &]
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询