编号: 20
《运
《运
筹
筹
学
学
基
基
础》
础》
课
课
程
程
设
设
计
计
题 目:指派问题的算法分析与实现
院 系:
专 业:
姓名学号:
指导教师:
日 期: 2011 年 1 月 15 日
摘 要
在企业、公司的运营与管理中,管理者总是希望把人员最佳分派以发挥其最
大工作效率,从而降低成本、提高效益。然而,如果没有科学的方法是很难实现
优化管理的,由此我们引入了指派问题。指派问题多是求项目的工时最少,而很
多情况下人们并不关心项目总工时的多少,而只关心项目能否在最短的时间内完
成,即历时最少的指派问题。这类问题研究的是 n 个人执行 n 项任务,执行每项
任务的人数以及总的指派人项数均有限制,要求最优指派。在运筹学中求解整数
规划的指派问题通常是通过匈牙利算法来求解,但指派问题也可以归结为一个
0-1 整数规划问题,本文先对指派问题进行陈述,引出对实际问题的求解。在指
派问题的背景、描述中充分理解该问题,先运用匈牙利算法实现指派问题,然后
再建立一个 0-1 整数规划模型,并运用 matlab 和 lingo 编译程序对问题进行编
译,运用软件解决模型问题,最终实现指派问题在实际问题中的运用。通过运用
匈牙利算法和 0-1 整数规划同时对指派问题求解,我们发现用 0-1 整数规划的方
法来求解可以更简单,也更方便程序的阅读和理解。与此同时,我们还对 0-1 整
数规划问题由整数数据深入研究到小数数据。最后通过实例来说明运用 matlab,
lingo 编译程序来解决整数规划问题的简便和有效性。
关键词:指派问题;匈牙利算法;0-1 整数规划;matlab 模型;lingo 模型
Abstract
In business, the company's operations and management, managers always want
the best distribution of the staff to maximize their efficiency, reduce costs and
improve efficiency. However, if there is no scientific method is difficult to achieve
optimal management, which we introduced the assignment problem.
Multi-assignment problem is to get the project working hours at least, and in many
cases people do not care about how much the total project work, but only care about
whether the project can be completed within the shortest possible time, that lasted for
at least the assignment problem. Such problems is the n individual execution of tasks
n, the number of people to perform each task and assign the total number of items are
restricted to two people, requiring the optimal assignment. Integer programming in
operations research for solving the assignment problem is usually solved by
Hungarian algorithm, but the assignment problem can be reduced to a 0-1 integer
programming problem, this paper first to make a statement on the assignment problem,
leads to the solution of practical problems. Assignment problem in the background to
fully understand the problem description, the first assignment problem using
Hungarian algorithm, and then a 0-1 integer programming model and compiler using
matlab and the lingo of the problem to be compiled using the software solution model
problem Ultimately in the assignment of the application in practical problems. By
using the Hungarian algorithm and the 0-1 integer programming to solve assignment
problems simultaneously, we found that 0-1 integer programming method to solve a
more simple and easier to read and understand the program. At the same time, we also
0-1 integer programming problem in-depth study by the integer data to a decimal data.
Finally, an example to illustrate the use of matlab, lingo compiler to solve the integer
programming problem is simple and effective.
Keywords: assignment problem; Hungarian algorithm; 0-1 integer programming;
matlab model; lingo model
目录
1. 问题陈述 ..............................................1
2. 指派问题的背景 ........................................1
3. 指派问题的描述 ........................................1
3.1 指派问题的一般形式 ..........................................1
3.2 问题的数学模型一般形式 ......................................2
3.3 目标函数极大化的指派问题 ....................................2
4.指派问题实现 ..........................................3
4.1 匈牙利算法 .................................................3
4.1.1 匈牙利算法的理论基础...................................3
4.1.2 匈牙利算法的实现步骤...................................3
4.1.3 匈牙利算法实现指派问题.................................4
4.2 0-1 整数规划................................................5
4.2.1 模型假设..............................................5
4.2.2 模型建立..............................................6
4.2.3 模型求解..............................................7
5. 问题的深入(0-1 整数规划) ............................10
5.1 模型建立 ...................................................10
5.2 模型求解 ...................................................11
5.2.1 用 matlab 求解问题.....................................11
5.2.2 用 lingo 求解问题......................................12
6. 结论 .................................................14
6.1 总结概论 ..................................................14
6.2 具体分工 ..................................................14
6.3 个人感言 ..................................................14
7. 参考文献 .............................................17
0
1. 问题陈述
指派问题又称分配问题,其用途非常广泛,比如某公司指派 n 个人去做 n 件
事,各人做不同的事,如何安排人员使得总费用最少?若考虑每个职工对工作效
率(如熟练程度等),怎样安排会使总销量达到最大?这些都是一个企业经营管
理者必须考虑的问题,所以该问题有重要的应用价值。
假设有 n 件工作分派给 n 个人来做,每项工作只能由一人来做,每个人只能
做一项工作。若给出各人对各项工作所具有的工作效率。问应该如何安排人选,
及发挥个人特长又能使总的效率最大。为此用 0-1 整数规划来实现指派问题即如
何安排人选。
2. 指派问题的背景
在现实生活中,有各种性质的指派问题(Assignment Problem)。例如,在
生产管理中,总希望把人员进行最佳分配,以发挥最大的工作效率;某部门有 n
项任务要完成,而该部门正好有 n 个人可以分别去完成其中任何一项,但由于任
务性质和个人的专长不同,因此各人完成各项不同任务的效益(所费时间或所花
费用)也有差别,如果分配每个人完成一项任务且仅为一项任务,则把每项任务
分配给哪个人去完成,使完成所有 n 项任务的总效益为最高(总时间、总费用为
最小或创造的价值最大)?这是典型的分配问题或指派问题。又如有 n 项加工任
务,怎样指定 n 台机器分别去完成,以使总的加工时间最少或总收入最大;有 n
条航线,怎样指定 n 艘船分别航行,使总收入最大,等等,都属于指派问题。
3. 指派问题的描述
3.1 指派问题的一般形式
指派问题的标准形式(以人和事为例)如下。有 n 个人和 n 项任务,已知第
i 个人做第 j 件事的费用为
ij
c
,要求确定人和事之间的一一对应的指派方案,使
完成这 n 项任务的费用最少。
一般把目标函数的系数写为矩阵形式,称矩阵