next up previous index
Next: I101 EP Standard Up: CERNLIB Previous: H101 Linear Optimization

H301 Assignment Problem

Routine ID: H301
Author(s): F. BourgeoisLibrary: MATHLIB
Submitter: K.S. KölbigSubmitted: 15.02.1994
Language: FortranRevised:

Subroutine subprogram ASSNDX solves the so-called Assignment problem: Given an n xm matrix A of real numbers a(i,j) , find either

  1. a set k(1),k(2),...,k(n)∈1,2,...,m,0,...,0 , where 0,...,0 indicates max(n-m,0) zeros, and where for non-zero elements k(p) ≠k(q) for p ≠q , which minimizes

    S = ∑i=1na(i,k(i))

    assuming that a(i,0)=0 , or

  2. a set k(1),k(2),...,k(m)∈1,2,...,n,0,...,0 , where 0,...,0 indicates max(m-n,0) zeros, and where for non-zero elements k(p) ≠k(q) for p ≠q , which minimizes

    S = ∑j=1ma(k(j),j)

    assuming that a(0,j)=0 .

Structure:

SUBROUTINE subprogram
User Entry Names: ASSNDX
Files Referenced: Unit 6

Usage:

    CALL ASSNDX(MODE,A,N,M,IDA,K,SMIN,IW,IDW)
MODE
( INTEGER) Must be set either 1 (for case (1)), or 2 (for case (2)).
A
( REAL) Two-dimensional array of dimension (IDA,≥M ). Must contain, on entry, the matrix A. Destroyed during execution.
N
( INTEGER) Number n of rows of A.
M
( INTEGER) Number m of columns of A.
IDA
( INTEGER) Declared first dimension of A in the calling program (IDA ≥N) .
K
( INTEGER) One-dimensional array of length ≥max(N,M) . Contains, on exit, the assigned set of integers k(1),...,k(n) or k(1),...,k(m) , respectively.
SMIN
( REAL) The calculated minimum value of S.
IW
( INTEGER) Two-dimensional array of dimension (IDW,≥6 ). Used as working space.
IDW
( INTEGER) Declared first dimension of IW in the calling program (IDW ≥max(N,M) ).

Method:

The subprogram is based on the Algol procedure given in Ref. 3.

Error handling:

Error H301.1: N<1 or M<1 .
A message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

Examples:

The following example illustrates a possible use of the subprogram. A workshop has to carry out N jobs, each of which can be performed on any of M (>N) available machines. The cost of performing job I on machine J is A(I,J) . It is required to assign jobs to machines in such a way as to minimize the total cost. The solution is obtained by calling the subprogram with MODE=1 and then assigning job I to machine K(I), (I=1,2,...,N) .

References:

  1. J. Munkres, Algorithms for the assignment and transportation problems, J. SIAM 5 (1957) 32--38.
  2. R. Silver, An algorithm for the assignment problem, Comm. ACM 3 (1960) 605--606.
  3. R. Silver, Algorithm 27 ASSIGNMENT, Collected Algorithms from CACM (1960).

Input/Output

I101



next up previous index
Next: I101 EP Standard Up: CERNLIB Previous: H101 Linear Optimization


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995