You are on page 1of 5

2018 5th International Conference on Industrial Engineering and Applications

A Comparative Study of Mixed-Integer Linear Programming and Genetic


Algorithms for Solving Binary Problems

Punyisa Kuendee Udom Janjarassuk


Faculty of Engineering Faculty of Engineering
King Mongkut’s Institute of Technology Ladkrabang King Mongkut’s Institute of Technology Ladkrabang
Bangkok, Thailand Bangkok, Thailand
e-mail: poonpoon99@hotmail.com e-mail: kjudom@gmail.com

Abstract—This paper aims to investigate the capability of [6–7], knapsack problems (KP) [8–10] and facility location
mixed-integer linear programming (MILP) method and genetic problems [11–13] are interested researches. These researches
algorithm (GA) to solve binary problem (BP). A comparative are founded in a large number of examples and can be
study on the MILP method and GA with default and tuned modeled as binary optimization problems. Binary
setting to find out an optimal solution is presented. The mixed- optimization is classified into the discrete optimization in the
integer programming library (MIPLIB 2010) is used to test type of NP-Hard or NP-complete problem. These problems
and evaluate algorithms. The evaluation is shown in quality of can be solved by using classical methods but it can take
the solution and the execution time of computation. The results expensive computation time because their model structures
show that GA is superior to MILP in execution time with
are discrete and have large feasible solution space. Therefore,
inconsistent results. However, MILP is superior to GA in
we have to use or select effective and efficient optimization
quality of the solution with more stable results.
methods to solve these complex problems.
Keywords-mixed-integer linear programming; genetic For this reason, we choose the GA method to solve the
algorithm; binary problem; mixed integer programming library standard discrete problem from MIPLIB 2010 and compared
the results to the MILP method called ‘intlinprog’ from
MATLAB program [14].
I. INTRODUCTION
Binary programming is usually to be a subfield of integer II. MIXED-INTEGER LINEAR PROGRAMMING
programs. For real-world optimization problems, integer ALGORITHMS
programming is classified into 4 types namely mixed-integer An MILP algorithm is a solver for discrete optimization
linear programs (MILP), pure integer programs (IP), binary problems which uses many techniques to find the optimal
integer programs (BP) and mixed-binary integer programs solution from the objective function, f T x , where f is a
(MBP). The advantages of setting the optimization problem
linear function vector which its elements are constant, and x
into integer-based parameters are the model problems have
is the solution vector. Bounds and linear constraints are the
more practical and more flexibility. However, the
condition of the MLP but it has no nonlinear constraints. In
disadvantages are that it may be difficult to create the model
particular, there are restrictions on the variables x to be the
and may have more difficult to find the solution.
Generally, BP variables are limited to values of 0 or 1 integer. For a given objective function f , inequality
and the BP model clearly specifies that variables are binary. matrices Aineq and equality matrices Aeq , inequality vector
Realistic examples in practice are including the decision bineq and equality vector beq , lower-bound lb and upper-
making process such as, building new facility (build it or bound ub and the integer constraint ‘intcon’, the problem
not), introducing new product (include it or not), investing in
projects (invest in a specific project or not) or selecting team model for finding a solution vector x from the feasible
(select specific individual or not) and etc. solution space is shown in (1).
There are many research contributions which use modern
min f T x
techniques to solve the BP or others integer programs. For x
vendor selection, there is a novel and practical method using ­ x (intcon ) are integers
meta-heuristic called the binary-continuous invasive weed °
° Aineq ˜ x d bineq (1)
optimization (BCIWO) algorithm that can solve both binary subject to ®
and continuous optimization problems [1]. ° Aeq ˜ x beq
The application of artificial bee colony (ABC) is °
¯ lb d x d u b
introduced to find the ambulance station location for the city
of Sao Paulo [2]. There is research on genetic algorithms for The algorithm intlinprog uses 6 strategies to solve MILP
fire station locations [3]. Furthermore, the feature selections and find the solution in any of the step. If it can find the
in medical research is improved and optimized by BP-based solution in a step, intlinprog does not precede to the later
optimization [4–5]. In addition, unit commitment problems step. The basic 6 strategies are shown as following:

