0% found this document useful (0 votes)
70 views

Solving Generalized Assignment Problem With Genetic Algorithm and Lower Bound Theory

Uploaded by

VikasThada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Solving Generalized Assignment Problem With Genetic Algorithm and Lower Bound Theory

Uploaded by

VikasThada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Association of Scientific Innovation and Research (IASIR) ISSN (Print): 2279-0047

(An Association Unifying the Sciences, Engineering, and Applied Research) ISSN (Online): 2279-0055

International Journal of Emerging Technologies in Computational


and Applied Sciences (IJETCAS)
www.iasir.net

Solving Generalized Assignment Problem with Genetic Algorithm and


Lower Bound Theory
1
Mr. VikasThada, 2Mr. Utpal Shrivastava, 3Ms. Meenu Vijarania
1, 2,3
Assistant Professor (CSE), Amity University,
Gurgaon, Haryana, INDIA.

Abstract: In this paper an attempt has been made to solve the “Assignment problem” through genetic algorithm.
In the assignment problem given N men and N jobs the task is to minimize overall cost of assignment
considering the fact that a single job can be assigned to only one person. The problem is solved using genetic
algorithm using an encoding scheme along with Partially Matched Crossover (PMX) function. The experimental
setup has been carried out using values of N from 5 to 100. Though population size and generations are kept
fixed but same can be varied in each iteration. The source codes for the above have been developed in matlab.
For comparison results from lower bound theory and result from this experiment have analyzed. A comparison
table for different values of N with results is presented that also contains deviation from results obtained
through lower bound theory.
Keywords: Assignment, problem, genetic, algorithm, jobs

I. Introduction
The assignment problem popularly known also as generalized assignment problem (GAP) is a famous NP-
complete combinatorial optimization problem [1]. In the GAP the goal is to assign a set of tasks to a set of
agents with minimum cost. It is assumed that each agent has a limited amount of a single resource and every
task must be assigned to one and only one agent. The problem can also be considered N men N machine
problem where we have to assign each machine to one and only one man requiring that total cost of assigning
man to machine is minimized [2]. The GAP is best described using knapsack problems [3]. Given n items and m
knapsacks, with P[i][j] as the cost associated with assigning item j to knapsack i, W[i][j] as the weight of
assigning item j to knapsack i, and C[i] the capacity of knapsack i, assign each item j to exactly one knapsack i,
not exceeding knapsack capacities. Then the GAP can be formulated as[3]:

Min P[i][j] * X[i][j]

Subject to

X[i][j] € {0,1}, i € M, j € N.

We start with overview of Genetic Algorithm, formulation of GAP using GA and then present experimental
results.
II. Overview of GA
Genetic Algorithms [4] are based on the principle of heredity and evolution which claims “in each generation the stronger
individual survives and the weaker dies”. Therefore, each new generation would contain stronger (fitter) individuals in
contrast to its ancestors.
The process of Genetic Algorithm is as follows:
a. Initialize Population
b. Loop
i. Evaluation
ii. Selection
iii. Reproduction
iv. Croosover
v. Mutation
c. Convergence

The initial population is usually represented as a number of individuals called chromosomes. The goal is to obtain a set of
qualified chromosomes after some generations. The quality of a chromosome is measured by a fitness function. Each
generation produces new children by applying genetic crossover and mutation operators. Usually, the process ends while two
consecutive generations do not produce a significant fitness improvement or terminates after producing a certain number of
new generations.

IJETCAS 15-121; © 2015, IJETCAS All Rights Reserved Page 38


VikasThada et al., International Journal of Emerging Technologies in Computational and Applied Sciences, 11(1), December 2014-
February 2015, pp. 38-42

A. Selection
Once the fitness evaluation process is done next step is to perform selection operation. Process of selection operation is
based on the principle of ‘‘survival of the fittest’. Higher fitness valued chromosomes goes through reproduction. Lower
fitness valued chromosomes are discarded. There are number of ways to implement this operator, but all relies on the
concept that candidates with good fitness values are to be preferred over poor fitness values. The idea is to give preference to
better individuals. This selection operation does the replication of candidate chromosomes with good fitness values and
eliminating those with poor fitness values [5].

