A Network Flow Algorithm for Solving Generalized Assignment Problem

The generalized assignment problem (GAP) is an open problem in which an integer k is given and one wants to assign k ′ agents to k ( k ′ ≤ k ) jobs such that the sum of the corresponding cost is minimal. Unlike the traditional K -cardinality assignment problem, a job can be assigned to many, but diﬀerent, agents and an agent may undertake several, but diﬀerent, jobs in our problem. A network model with a special structure of GAP is given and an algorithm for GAP is proposed. Meanwhile, some important properties of the GAP are given. Numerical experiments are implemented, and the results indicate that the proposed algorithm can globally and eﬃciently optimize the GAP with a large range cost.


Introduction
Assignment problem (AP) is one of the fundamental combinatorial optimization problems with various applications in real life. e classical AP is proved to be an NP-hard problem, and it deals with a situation of assigning n jobs to n agents such that each job must be processed by exactly one agent and vice versa. And the popular systematic method for solving classical AP is Kuhn's Hungarian method [1,2] which can be extended for general network flow problems in a polynomial time. However, it is quite difficult to ensure that the number of jobs is exactly equal to the number of agents in real-life situation. Furthermore, jobs and agents are set to be unique in the classical AP, which leads to any row (column) in c ij , ∀i ∈ M, j ∈ N (M is an index set of agents and N is an index set of jobs) being different from every other row (column). In fact, although all agents are unique, some jobs can be identical and vice versa in practical applications. Kennington and Wang [3] give some typical problems, such as manpower planning, scheduling, and planning, in which more than one agent is assigned to the same job group. Also, a shortest augmenting path algorithm is presented for solving them.
Dell'Amico and Martello [4] considered a generalization of AP (called K-cardinality linear assignment problem) where one wants to assign k (out of m ) agents to k (out of n ) jobs (k ≤ min(m, n)) so that the sum of the corresponding cost is minimal. Some potential applications of K-cardinality linear assignment problem can be found in [5,6]. Further, the K-cardinality assignment problem has various applications, for example, in assigning agents to machines when there are multiple alternatives and only a subset of agents and machines has to be assigned. In this paper, we consider a more generalized assignment problem (GAP) in which a cost matrix A m×n and positive integer k(0 < k ≤ min m, n { }) are given and one wants to assign k ′ agents to k(k ′ ≤ k) jobs so that the sum of the corresponding cost is minimal.
Dell'Amico and Martello developed some algorithms for solving K-cardinality linear assignment problem by min-cost flow or shortest augmenting path techniques described in [4]. Also, heuristic processing techniques were given in [7]. Later, Volgenant [8] developed an algorithm for it by solving a sequence of classical AP. Recently, based on semi-Lagrangian relaxation, Belik and Jo .. rnsten [9] proposed an algorithm for the K-cardinality AP with large scale. Clearly, the GAP considered in this paper is the K-cardinality assignment problem when k ′ � k. e GAP is an NP-hard [10] problem. Later, Chu and Beasley [11] prove that GAP is NP-complete. Several algorithms have been proposed for GAP in the past few years. Most of the small sizes of the test instances have been solved by some exact methods such as branch and bound, branch and price, and cutting plane [12][13][14][15][16]. However, the exact methods are mostly unable to find an optimal solution within a reasonable computational time. Metaheuristic and heuristics have been proposed for solving GAP in order to reduce the computational time of the exact method, such as the combination of a heuristics and exact method [17], tabu search [18], simulated annealing [19], genetic algorithm [11,20], differential evolution algorithm [21,22], and bees algorithm [23].
Clearly, the GAP considered in this paper can be transformed into a classical AP when some dummy jobs or agents are introduced. And the Hungarian method and its variants [24][25][26] are presented for optimizing GAP recently. However, the transformation will result in a larger-scale problem and worse space complexity. Currently, several exact algorithms are presented for solving GAP with minimum cost, such as variable-fixing algorithm [27], branch and bound algorithm [12], and KM algorithm [28], but these algorithms can only solve GAP with some specific assumption.
is study focuses on GAP where the number of agents is not equal to the number of jobs. Specifically, one job can be assigned to many, but different, agents, and one agent may undertake many, but different, tasks. It is well known that AP is thought of as a special min-cost flow problem, which suggests that classical AP or GAP can be solved by some methods with network flow theory. Recently, an efficient algorithm was proposed for solving min-cost flow problem [29]. is paper attempts to give a variation of the algorithm presented in [29] for GAP based on the advantage of the special structure of the transformed network model. is paper is organized as follows. Section 2 gives a mathematical formulation and network flow model for the GAP; in Section 3, we describe an algorithm for solving GAP. Also, the convergence of the proposed algorithm and some important features of GAP are given in this section; Section 4 presents numerical experiments to evaluate the performance of the proposed algorithm. Concluding remarks and some further research are provided in Section 5.