978-1-5386-5748-5/18/$31.00 ©2018 IEEE 284


x Reduce the problem size using linear program Algorithm 1 Genetic Algorithm [15]
preprocessing; Assign the objective function f (x), x = (x1, ...,xn)T
x Solve an initial relaxed (non-integer) problem using Encode the feasible solution as binary strings
linear programming; Assess fitness function F v f (x) for maximization
x Perform mixed-integer program preprocessing to Build the new population
tighten the LP relaxation of the mixed-integer Set crossover probability (pc) and
problem; Set mutation probability (pm)
x Try to use cutting-plane method to further tighten the while ( iteration times < Max generation number )
LP relaxation of the mixed-integer problem as Generate new solution
shown in Fig. 1; if pc > specified value, do crossover; end if
x Try to find integer-feasible solutions using heuristics; if pm > specified value, use mutation; end if
x Use a branch and bound algorithm to search Accept the satisfied solutions based on fitness
systematically for the optimum solution. criterion
Y cutting planes
Select the best candidate for new iteration
objective end while
optimum of
Decode the simulation results with visualization
LP relaxation

The crossover step in two parent strings is the major


IP optimum operator with a probability pc. It is carried out by swapping
one segment of one chromosome with the corresponding
segment of another chromosome at a random position as
feasible shown in Fig. 2.
solutions =

0 1 0 1 0 1

X 0 0 1 0 0 1
Figure 1. Cutting-plane method
Parent Generation Crossover

0 1 0 0 0 1
III. GENETIC ALGORITHMS
GA is an evolutionary computational method. It consists 0 0 1 1 0 1
of bit-string vectors that are encoded for the objective
function to represent the population. The operational process Children Generation
of bit strings and the criteria of selection are done by genetic Figure 2. Single-point crossover at a random point
operators. To find a solution according to their fitness
function, this can be achieved by the following steps [15]: In this case, the crossover is a single-point crossover.
x Encode the objective functions of the problem; Moreover, we can use crossover at multiple points in another
x Assign an objective function or criteria of selection; occasion to improve the efficiency. The mutation step is
x Set the value of population size; done by switching the selected bits as shown in Fig. 3, and
x Assess the fitness value of all member in the the mutation probability pm is normally low value. In the
population pool; selection step, the candidate of a population is found out by
x Build a new population by crossover and mutation the evaluation process from the objective value, and it may
process, etc; stay in the next generation in case of a certain threshold of
the fitness value is met.
x Develop the population until the satisfied criteria are
GA creates three types of children for the next generation
reach;
which are elite children, crossover children and mutation
x Decode the simulation results to determine the best
children. In this work we set the children types in MATLAB
solution.
by using elite count option for elite children and crossover
The procedures mentioned above can be done
fraction option for crossover children and mutation children.
systematically by the pseudo code shown in Algorithm 1.
We can create a new population or new generation by one
iteration process. The character strings with static length are 0 1 0 0 0 1

used for GA in each process of new generation. Usually, the Mutation


objective function is coded in the form of binary arrays or
real-valued arrays in the adaptive GA. 0 0 0 0 0 1
For simplicity, binary strings are used for encoding and
decoding. The GA operators basically include crossover, New Generation
mutation, and selection from the population pool. Figure 3. Single-side mutation by switching a random bit

