版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上光明市的菜篮子工程摘要本文研究的是蔬菜市场为满足不同条件的最优调配方案问题,用了Froyd算法、线性规划建立了一系列数学规划模型,并用MATLAB和LINGO软件编程实现。关于问题一:用Froyd算法结合MATLAB编程求出收购点至个菜市场的最短距离,以用于蔬菜调运及预期的短缺损失为最小为目标建立线性规划模型。用LINGO编程求得日均费用最少为4610元。关于问题二:在模型一的基础增加各菜市场短缺量一律不超过需求量的20%的约束条件,用LINGO编程求得最少日均费用以及最优供应方案。费用最少为4806元,供应方安见正文。 关于问题三:在模型一的基础上,改为以供货充足、
2、费用最小为目标,建立模型三,用LINGO编程求得日均费用为4770元,增产的蔬菜每天应分给C收购点8000Kg。关键字:蔬菜市场调配方案 Froyd算法 线性规划一、问题的重述海江市是一个人口不到20万人的小城市。根据该市的蔬菜种植情况,分别在菜市场(A),菜市场(B)和菜市场(C)设三个收购点,再由各收购点分送到全市的8个菜市场,该市道路情况,各路段距离(单位:100m)及各收购点,菜市场的具体位置见图3.2.按常年情况,A,B,C三个收购点每天收购量分别为30000,25000和20000(单位:100 kg),各菜市场的每天需求量及发生供应短缺时带来的损失(元/100kg)见表3.设从收
3、购点至各菜市场蔬菜调运费为1元/(100kg.100m). 7 5 4 8 3 7 A 7 6 B 6 8 5 5 4 7 11 7 4 7 5 6 6 3 5 8 6 6 10 C 10 5 11 表3菜市场每天需求(100 kg)短缺损失(元/100kg)15010100812051001014010100814051208(a) 为该市设计一个从收购点至个菜市场的定点供应方案,使用于蔬菜调运及预期的短缺损失为最小;(b) 若规定各菜市场短缺量一律不超过需求量的20%,重新设计定点供应方案;(c) 为满足城市居民的蔬菜供应,光明市的领导规划增加蔬菜种植面积,试问增产的蔬菜每天应分别向A,B
4、,C三个采购点供应多少最经济合理。二、 符号说明 从A到i(各个菜市场)的最短距离 从B到i(各个菜市场)的最短距离 从C到i(各个菜市场)的最短距离 从A到i(各个菜市场)的运货量 从B到i(各个菜市场)的运货量 从C到i(各个菜市场)的运货量 总调运费 短缺损失 总费用三 模型假设1、 假设日需求量与缺货损失费用不变。2、 假设在蔬菜调配的过程中无意外发生。3、 假设新增产的蔬菜能够满足缺货量。四 模型的建立与求解4.1问题一4.1.1问题的分析:为了使用于蔬菜调运及预期的短缺损失为最小,即调运费用与缺货损失之和最小。首先考虑调运费用P,P为距离与送货量的积,因为与送货距离相关,我们必须先
5、求出A、B、C三个采购点至各个菜市场的最短距离。采用Froyd算法,结合MATLAB编程实现。其次考虑缺货损失Q,以题中要求为约束条件,损失最低位目标建立线性规划模型,用LINGO编程求解。4.1.2模型的建立与求解:由图和表格的信息知,建立一个线性规划模型,使得蔬菜调运及预期的短缺损失为最小。调运总费用P为: 若使调运总费用最少,则应保证A、B、C三个收购点到8个菜市场的路程最短,最短路线的求解过程如图一:图一:求解过程图分析上图可知,该路线为无向网络,就该图而言,网络弧集为:E=(v1,v2),(v1,v4),(v1,v5),(v2,v1),(v2,v3),(v2,v5),(v2,v6),
6、(v3,v2),.(v3,v6),(v3,v8),(v3,v9),(v4,v1),(v4,v5).(v4,v7),(v4,v10),(v5,v1),(v5,v2),(v5,v4),(v5,v6),(v5,v7),(v5,v8),(v6,v2),(v6,v3),(v6,v5),(v6,v8),(v7,v4),(v7,v5),(v7,v8),(v7,v11),(v8,v3),(v8,v5),(v8,v6),(v8,v7),(v8,v9),(v8,v11),(v9,v3),(v9,v8),(v9,v11),(v9,v13),(v9,v15),(v10,v4),(v10,v11),(v10,v12),
7、(v10,v14),(v11,v7),(v11,v8),(v11,v9)(v11,v10),(v11,v12),(v12,v10),(v12,v11),(v12,v13),(v12,v14),(v13,v9),(v13,v12),(v13,v14),(v14,v10),(v14,v12),(v14,v13),(v15,v9)下面来确定网络权矩阵:W=其中=,当(,)属于E时,为弧(,)的权=0,i=1,2,3n=inf,当(,)不属于E时。(inf为无穷大,n为网络结点个数)按上述规定,该网络的权矩阵为:0 7 inf 5 4 inf inf inf inf inf inf inf inf i
8、nf inf7 0 7 inf 8 3 inf inf inf inf inf inf inf inf infinf 7 0 inf inf 6 inf 7 11 inf inf inf inf inf inf5 inf inf 0 6 inf 5 inf inf 7 inf inf inf inf inf4 8 inf 6 0 7 4 8 inf inf inf inf inf inf inf inf 3 6 inf 7 0 inf 5 inf inf inf inf inf inf infinf inf inf 5 4 inf 0 4 inf inf 7 inf inf inf infin
9、f inf 7 inf 8 5 4 0 6 inf 5 inf inf inf infinf inf 11 inf inf inf inf 6 0 inf 3 inf 6 inf 5inf inf inf 7 inf inf inf inf inf 0 6 8 inf 10 infinf inf inf inf inf inf 7 5 3 6 0 6 inf inf infinf inf inf inf inf inf inf inf inf 8 6 0 10 5 infinf inf inf inf inf inf inf inf 6 inf inf 10 0 11 infinf inf i
10、nf inf inf inf inf inf inf 10 inf 5 11 0 infinf inf inf inf inf inf inf inf 5 inf inf inf inf inf 0因为上述网络有15个结点,故网络的权矩阵均为15阶矩阵。现在给出网络最短路线的Froyd算法:(1) d1=w.(w为所给网络的n阶权矩阵)(2) dk=,k=2,3,p.其中=min+,i,j=1,2,n.计算次数的确定:当0时,p由下式确定:pln(n-1)/ln2,这样的dp就确定了网络各点间的最短距离。此处n=15,解出p3.8074故只需要取p=4即可,即算到d4即可。按照Froyd算法:
11、d1=d,d2=fld(15,d1),d3=fld(15,d2),d4=(fld(15,d3),算的d4为:0 7 14 5 4 10 8 12 18 12 15 20 24 22 237 0 7 12 8 3 12 8 14 19 13 19 20 24 1914 7 0 16 13 6 11 7 11 18 12 18 17 23 165 12 16 0 6 13 5 9 15 7 12 15 21 17 204 8 13 6 0 7 4 8 14 13 11 17 20 22 1910 3 6 13 7 0 9 5 11 16 10 16 17 21 168 12 11 5 4 9 0
12、4 10 12 7 13 16 18 1512 8 7 9 8 5 4 0 6 11 5 11 12 16 1118 14 11 15 14 11 10 6 0 9 3 9 6 14 512 19 18 7 13 16 12 11 9 0 6 8 15 10 1415 13 12 12 11 10 7 5 3 6 0 6 9 11 820 19 18 15 17 16 13 11 9 8 6 0 10 5 1424 20 17 21 20 17 16 12 6 15 9 10 0 11 1122 24 23 17 22 21 18 16 14 10 11 5 11 0 1923 19 16 2
13、0 19 16 15 11 5 14 8 14 11 19 0d4即为该网络的距离矩阵,距离矩阵的第i行指明了到其他各点的最短距离。根据上述矩阵,分别找出A,B,C到、的最短距离,见表一:表一:收购点到菜市场的最短距离最短距离(单位:100千米)A488191162220B14771612162317C20191114615510调运量的限制:短缺损失费为:总费用为:由以上约束条件,用LINGO 软件进行线性规划求解(源程序及完整运行结果见附录),部分运行结果如下:Global optimal solution found. Objective value: 4610.000 Infeasib
14、ilities: 0. Total solver iterations: 10 Model Class: LP Total variables: 26 Nonlinear variables: 0 Integer variables: 0 Total constraints: 22 Nonlinear constraints: 0 Total nonzeros: 124 Nonlinear nonzeros: 0 Variable Value Reduced Cost P 3890.000 0. Q 720.0000 0. SA1 75.00000 0. SA2 0. 0. SA3 0. 0.
15、 SA4 0. 2. SA5 70.00000 0. SA6 55.00000 0. SA7 0. 12.00000 SA8 0. 5. SB1 0. 11.00000 SB2 60.00000 0. SB3 80.00000 0. SB4 30.00000 0. SB5 0. 2. SB6 0. 11.00000 SB7 0. 14.00000 SB8 0. 3. SC1 0. 21.00000 SC2 0. 16.00000 SC3 0. 8. SC4 0. 2. SC5 30.00000 0. SC6 0. 14.00000 SC7 90.00000 0. SC8 40.00000 0.
16、从上述运行结果中可以得出调运方案为:在此种方案下,蔬菜调运及预期的短缺损失为最小,最小金额为4610元。4.1.3模型的评价与分析: 本模型用Froyd算法快捷的求出了A、B、C三个收购点到8个菜市场的最短路程,用线性规划模型使得费用最低,并给出了上图所示的调配方案。在所得方案中每日只需4610元。4.2问题二4.2.1问题的分析:若按规定各菜市场短缺量一律不超过需求量的20%,则只需要在模型一的基础上在增加一个约束条件:每个菜市场的供应量必须不低于需求量的80%即可。即得到满足条件的模型二。4.2.2模型的建立与求解:各菜市场短缺量一律不超过需求量的20%,为满足这一条件,现对方案一进行调整
17、。只需在方案 一中加一限制条件:同理可用LINGO 编程(源程序及完整运行结果见附录),部分运行结果如下:Global optimal solution found. Objective value: 4806.000 Infeasibilities: 0. Total solver iterations: 13 Model Class: LP Total variables: 26 Nonlinear variables: 0 Integer variables: 0 Total constraints: 30 Nonlinear constraints: 0 Total nonzeros:
18、 148 Nonlinear nonzeros: 0 Variable Value Reduced Cost P 4208.000 0. Q 598.0000 0. SA1 75.00000 0. SA2 10.00000 0. SA3 0. 0. SA4 0. 2. SA5 60.00000 0. SA6 55.00000 0. SA7 0. 12.00000 SA8 0. 5. SB1 0. 11.00000 SB2 50.00000 0. SB3 64.00000 0. SB4 56.00000 0. SB5 0. 2. SB6 0. 11.00000 SB7 0. 14.00000 S
19、B8 0. 3. SC1 0. 21.00000 SC2 0. 16.00000 SC3 0. 8. SC4 0. 2. SC5 24.00000 0. SC6 0. 14.00000 SC7 72.00000 0. SC8 64.00000 0.从上述运行结果得知调整后的方案为:调整后的总损失为:4806元。4.2.3模型的评价与分析: 在增加了供货量的限制条件后,只需在模型一的基础上再增加约束条件即得到模型二。在本模型下日均花费最低为4806元。新的调配方案如上图所示。4.3问题三4.3.1问题的分析:本题的目标有二:一、要满足每个菜市场的供货量充足;二、要使得总费用最低。所以我们在模型一
20、的基础上增加了上述两个限制条件,即得到模型三。使得在供货量充足的情况下最小化日均费用。4.3.2模型的建立与求解: 要足城市居民的蔬菜供应,增加蔬菜种植面积,则需要保证所有的菜市场都满足日需求量,在问题一得基础上作出以下调整: 同理,用LINGO编程求解(源程序及完整运行结果见附录),部分运行结果如下: Global optimal solution found. Objective value: 4770.000 Infeasibilities: 0. Total solver iterations: 12 Model Class: LP Total variables: 26 Nonlin
21、ear variables: 0 Integer variables: 0 Total constraints: 22 Nonlinear constraints: 0 Total nonzeros: 124 Nonlinear nonzeros: 0 Variable Value Reduced Cost P 4770.000 0. Q 0. 0. SA1 75.00000 0. SA2 40.00000 0. SA3 0. 0. SA4 0. 2. SA5 30.00000 0. SA6 55.00000 0. SA7 0. 12.00000 SA8 0. 5. SB1 0. 11.000
22、00 SB2 20.00000 0. SB3 80.00000 0. SB4 70.00000 0. SB5 0. 2. SB6 0. 11.00000 SB7 0. 14.00000 SB8 0. 3. SC1 0. 21.00000 SC2 0. 16.00000 SC3 0. 8. SC4 0. 2. SC5 70.00000 0. SC6 0. 14.00000 SC7 90.00000 0. SC8 80.00000 0.从结果中可以的知: 故新增的蔬菜8000Kg全部运向C地,这样既能满足城市居民的蔬菜供应,又能使总损失最小,最小为:4770元。4.3.3模型的评价与分析:本模型以
23、供货充足和费用最低为目标,利用题中的约束条件解得:在供货量充足的情况下日均花费最低为4770元。并得到了全新的调配方案如上图所示,而且新增蔬菜8000Kg,且全部运向C地。五 模型的及评价与改进5.1模型的评价5.1.1模型的优点: 模型简单易懂,主要用了Froyd算法与线性规划,使问题的求解变得十分方便,能适应更重新的要求。5.1.2模型的缺点: 上述模型第三问只考虑了运输费用最小,却没有考虑到供过于求造成的货物积压问题。5.2模型的改进: 由于上述模型第三问只考虑了运输费用最小,却没有考虑到供过于求造成的货物积压问题。可将存货损失计算进去,这样会使这个模型更加完善。六 参考文献1姜启源,数
24、学模型,北京,高等教育出版社,20032黄雍检、赖明勇,MATLAB语言在运筹学中的应用,长沙,湖南大学出版社,2005七 附件问题一:MATLAB新建m文件:function y=fld(n,x)for r=1:n for i=1:n for j=1:n p(j)=x(i,j)+x(j,r); end y(r,i)=min(p); endend输入命令:d=0 7 inf 5 4 inf inf inf inf inf inf inf inf inf inf;7 0 7 inf 8 3 inf inf inf inf inf inf inf inf inf;inf 7 0 inf inf 6
25、 inf 7 11 inf inf inf inf inf inf; 5 inf inf 0 6 inf 5 inf inf 7 inf inf inf inf inf;4 8 inf 6 0 7 4 8 inf inf inf inf inf inf inf; inf 3 6 inf 7 0 inf 5 inf inf inf inf inf inf inf;inf inf inf 5 4 inf 0 4 inf inf 7 inf inf inf inf;inf inf 7 inf 8 5 4 0 6 inf 5 inf inf inf inf;inf inf 11 inf inf inf
26、 inf 6 0 inf 3 inf 6 inf 5;inf inf inf 7 inf inf inf inf inf 0 6 8 inf 10 inf;inf inf inf inf inf inf 7 5 3 6 0 6 inf inf inf;inf inf inf inf inf inf inf inf inf 8 6 0 10 5 inf;inf inf inf inf inf inf inf inf 6 inf inf 10 0 11 inf;inf inf inf inf inf inf inf inf inf 10 inf 5 11 0 inf;inf inf inf inf
27、 inf inf inf inf 5 inf inf inf inf inf 0d1=dd2=fld(15,d1)d3=fld(15,d2)d4=fld(15,d3)运行结果:d = Columns 1 through 14 0 7 Inf 5 4 Inf Inf Inf Inf Inf Inf Inf Inf Inf 7 0 7 Inf 8 3 Inf Inf Inf Inf Inf Inf Inf Inf Inf 7 0 Inf Inf 6 Inf 7 11 Inf Inf Inf Inf Inf 5 Inf Inf 0 6 Inf 5 Inf Inf 7 Inf Inf Inf Inf
28、4 8 Inf 6 0 7 4 8 Inf Inf Inf Inf Inf Inf Inf 3 6 Inf 7 0 Inf 5 Inf Inf Inf Inf Inf Inf Inf Inf Inf 5 4 Inf 0 4 Inf Inf 7 Inf Inf Inf Inf Inf 7 Inf 8 5 4 0 6 Inf 5 Inf Inf Inf Inf Inf 11 Inf Inf Inf Inf 6 0 Inf 3 Inf 6 Inf Inf Inf Inf 7 Inf Inf Inf Inf Inf 0 6 8 Inf 10 Inf Inf Inf Inf Inf Inf 7 5 3
29、6 0 6 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 8 6 0 10 5 Inf Inf Inf Inf Inf Inf Inf Inf 6 Inf Inf 10 0 11 Inf Inf Inf Inf Inf Inf Inf Inf Inf 10 Inf 5 11 0 Inf Inf Inf Inf Inf Inf Inf Inf 5 Inf Inf Inf Inf Inf Column 15 Inf Inf Inf Inf Inf Inf Inf Inf 5 Inf Inf Inf Inf Inf 0d1 = Columns 1 throu
30、gh 14 0 7 Inf 5 4 Inf Inf Inf Inf Inf Inf Inf Inf Inf 7 0 7 Inf 8 3 Inf Inf Inf Inf Inf Inf Inf Inf Inf 7 0 Inf Inf 6 Inf 7 11 Inf Inf Inf Inf Inf 5 Inf Inf 0 6 Inf 5 Inf Inf 7 Inf Inf Inf Inf 4 8 Inf 6 0 7 4 8 Inf Inf Inf Inf Inf Inf Inf 3 6 Inf 7 0 Inf 5 Inf Inf Inf Inf Inf Inf Inf Inf Inf 5 4 Inf 0 4 Inf Inf 7 Inf Inf Inf Inf Inf 7 Inf 8 5 4 0 6 Inf 5 Inf Inf Inf Inf Inf 11 Inf Inf Inf Inf 6 0 Inf 3 Inf 6 Inf Inf Inf Inf 7 Inf Inf Inf Inf Inf 0 6 8 Inf 10 Inf Inf Inf Inf Inf Inf 7 5 3 6 0 6 Inf Inf Inf Inf Inf Inf Inf Inf
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年成都银行小微普惠金融合规风险研究
- 民营单位采购制度
- 基于人力资源视角之垂直行业发展动向观察报告(2026年2月刊)-今元集团研究院
- 湖北省武汉市华中师大一附中2023-2024学年高三上学期期中语文试题
- 湘东区民政局2026年招聘合同制工作人员备考题库含答案详解(培优a卷)
- 2026广东中山市人民政府五桂山街道办事处所属事业单位招聘事业单位人员11人备考题库及答案详解一套
- 2026广东广州市体育局直属事业单位引进紧缺专业人才10人备考题库(第一次)完整答案详解
- 2026南平建阳区城市管理和综合执法局招聘协管员5人备考题库有完整答案详解
- 2026上海市建筑工程学校招聘7人备考题库及1套完整答案详解
- 2026安徽马鞍山当涂县首创水务有限公司招聘劳务派遣人员4人备考题库附答案详解(完整版)
- 量子计算入门:通过线性代数学习量子计算 课件 第11章 量子傅里叶变换
- 行政处罚法专题培训课件
- 统计知识党校培训课件
- 2025年四川省泸州市中考道德与法治真题(附答案解析)
- 传统曲艺进高校活动方案
- 心电图基础知识与识图理论考核试题题库及答案
- 2025年四川省德阳市中考一模化学试题(含答案)
- 智能化弱电培训
- 杭州中好电子有限公司搬迁项目环评报告
- 悦己人生-大学生心理健康知到课后答案智慧树章节测试答案2025年春哈尔滨工业大学
- 学校工程设计任务书
评论
0/150
提交评论