Mathematical Formulation and Network Flow Model
Given an m × n matrix C � [c ij ] and an integer First, we consider the case that an agent can be assigned to more than one job, but a job is assigned to exactly one agent, that is,z j � 1, ∀j ∈ N in (1). We leave the situation that a group job can be processed by more than one agent later.
It is well known that classical AP is a bipartite matching problem which can be transformed into a maximum flow problem in a simple network. To transform the GAP defined on an undirected graph G � (M ∪ N, A), we create a directed version of G by designating each arc in A as pointing nodes in M to nodes in N. en, we introduce a source node s and a sink node t, with (s, i), ∀i ∈ M, and (j, t), ∀j ∈ N. We refer to the transformed network as G′ � (N ′ , A ′ , C, U) with a cost set C and a capacity set U associated with each arc Figure 1 illustrates the transformation. Mathematically, the transformed model is given by It is easy to deal with the case that some identical jobs can be grouped into a set. More specifically, if 1 ′ is a group set which consists of z 1′ jobs, then the capacity of (1 ′ , t) is to be set to z 1′ instead of 1.
According to the transformation mentioned above and the Integrality eorem [30], it is easy to get the following theorem.

Theorem 1.
e GAP is equivalent to the MCF. eorem 1 indicates that we can find an integral flow of value k in the transformed network in order to get an optimal solution of GAP. Although several algorithms are presented for optimizing minimum-cost flow problem, both cost and capacity are to be considered for iteratively defining residual network. Hu et al. [29] introduced an approach that can solve min-cost flow. Unlike the traditional algorithms, the proposed algorithm in [29] can find an augmenting path in the original network by updating node potentials. We will describe an algorithm for optimizing GAP based on the network model defined above in the next section.

Proposed Algorithm for Solving GAP
Hu et al. [29] gave a detail algorithm for solving minimumcost flow problem by introducing some optimality conditions. Since the transformed network flow model, shown in Figure 1, is a simple network, a modified version of the algorithm in [29] is introduced for GAP for self-contained in this section.
Let us consider a dual problem of problem (2) where p i and p ij are the dual variables of MCF. And we refer to p i and p ij as the potential of node i and arc (i, j) ∈ A ′ , respectively.
Let x ij and p � p i , p ij be the feasible solutions of MCF and DP, respectively. If x ij and p � p i , p ij are optimal solutions, according to strong duality, we have Since p i is free ∀i ∈ N ′ , let p ij � min 0, c ij + p j − p i , then p ij ≤ 0 will be held. erefore, a feasible solution p � p i , p ij of DP can be found. us, conditions (4) are equal to the conditions as follows: Clearly, an optimal solution x � x ij will satisfy conditions (5). And we have the following theorem. Theorem 2. Let x ij be a feasible solution of MCF, then x ij is an optimal solution if and only if the following conditions are satisfied: We refer the arc satisfying p i − p j � c ij , ∀(i, j) ∈ A ′ to an admissible arc. Similarly, a network is an admissible network in which each arc is an admissible arc. Clearly, x ij � 0, ∀(i, j) ∈ A ′ is an optimal solution with an integral flow of value 0. e proposed algorithm starts sending 0 unit of flow from s to t. Furthermore, by holding condition (6) at each iteration, the proposed algorithm can find at least an augmenting path from the source node s to the sink node t after updating node potential in finite iteration. erefore, flow can be augmented when the current amount flow is not maximal.
Let μ + and μ − be a forward arc set and a backward arc set on an augmenting set μ. Now we describe an algorithm for solving GAP corresponding the network G ′ � (N ′ , A ′ , C, U), where N ′ � M ⋃ N, and we refer an admissible network to R.
Clearly, for an optimal solution x * ij , ∀i ∈ M, j ∈ N, agent i(i ∈ M) will be assigned to job j(j ∈ N) if x * ij � 1. We give the following definition in advance in order to get some important properties on GAP. Definition 1. Let V i and V j be the node sets of any two augmenting paths (referred to μ i , μ j ) from source node s to sink node t, then μ i , μ j are independent augmenting paths if