285
IV. COMPUTATIONAL EXPERIMENTS TABLE I. SOLUTION OF VALUE AND GAP DIFFERENCE BETWEEN
MILP AND GA
To understand the behavior of algorithms to the BP, we
provide experimental tests for the proposed method by using Value
standard instances from the sets of MIPLIB 2010 benchmark (%Gap)
Optimal
problems which are available at http://miplib.zib.de/miplib Instant
Value GA
2010-benchmark.php [16]. MILP Default Tuned
A. Experimental Settings Setting Setting
20 29.50 24.00
Test results were run on Laptop with the configuration; cov1075 20
(0.0%) (47.5%) (20.0%)
Intel i7 CPU 2.6 GHz, 4.0 GB RAM, Windows 7. The test 29 42 32
iis-100-0-cov 29
setup was investigated with GA and MILP algorithm. We (0.0%) (44.8%) (10.3%)
have selected the solution quality and execution time to -24 -37.9 -24
m100n500k4r1 -25
(4.0%) (-51.6%) (4.0%)
compare and evaluate the algorithm performance. -457.17 -257.67 -351.58
MIPLIB 2010 consists of 361 instances classified into a rmine6 -457.19
(0.0%) (43.6%) (23.1%)
group of problem sets such as IP, MIP, BP and MBP. This macrophage 374 -*
1002.6 822.7
provides the normal test set of 87 cases and all cases can be (168.1%) (120.0%)
solvable by commercial’s codes, and there is a challenge test reblock67 -3.46E+07
-3.46E+07 -1.52E+07 -3.28E+07
(0.0%) (56.0%) (5.24%)
set of 164 cases. Unfortunately, many cases of this problem -47 -44.43 -60.2
type cannot be solved. The test problem is in mathematical p6b -63
(25.4%) (29.5%) (4.44%)
programming system (mps) format which has a difference in queens-30 -40
-37 -112.6 -39
size of data and difficulty level. To save time in testing, we (7.5%) (-181.5%) (2.5%)
429 851.33 720
have set the limit of the maximum running time for finding seymour 423
(1.42%) (101.3%) (70.21%)
the optimal solution within 2 hours or 7200 seconds. 1358.33 1119.7
toll-like 610 -*
(122.7%) (83.55%)
B. Parameter Selection *Remark: No solution found
Common problem found in optimization is that the
solutions are often trapped in local minima. So the TABLE II. SOLUTION EXECUTION TIME BETWEEN MILP AND GA
algorithms have to be set up their parameters suitably. For
Execution Time (seconds)
GA, the important parameters are such as population size, Maximum Time: 2 hours or 7200 seconds
rate of mutation and crossover, and the selection criteria of GA
Instant
new population should carefully be carried out. Any MILP Default Tuned
inappropriate choice will make it difficult for the algorithm Setting Setting
to converge, or it simply produces meaningless results.
cov1075 2271.94 3.54 6.72
For MILP method in MATLAB program, we can change
the default setting of intlinprog options such as MaxTime, iis-100-0-cov 1653.49 28.41 31.08
and Heuristics, etc., to improve the performance of m100n500k4r1 7200.00* 5.43 6.13
algorithms. In the hard problems, the computational time *
rmine6 7200.00 72.04 1048.02
may take more than 2 hours or 7200 seconds to reach the
*
optimal solution. Therefore setting the MaxTime option to macrophage 7200.00 213.04 117.74
more than the default value (7200 seconds) may be required reblock67 1560.38 417.28 288.22
for finding global optima. If we need to improve the initial *
p6b 7200.00 147.39 163.17
point x0 for better convergence in computation, we may
change the Heuristics option which can provide x0 to be queens-30 7200.00* 34.79 38.37
more effective. seymour 7200.00 *
217.09 245.79

C. Computational Results toll-like 7200.00* 256.22 235.89

The selected problem instances in this work have 10 *Remark: Time limit is set to 7200 seconds
instances. The test results of all instances are shown in Table
I and Table II. In each result we tested in 10 times per result If the algorithm runs more than this limit, the MATLAB
and do average the values. By considering the quality of program will stop automatically.
solution, we see in Table I that the MILP method As in Table I, by considering the results of GA from the
demonstrates the results to the GA method with the lowest default setting, we can see that some instances such as
percentage of Gap equal to 0.0% in 4 instances. The quality m100n500k4r1 and queens-30 have the solution value lower
of solution by GA method has the lowest percentage of Gap than the optimal values. These mistaking results are caused
equal to 2.5% in case of queens-30. Unfortunately, there are by problem of constraint setting and inappropriate setting in
2 instances as macrophage and toll-like that cannot find any default value (see how to set the GA options) in [17]. Thus,
solution within the time limitation. Turn to consider in these bring to violate in problem constraints and also lead to
execution time, as shown in Table II, clearly see that the the optimal solutions to be infeasible.
MILP method has more execution time than the GA method.

