HOME

TheInfoList



OR:

The assignment problem is a fundamental combinatorial optimization problem. In its most general form, the problem is as follows: :The problem instance has a number of ''agents'' and a number of ''tasks''. Any agent can be assigned to perform any task, incurring some ''cost'' that may vary depending on the agent-task assignment. It is required to perform as many tasks as possible by assigning at most one agent to each task and at most one task to each agent, in such a way that the ''total cost'' of the assignment is minimized. Alternatively, describing the problem using graph theory: :The assignment problem consists of finding, in a weighted bipartite graph, a matching of a given size, in which the sum of weights of the edges is minimum. If the numbers of agents and tasks are equal, then the problem is called ''balanced assignment''. Otherwise, it is called ''unbalanced assignment''. If the total cost of the assignment for all tasks is equal to the sum of the costs for each agent (or the sum of the costs for each task, which is the same thing in this case), then the problem is called ''linear assignment''. Commonly, when speaking of the ''assignment problem'' without any additional qualification, then the ''linear balanced assignment problem'' is meant.


Examples

Suppose that a taxi firm has three taxis (the agents) available, and three customers (the tasks) wishing to be picked up as soon as possible. The firm prides itself on speedy pickups, so for each taxi the "cost" of picking up a particular customer will depend on the time taken for the taxi to reach the pickup point. This is a ''balanced assignment'' problem. Its solution is whichever combination of taxis and customers results in the least total cost. Now, suppose that there are ''four'' taxis available, but still only three customers. This is an ''unbalanced assignment'' problem. One way to solve it is to invent a fourth dummy task, perhaps called "sitting still doing nothing", with a cost of 0 for the taxi assigned to it. This reduces the problem to a balanced assignment problem, which can then be solved in the usual way and still give the best solution to the problem. Similar adjustments can be done in order to allow more tasks than agents, tasks to which multiple agents must be assigned (for instance, a group of more customers than will fit in one taxi), or maximizing profit rather than minimizing cost.


Formal definition

The formal definition of the assignment problem (or linear assignment problem) is :Given two sets, ''A'' and ''T'', of equal size, together with a weight function ''C'' : ''A'' × ''T'' → R. Find a bijection ''f'' : ''A'' → ''T'' such that the cost function: ::\sum_C(a,f(a)) is minimized. Usually the weight function is viewed as a square real-valued
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** '' The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchi ...
''C'', so that the cost function is written down as: :\sum_C_ The problem is "linear" because the cost function to be optimized as well as all the constraints contain only linear terms.


Algorithms

A naive solution for the assignment problem is to check all the assignments and calculate the cost of each one. This may be very inefficient since, with ''n'' agents and ''n'' tasks, there are ''n''! (
factorial In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial: \begin n! &= n \times (n-1) \times (n-2) ...
of ''n'') different assignments. Fortunately, there are many algorithms for solving the problem in time
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An ex ...
in ''n''. The assignment problem is a special case of the transportation problem, which is a special case of the minimum cost flow problem, which in turn is a special case of a linear program. While it is possible to solve any of these problems using the simplex algorithm, each specialization has a smaller solution space and thus more efficient algorithms designed to take advantage of its special structure.


Balanced assignment

In the balanced assignment problem, both parts of the bipartite graph have the same number of vertices, denoted by ''n''. One of the first polynomial-time algorithms for balanced assignment was the
Hungarian algorithm The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal–dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name "Hu ...
. It is a ''global'' algorithm – it is based on improving a matching along augmenting paths (alternating paths between unmatched vertices). Its run-time complexity, when using Fibonacci heaps, is O(mn + n^2\log n), where ''m'' is a number of edges. This is currently the fastest run-time of a strongly polynomial algorithm for this problem. If all weights are integers, then the run-time can be improved to O(mn + n^2\log \log n), but the resulting algorithm is only weakly-polynomial. If the weights are integers, and all weights are at most ''C'' (where ''C''>1 is some integer), then the problem can be solved in O(m\sqrt \log(n\cdot C)) weakly-polynomial time in a method called ''weight scaling''. In addition to the global methods, there are ''local methods'' which are based on finding local updates (rather than full augmenting paths). These methods have worse asymptotic runtime guarantees, but they often work better in practice. These algorithms are called
auction algorithm The term "auction algorithm"Dimitri P. Bertsekas. "A distributed algorithm for the assignment problem"original paper, 1979 applies to several variations of a Optimization (mathematics), combinatorial optimization algorithm which solves assignment ...
s, push-relabel algorithms, or preflow-push algorithms. Some of these algorithms were shown to be equivalent. Some of the local methods assume that the graph admits a ''perfect matching''; if this is not the case, then some of these methods might run forever. A simple technical way to solve this problem is to extend the input graph to a ''complete bipartite graph,'' by adding artificial edges with very large weights. These weights should exceed the weights of all existing matchings, to prevent appearance of artificial edges in the possible solution. As shown by Mulmuley, Vazirani and Vazirani, the problem of minimum weight perfect matching is converted to finding minors in the
adjacency matrix In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph. In the special case of a finite simple ...
of a graph. Using the isolation lemma, a minimum weight perfect matching in a graph can be found with probability at least . For a graph with ''n'' vertices, it requires O(\log^2(n)) time.


Unbalanced assignment