Theorem 3. Suppose the current amount of flow obtained by
optimal solutions if we can find q(q ≥ k − k ′ ) independent augmenting paths in the following iteration. eorem 3 can be proved easily according to the detail algorithm and definition of independent augmenting path mentioned above, and here, we do not discuss the proof of eorem 3. Proof. Since θ � min k∈S∩M,q∈S∩N c kq − p k + p q , at least an admissible will be introduced after updating node potentials in the following iteration. us, p i′ − p j′ � c i′,j′ , and c i′,j′ � min c ij , ∀i ∈ M, j ∈ N, which implies that nodes s, i ′ , j ′ can be labeled. In addition, as c j′t � 0, then sink node t is to be labeled. erefore, we can find an augmenting path from s to t, and there exists at least a node j ′ ∈ N such that x j′t � 1. Furthermore, the equation x j′t � 1 is always satisfied in the following iterations according to the details in Algorithm 1. us, job j ′ is to be processed by an agent in M for optimal match. Similarly, for an optimal solution, there exists an agent i ′ ∈ M to be assigned to a job in N.

□
From eorem 4, we have the following corollary.

Corollary 1. Let x *
ij , i ∈ M, j ∈ N be an optimal solution for the GAP with k − 1 cardinality, then the agents and jobs corresponding to x * ij � 1 will be assigned in GAP with k cardinality.
Theorem 5. Algorithm 1 will terminate in finite iterations.
Proof. Clearly, sink node t cannot be labeled if x jt � 1, ∀j ∈ N. Otherwise, as c si � c jt � 0, ∀i ∈ M, j ∈ N, t will be labeled while j is labeled, which implies that we can find an augmenting path from s to t and one more unit flow can be sent from s to t at first iteration. In addition, node i can be labeled if j is labeled and x ij � 1. erefore, we can find an augmenting path after updating node potential in l iterations at l-th iteration, and at least one more unit flow can be sent from s to t. For GAP with k cardinality, the total number of iterations is 1 + 2 + · · · + k � ((k 2 + k)/2), which gives eorem 5.

□
As it is described in Algorithm 1, flow can be augmented after updating nodes' potential in a finite iteration. erefore, the complexity of the proposed algorithm is O(k 2 (n + m) 2 ).
Next, we will give some numerical experiments to evaluate the efficiency of Algorithm 1.