Figure 1: Selection Operator on a Population of 4 Individuals[9]

The research work uses roulette wheel selection method as selection operator [6]. It is also known as fitness proportionate
selection method.

B. Crossover[7,8]
In the crossover operation mating of two chromosomes is performed that gives birth to two new offspring. This operation of
crossover always happens with one parameter that is known as probability of crossover (ProC). When ProC is say 0.8 it
means only 80% of the total population goes for crossover operation. Rests 20% chromosomes remain abstain from this
operation and has no effect of crossover. Motive behind performing crossover operation is to explore new solutions and
exploit use of old solutions. GA forms an optimum solution by mating two fit chromosomes together. Chromosomes with
higher fitness will always have good selection probability then others with lower fitness values, thus a good solution moves
from one generation to next generation
Figure 2: Single Point Crossover Explained

C. Mutation [7, 8]
Mutation involves changing one bit of a chromosome from 0 to 1 or viceversa. This is performed under the constraint
parameter called probability of mutation (ProM). For example if ProM is 0.10 then 10% genes of total chromosomes will go
for mutation. The concept of mutation is based on this natural theory that varying breeds are possible only by varying gene
values. After this operation fitness quality of new chromosomes may be high or low then old ones. In case new
chromosomes are poor then old ones they are removed during selection process. The motive behind mutation is regaining the
lost and discovering varying breeds. For example: randomly mutate chromosome at position 5.

Figure 3: Mutation Operation Explained

IJETCAS 15-121; © 2015, IJETCAS All Rights Reserved Page 39


VikasThada et al., International Journal of Emerging Technologies in Computational and Applied Sciences, 11(1), December 2014-
February 2015, pp. 38-42

Figure 4: Basic Operation of Genetic Algorithm [9]


III. Experimentation
In this section work carried out in implementing the solution of assignment problem using GA is discussed. Its quite easy to
find the lower bounds and upper bounds given cost matrix. Lower bound is sum obtained by selecting minimum value from
each row and upper bound by selecting the diagonal elements of the cost matrix. We emphasis on implementation using GA
mainly on crossover and fitness function.

A. Chromosome Representation
The representation of the chromosome will be a tuple from 1 to N considering square cost matrix and in the population every
chromosome will be a permutation from 1 to N. If the ith entry in the tuple is j then job number j will be assigned to ith
person. Thus indexes of tuple element is row number and their value is corresponding column. For example consider the
following matrix:
18 22 33 37 19
39 13 16 17 21
21 16 13 13 21
26 15 31 34 31
27 24 14 22 29
If solution happens to be tuple [ 1 5 4 2 3] that means job 1 with cost 18 will be assigned to first person, job 5
with cost 21 will be assigned to second person and so on.

B. Crossover Function[10,11]
As elements in each tuple have to be distinct, it is very much possible that after croosoverduplicacy of elements may be there
in new offsprings. That’s why general crossover functions like 1-point, 2-point or random point crossover methods does not
work . Consider two tuples:
P1=(8 3 6 7 5 1 2 4)
P2=( 6 1 5 3 7 2 8 4)
Assuming crossover point chosen is 3, new offsprings will be:
C1=(8 3 6 3 7 2 8 4)
C2=(6 1 5 7 5 1 2 4)
Clearly the new chromosomes are not valid.
Thus we have to rely on new crossover techniques where chromosomes are some permutation of some numbers between 1
and N. Table given below shows some of the permutation respected crossover techniques.

IJETCAS 15-121; © 2015, IJETCAS All Rights Reserved Page 40


VikasThada et al., International Journal of Emerging Technologies in Computational and Applied Sciences, 11(1), December 2014-
February 2015, pp. 38-42

Table 1: Few Permutation Respected Crossover Techniques