286
in GA method is more significant than the problem size
when we use GA for finding the solutions. In addition, the
difficulty level of the problem is also significant for finding
the optimal solutions. The difficulty levels in MIPLIB 2010
benchmark sets are indicated to be easy, challenge and
infeasible.

TABLE III. GA MANUALLY TUNED-PARAMETER VALUES

Population Crossover Elite Maxstall


Instant Count Generations
size fraction

Figure 4. Population size vs Gap distance


cov1075 450 0.70

iis-100-0-cov 500 0.79

m100n500k4r1 150 0.79

rmine6 3000 0.81

macrophage 15 0.20
10 50
reblock67 15 0.20
p6b 89 0.70

queens-30 150 0.94


seymour 150 0.00
toll-like 100 0.00

V. CONCLUSION AND FUTURE WORKS


Figure 5. Crossover fraction vs Gap distance
The comparative study was made with 10 binary problems
Clearly notice that if we have tuned the setting values in from MIPLIB 2010 benchmark set with the mixed-integer
the GA options by an appropriate way, the problem solutions linear programming ‘intlprog’ and GA method from
will be converged and close to the optimal values. MATLAB program. The results show that GA method can
The importance factor that impacts the quality of the find the near optimal solution faster than MILP method.
solution and the execution time of GA method is the However, the MILP has strength in quality of solution with
population size and crossover fraction value. We have have the lowest percentage of gap equal to 0.0%. The GA
plotted the relationships between the population size and gap can find the lowest percentage of gap equal to 2.5% in the
distance as shown in Fig. 4 and the crossover fraction to gap challenge case of queens-30. There are 2 cases namely
distance as shown in Fig. 5. For the result of population size macrophage and toll-like that cannot find the optimal
as see in Fig. 4, we use trial and error method to find the near solution by the MILP method within the time limits.
optimal population size. We notice that the suitable We have manually tuned the parameters of GA method such
population sizes are different depending on the problems. as population size and crossover fraction. The results of
For the result of crossover fraction, we set the value tuned setting of GA method make the gap distance to
range between [0, 1] and we found that the suitable value is converge faster and the tuned values are varied depending on
near to 0.9 except in case of macrophage (0.1) and cov1075 the problems.
(0.7). The test results of manually tuned parameters of GA From test results, we conclude that the MILP method uses
can be shown in Table III. These tuned values are varied much time in finding the optimal solution and it may not be
depending on the characteristic of the problems such as able to find the solution in some instances. The use of GA by
problem size and difficulty level. For the effect of population default setting, the convergence in finding the near optimal
size versus the execution time, we found that if the solution is faster than MILP method. However, the solutions
population size is increased then the execution time is also may be incorrect or violate the problem constraints, due to
increased. However, the %Gap is reduced when we use inappropriate setting. For tuned setting of GA, it might have
higher population size. Because of the difficulty in searching the difficulty in setting the GA options but the results show
the global optima, the problem size ( N row u Ncolumn ) must be superior to the other methods in some instances.
taken into account. By overall, MILP has less %Gap than From these results, we notice the problem that occurred
GA and the GA run faster to near optimal value than MILP. and our future works will focus on developing program for
If we have increased in problem size then the %Gap and solving the general purpose mix-integer problems. We may
execution time are increased. Especially, the population size play attention to create the auto-tuned algorithms to find the