In the unbalanced assignment problem, the larger part of the bipartite graph has ''n'' vertices and the smaller part has ''r''<''n'' vertices. There is also a constant ''s'' which is at most the cardinality of a maximum matching in the graph. The goal is to find a minimum-cost matching of size exactly ''s''. The most common case is the case in which the graph admits a one-sided-perfect matching (i.e., a matching of size ''r''), and ''s''=''r''. Unbalanced assignment can be reduced to a balanced assignment. The naive reduction is to add n-r new vertices to the smaller part and connect them to the larger part using edges of cost 0. However, this requires n(n-r) new edges. A more efficient reduction is called the ''doubling technique''. Here, a new graph ''G''' is built from two copies of the original graph ''G'': a forward copy ''Gf'' and a backward copy ''Gb.'' The backward copy is "flipped", so that, in each side of ''G, there are now ''n''+''r'' vertices. Between the copies, we need to add two kinds of linking edges: * Large-to-large: from each vertex in the larger part of ''Gf'', add a zero-cost edge to the corresponding vertex in ''Gb''. * Small-to-small: if the original graph does not have a one-sided-perfect matching, then from each vertex in the smaller part of ''Gf'', add a very-high-cost edge to the corresponding vertex in ''Gb''. All in all, at most n+r new edges are required. The resulting graph always has a perfect matching of size n+r. A minimum-cost perfect matching in this graph must consist of minimum-cost maximum-cardinality matchings in ''Gf'' and ''Gb.'' The main problem with this doubling technique is that there is no speed gain when r\ll n. Instead of using reduction, the unbalanced assignment problem can be solved by directly generalizing existing algorithms for balanced assignment. The
Hungarian algorithm The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal–dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name "Hu ...
can be generalized to solve the problem in O(ms + s^2\log r) strongly-polynomial time. In particular, if ''s''=''r'' then the runtime is O(mr + r^2\log r). If the weights are integers, then Thorup's method can be used to get a runtime of O(ms + s^2\log \log r).


Solution by linear programming

The assignment problem can be solved by presenting it as a linear program. For convenience we will present the maximization problem. Each edge , where ''i'' is in A and ''j'' is in T, has a weight w_. For each edge we have a variable x_. The variable is 1 if the edge is contained in the matching and 0 otherwise, so we set the domain constraints: 0\le x_\le 1\texti,j\in A,T, \, x_\in \mathbb\texti,j\in A,T. The total weight of the matching is: \sum_ w_x_. The goal is to find a maximum-weight perfect matching. To guarantee that the variables indeed represent a perfect matching, we add constraints saying that each vertex is adjacent to exactly one edge in the matching, i.e., \sum_x_=1\texti\in A, \, ~~~ \sum_x_=1\textj\in T, \, . All in all we have the following LP: \text~~\sum_ w_x_ \text~~\sum_x_=1\texti\in A, \, ~~~ \sum_x_=1\textj\in T 0\le x_\le 1\texti,j\in A,T, \, x_\in \mathbb\texti,j\in A,T. This is an integer linear program. However, we can solve it without the integrality constraints (i.e., drop the last constraint), using standard methods for solving continuous linear programs. While this formulation allows also fractional variable values, in this special case, the LP always has an optimal solution where the variables take integer values. This is because the constraint matrix of the fractional LP is totally unimodular – it satisfies the four conditions of Hoffman and Gale.


Other methods and approximation algorithms

Other approaches for the assignment problem exist and are reviewed by Duan and Pettie (see Table II). Their work proposes an
approximation algorithm In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems (in particular NP-hard problems) with provable guarantees on the distance of the returned solu ...
for the assignment problem (and the more general
maximum weight matching In computer science and graph theory, the maximum weight matching problem is the problem of finding, in a weighted graph, a matching in which the sum of weights is maximized. A special case of it is the assignment problem, in which the input is ...
problem), which runs in linear time for any fixed error bound.


Generalization

When phrased as a graph theory problem, the assignment problem can be extended from bipartite graphs to arbitrary graphs. The corresponding problem, of finding a matching in a
weighted graph This is a glossary of graph theory. Graph theory is the study of graphs, systems of nodes or vertices connected in pairs by lines or edges Edge or EDGE may refer to: Technology Computing * Edge computing, a network load-balancing system * ...
where the sum of weights is maximized, is called the maximum weight matching problem. Another generalization of the assignment problem is extending the number of sets to be matched from two to many. So that rather than matching agents to tasks, the problem is extended to matching agents to tasks to time intervals to locations. This results in Multidimensional assignment problem (MAP).


See also

*
Auction algorithm The term "auction algorithm"Dimitri P. Bertsekas. "A distributed algorithm for the assignment problem"original paper, 1979 applies to several variations of a Optimization (mathematics), combinatorial optimization algorithm which solves assignment ...
* Generalized assignment problem * Linear bottleneck assignment problem * Monge-Kantorovich transportation problem, a more general formulation *
National Resident Matching Program The National Resident Matching Program (NRMP), also called The Match, is a United States-based private non-profit non-governmental organization created in 1952 to place U.S. medical school students into residency training programs located in Unit ...
*
Quadratic assignment problem The quadratic assignment problem (QAP) is one of the fundamental combinatorial optimization problems in the branch of optimization or operations research in mathematics, from the category of the facilities location problems first introduced by ...
* Rank-maximal matching *
Secretary problem The secretary problem demonstrates a scenario involving optimal stopping theory For French translation, secover storyin the July issue of ''Pour la Science'' (2009). that is studied extensively in the fields of applied probability, statistics, an ...
*
Stable marriage problem In mathematics, economics, and computer science, the stable marriage problem (also stable matching problem or SMP) is the problem of finding a stable matching between two equally sized sets of elements given an ordering of preferences for each elem ...
*
Stable roommates problem In mathematics, economics and computer science, particularly in the fields of combinatorics, game theory and algorithms, the stable-roommate problem (SRP) is the problem of finding a stable matching for an even-sized set. A matching is a separati ...
* Weapon target assignment problem * House allocation problem * Multidimensional assignment problem (MAP)


References and further reading

* * * {{Authority control Combinatorial optimization Matching (graph theory) Polynomial-time problems Linear programming