Numerical Experiments
In this section, the performance of the proposed algorithm is demonstrated by numerical experiments and we compare its performance with a PP-Lapjv algorithm [31] and bees algorithm for GAP. e bees algorithm is proposed by Ozbakir et al. [23] for the complex integer optimization problem. e PP-Lapjv algorithm is an improved version of Lapjv algorithm [32,33]. e GAP is transformed into a balanced AP when we use the PP-Lapjv algorithm for solving GAP. For the sake of simplicity, the PP-Lapjv algorithm is called A 1 . e bees algorithm and our algorithm presented in the paper are called A 2 and A 3 , respectively. e presented algorithm is coded in MATLAB R R2016b on a laptop computer with an Intel ® Corei5 TM i5-7300HQ CPU @2.50 GHz RAM 8 GB and the operating system is Windows 10 64 bit. As shown in Figure 1, the unit capacity network flow model of the GAP has a special structure that there is only forward (i, j), ∀i ∈ M, j ∈ N. us, it is easy to generate a random network which is connected.
A series of numerical experiments is implemented on test problems differing in input data values of c ij , and the c ij is drawn randomly from a uniform distribution on the intervals [0, 10 2 ], [0, 10 5 ]. is kind of generation is often encountered to evaluate algorithms for solving AP [34]. e GAP with different scales ((m, n) varying from (20,20) to (200, 400)) is considered. And each class consists of instances with k valued 0.2v, 0.4v, 0.6v, 0.8v, 0.9v, v, where v � min m, n { }. e column titled k provides the coefficient of v. Also, for each class of problem, we consider the case that an agent can be assigned to k jobs when k is given. In addition, the proposed algorithm is evaluated on various Initial settings: p i � 0, ∀i ∈ N′, x ij � 0, ∀(i, j) ∈ A′, S � s { } ⋃ M, s � N′\S. Label source node (0, 1). Let k be a given integer number ALGORITHM 1: Algorithm for GAP.  degrees of density 20% and 80%. For a given density d%, the instance is generated as follows. We first randomly generate a value r ∈ [0, 1], and for each arc (i, j), ∀i ∈ M, j ∈ N, the arc (i, j) is kept in the instance with a randomly generated cost c ij ; otherwise, the next arc is considered. Higher density means that each multiskill agent i ∈ M can be assigned to more various jobs in M. Further, the parameter setting is the same as the parameters in [23].
We report the CPU time of A 1 , A 2 , and A 3 for solving GAP in Table 1. In each block, each entry in the 6 lines gives the average CPU time computed over 10 instances, neglecting the input, the output, and generation of the network flow model. And the last line gives the average over all k values considered. Also, Figures 2 and 3 depict the average CPU time on the various k values for the density 80% and 20%, respectively. A 3 has a high probability to find an augmenting path from s to t after updating nodes' potential in two iterations, which can be easily verified by the network model and  Algorithm 1, A 3 holds the information of node potential at each iteration. erefore, for a larger range c ij ∈ [0, 10 5 ], the curves of the proposed algorithm are at the bottom of Figures 2 and 3. However, it will take more iterations for finding an augmenting path from s to t with a larger number of arcs (i, j) ∈ A ′ , i ∈ M, j ∈ N and a smaller range c ij ∈ [1, 10 2 ], (i, j) ∈ A ′ for A 3 . us, there are exceptions for the efficiency of A 3 when the size of GAP is increased (e.g.,(m, n) is greater than (100, 100) for a smaller c ij ). It is understandable that A 3 will find an augmenting path in much more iteration in a network with a smaller c ij , especially for a larger size of problem. In addition, larger size of GAP results in a greater number of local optimal solutions. us, it will take much more CPU time for A 2 , which is shown in Figures 2 and 3.
e CPU time of algorithm A 1 consists of time for running Lapjv.m file and constructing the k-th transferred cost matrix which is mainly related to the size of the problem. erefore, variation of CPU time of A 1 is much smaller than that of A 3 for the same size of problem (the size of the problem is defined by max m, n { }).

Conclusion and Further Work
is paper develops an algorithm for solving GAP in which an integer k is given and one wants to assign k ′ (k ′ ≤ k) agents to k jobs such that the sum of the corresponding cost is minimal. e problem is transformed into a network model with a special structure. And the network model of GAP can easily process the GAP in which one agent can be assigned to more than one job or a job group can be processed by more than one agent. Some important properties of GAP are derived and numerical experiments show that our proposed algorithm has some good performance for solving GAP with a larger range cost c ij and a smaller number of arcs (i, j), ∀i ∈ M, j ∈ N.
In this study, the scale of GAP is not very large, and we plan to develop some techniques for processing large-scale sparse cost matrix in order to optimize the GAP in a short time. Furthermore, it is fundamental to develop an algorithm for solving the bottleneck GAP or fuzzy GAP.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this article.