287
suitable parameters of the GA that can be useful in time [7] P. Khazaei, M. Dabbaghjamanesh, A. Kalantarzadeh, and H. Mousavi,
reduction and increase effectiveness and efficiency. “Applying the modified TLBO algorithm to solve the unit
commitment problem,” in 2016 World Automation Congress (WAC),
2016, pp. 1–6.
ACKNOWLEDGEMENT
[8] B. Haddar, M. Khemakhem, S. Hanafi, C. Wilbaut, and H.
The researcher would like to express my very great Chabchoub, “A new hybrid heuristic for the 0-1 knapsack sharing
appreciation to the department of Industrial Engineering, problem,” in Proceedings of 2013 International Conference on
Faculty of Engineering, King Mongkut’s Institute of Industrial Engineering and Systems Management (IESM), 2013, pp.
1–7.
Technology Ladkrabang (KMITL). Finally, the author
[9] M. A. K. Azad, A. M. A. C. Rocha, and E. M. G. P. Fernandes,
wishes to thank my family for their support and “Improved binary artificial fish swarm algorithm for the 0–1
encouragement throughout my life. multidimensional knapsack problems,” Swarm Evol. Comput., vol. 14,
pp. 66–75, Feb. 2014.
REFERENCES [10] R. S. Pavithr and Gursaran, “Quantum Inspired Social Evolution
[1] A. H. Niknamfar and S. T. A. Niaki, “A binary-continuous invasive (QSE) algorithm for 0-1 knapsack problem,” Swarm Evol. Comput.,
weed optimization algorithm for a vendor selection problem,” vol. 29, pp. 33–46, Aug. 2016.
Knowl.-Based Syst., vol. 140, pp. 158–172, Jan. 2018. [11] İ. Babaoğlu, “Utilization of Bat Algorithm for Solving Uncapacitated
[2] L. A. C. G. Andrade and C. B. Cunha, “An ABC heuristic for Facility Location Problem,” in Intelligent and Evolutionary Systems,
optimizing moveable ambulance station location and vehicle Springer, Cham, 2016, pp. 199–208.
repositioning for the city of São Paulo,” Int. Trans. Oper. Res., vol. [12] A. Arulselvan, O. Maurer, M. Skutella, “An incremental algorithm
22, no. 3, pp. 473–501, May 2015. for theuncapacitated facility location problem”, Networks 65 (4),
[3] L. Yang, B. F. Jones, and S.-H. Yang, “A fuzzy multi-objective 2015, pp. 306–311,.
programming for optimization of fire station locations through [13] Y. Watanabe, M. Takaya, and A. Yamamura, “Fitness Function in
genetic algorithms,” Eur. J. Oper. Res., vol. 181, no. 2, pp. 903–915, ABC Algorithm for Uncapacitated Facility Location Problem,” in
Sep. 2007. Information and Communication Technology, Springer, Cham, 2015,
[4] J. Atkinson and D. Campos, “Improving BCI-based emotion pp. 129–138.
recognition by combining EEG feature selection and kernel [14] “Global Optimization Toolbox Documentation.” [Online]. Available:
classifiers,” Expert Syst. Appl., vol. 47, pp. 35–41, Apr. 2016. https://www.mathworks.com/help/gads/. [Accessed: 23-Feb-2018].
[5] S. Gunasundari, S. Janakiraman, and S. Meenambal, “Velocity [15] Xin-She Yang, Engineering Optimization An Introduction with
Bounded Boolean Particle Swarm Optimization for improved feature Metaheuristic Applications, Wiley , 2011.
selection in liver and kidney disease diagnosis,” Expert Syst. Appl.,
[16] MIPLIB 2010, benchmark problem set, avialable online at
vol. 56, pp. 28–47, Sep. 2016.
http://miplib.zib.de/miplib 2010-benchmark.php.
[6] V. K. Kamboj, “A novel hybrid PSO–GWO approach for unit
[17] Matworks, Documentation in Genetic Algorithm Options
commitment problem,” Neural Comput. Appl., vol. 27, no. 6, pp.
https://www.mathworks.com/help/gads/genetic-algorithm-
1643–1655, Aug. 2016.
options.html

288

You might also like