Partially Mapped Crossover (PMX) Goldberg and Lingle (1985) [15]
Order - Crossover (OX1) Davis (1985) [13]
Order Based Crossover (OX2) Syswerda (1991) [19]
Position Based Crossover (POS) Syswerda (1991) [19]
Heuristic Crossover (HX) Grefenstette (1987) [17]
Edge Recombination Crossover (ER) Whitley et al. (1989) [18]
Sorted Match Crossover (SMX) Brady (1985) [12]
Maximal Preservative Crossover (MPX) M¨uhlenbein et al. (1988) [17]
Voting Recombination Crossover (VR) M¨uhlenbein (1989) [18]
Alternating - Position Crossover (AP) Larranaga et al. (1996) [16]

In the research work PMX techniques have been used. In this technique after the crossover has been done all elements where
there is a conflict are adjusted by some swapping operation [1]. Consider the two tuples
2 5 1 3 8 4 7 6
8 4 7 2 6 1 3 5
Using 2-point crossover new tuples are:
2 5 1 2 6 1 7 6
8 4 7 3 8 4 3 5
The conflicts are removed as:
1. 2 appear in first tuple at position 1 and 4, 3 at position 7 is swapped with 2 at position 1.
2. 1 at position 3 and at position 6 conflict. 1 at position 3 is swapped with 4 at position 2 in second tuple.
3. Similarly 6 in first tuple is swapped with 8 in second tuple.
The new tuples will be:
3 5 4 2 6 1 7 8
6 1 7 3 8 4 2 5
C. Mutation Function
For mutation two random points have been generated between 1 and N and values at these positions have been swapped.
D. Fitness Function
Tuples are generated randomly so fitness function is the sum of generated tuple multiplied by their
corresponding. This has to be minimized under the constraint that tuple should not have duplicated values which
can be easily detected as discussed in the crossover function. Best fitness function will be one which returns
result close to lower bound.
E. Selection Function
Populations were duplicated by 50% of top fitness chromosomes.
F. Results
For a population of size=1000 ,generations=100 and taking values of N=5,10,15,20,25,30,35,40,45,50,60,70,80,90,100
random cost matrices were generated and saved in the file. The same matrices were then read using readmat function. For
each of the value of N random 100 tuples were generated. The tuple size were depended on N. Using the code written in
matlab for selection, crossover, mutation and fitness result were calculated which are shown in the table .

Table 2: Simulation Results using Genetic Algorithm for GAP


Matrix Size Lower Bound Upper Bound Simulation Result Deviation from Lower Bound
5 76 107 81 5
10 125 270 141 16
15 196 432 244 48
20 234 489 292 58
25 266 606 357 91
30 328 672 441 113
35 374 891 519 145
40 433 1055 615 182
45 491 1126 731 240
50 527 1296 846 319
60 626 1455 1016 390
70 727 1808 1191 464
80 819 1910 1382 563
90 919 2203 1603 684
100 1016 2590 1784 768

IJETCAS 15-121; © 2015, IJETCAS All Rights Reserved Page 41


VikasThada et al., International Journal of Emerging Technologies in Computational and Applied Sciences, 11(1), December 2014-
February 2015, pp. 38-42

As can be seen from the table that as matrix size increases the deviation from actual lower bound increases but this deviation
can be tolerated as simulation results are computed after 10 different runs of algorithm and can be considered as true. Further
these results are highly deviated from upper bound.

IV. Conclusion & Future Work


In this paper we have solved the GAP using genetic algorithm using bounds from lower bound theory. We have shown that
results obtained using genetic algorithm is very satisfactory as compared to results obtained using lower bound theory. We
have not used the effect of probability of mutation (PM) and probability of crossover (PC) in this experimental work.
Varying the PC and PM the results can be varied. We leave it as future work. Comparison of branch and bound technique,
Hungarian technique and this present work can be compared for matrices of different size and results can be analyzed.

VI. References
[1] A.Sahu, R.Tapadar, “Solving the Assignment problem using Genetic Algorithm and Simulated Annealing”, International Journal
of Applied Mathematics, Vol 36 issue 1
[2] P.Juell, A.S.Perera,K.E.Nygard,” Application of a Genetic Algorithm to improve an existing solution for the General Assignment
Problem”, Proceedings of the 16th International Conference on Computer Applications in Industry and Engineering, Las
Vegas,2003
[3] L.A.N.Lorena, M.G.Narciso,J.E.Beasely, “A Constructive Genetic Algorithm For The Generalized Assignment Problem”,
Proceedings of the 16th International Conference on Computer Applications in Industry and Engineering, Las Vegas,2005
[4] M. Shokouhi, P.Chubak, , Z. Raeesy “ Enhancing focused crawling with genetic algorithms” Vol: 4-6, pp.503-508,2005
[5] M.A.Kauser, M. Nasar, S.K.Singh, “A Detailed Study on Information Retrieval using Genetic Algorithm”, Journal of Industrial
and Intelligent Information vol. 1, no. 3, pp.122-127 Sep 2013.
[6] http://en.wikipedia/wiki/Fitness_Proportionate_Selection
[7] B.Klabbankoh, O.Pinngern. “applied genetic algorithms in information retrieval” Proceeding of IEEE ,pp.702-711,Nov 2004
[8] J.R. Koza, “ Survey Of Genetic Algorithms And Genetic Programming”, Proceedings of the Wescon, pp.589-595,1995
[9] V.Thada, V.Jaglan, “Use of Genetic Algorithm in Web Information Retrieval”, International Journal of Emerging Technologies
in Computational and Applied Sciences, vol.7,no.3,pp.278-281, Feb,2014
[10] Kelly D. Crawford, “Solving n-Queen problem using genetic algorithms”SAC '92 Proceedings of the 1992 ACM/SIGAPP
symposium on Applied computing,pp:1039-1047,1994
[11] G. Üçoluk, “Genetic Algorithm Solution of the TSP Avoiding Special Crossover and Mutation”,Intelligent Automation & Soft
Computing, vol. 8, no.3, 2002
[12] Brady, R.M. “Optimization Strategies Gleaned from Biological Evolution.” Nature317, 1985, pp. 804.
[13] Davis, L. “Applying Adaptive Algorithms to Epistatic Domains.” Proceedings of theInternational Joint Conference on Artificial
Intelligence, 1985, pp. 162-164.
[14] Grefenstette, J. “Incorporating Problem Specific Knowledge into Genetic Algorithms.”Genetic Algorithms and Simulated
Annealing, edited by Davis L., Morgan Kaufmann,Los Altos, CA, pp. 42-60, 1987.
[15] Goldberg, D.E., and R. Lingle. “Alleles, Loci, and the Traveling Salesman Problem.”Proceedings of the First International
Conference on Genetic Algorithms and Their Application, edited by Grefenstette J., Lawrence Erlbaum Associates, Hillsdale,
NJ,1985, pp. 154-159.
[16] Larranaga, P., C.M.H. Kuijpers, M. Poza, and R.H. Murga. “Decomposing BayesianNetworks: Triangulation of the Moral Graph
with Genetic Algorithms.” Statistics andComputing, 1996.
[17] M¨uhlenbein, H., M. Gorges-Schleuter, and O. Kramer. “Evolution Algorithms in Combinatorial Optimization.” Parallel
Computing, 7, 1988, pp. 65-85.
[18] M¨uhlenbein, H. “Parallel Genetic Algorithms, Population Genetics and Combinatorial Optimization.” Proceedings on the Third
International Conference on Genetic Algorithms, edited by Schaffer J., Morgan Kaufmann Publishers, Los Altos, CA, 1989,pp.
416-421.
[19] Syswerda, G. “Schedule Optimization Using Genetic Algorithms.” Handbook of Genetic Algorithms, edited by Davis L., Van
Nostrand Reinhold, New York, 1991,pp. 332-349.
[20] Whitley, D., T. Starkweather, and D. Shaner. “The Traveling Salesman and Sequence Scheduling: Quality Solutions Using
Genetic Edge Recombination.” Handbook of Genetic Algorithms, edited by Davis L., Van Nostrand Reinhold, New York,
1991,pp. 350-372.

Acknowledgments
I thank Google for fast and efficient search and many other research papers that we’ve studied to help do this research work. Indirectly I
thank to all my colleagues at my workplace, my supervisor and above all my family for constant support in all my endeavours.

IJETCAS 15-121; © 2015, IJETCAS All Rights Reserved Page 42

You might also like