Varying Fitness Functions in Genetic Algorithms : Studying the Rate of ...

0 downloads 0 Views 123KB Size Report
Varying Fitness Functions in Genetic Algorithms : Studying the Rate of Increase of the Dynamic Penalty. Terms. S. Kazarlis and V. Petridis. Department of ...
Varying Fitness Functions in Genetic Algorithms : Studying the Rate of Increase of the Dynamic Penalty Terms S. Kazarlis and V. Petridis Department of Electrical and Computer Engineering, Faculty of Engineering, Aristotle University of Thessaloniki, 54006, Greece Abstract. In this paper we present a promising technique that enhances the efficiency of GAs, when they are applied to constrained optimisation problems. According to this technique, the problem constraints are included in the fitness function as penalty terms, that vary during the GA evolution, facilitating thus the location of the global optimum and the avoidance of local optima. Moreover we proceed to test the effect that the rate of change in the fitness function has on GA performance. The tests are performed on two well-known real-world optimisation problems : the Cutting Stock problem and the Unit Commitment problem. Comparative results are reported.

0. Introduction In real-world optimisation problems together with the optimisation of the problem’s objective function there is usually a number of constraints that must also be satisfied. GAs unfortunately do not incorporate a default mechanism for handling such constraints. This deficiency is alleviated by a number of methods proposed in the literature [5], [6], [7], [9], [11], [12], [13]. The most important of these methods is the Penalty Assignment method [5], according to which penalty terms are added to the fitness function that depend on the constraint violation of the specific solution. In this way the invalid solutions are considered as valid but they are penalised according to the degree of violation of the constraints. For a minimisation problem the resulting fitness function is of the form: Q(S) = O(S) + P(S) (1) where O(S) is the objective function to be minimised and P(S) is the penalty function that depends on the degree of constraint violation introduced by solution S. This method is probably the most commonly used method for handling problem constraints with GAs and is implemented in many variations. However, it exhibits the problem of building a suitable penalty function for the specific problem, based on the violation of the problem’s constraints, that will lead the GA to avoid infeasible solutions and converge to a feasible (and hopefully the optimal) one. This problem arises from the fact that high penalty values generally increase the complexity of the fitness function and the resulting search hypersurface, while low penalty values in-

crease the possibility for the GA to converge to an infeasible solution. In order to enhance the efficiency of the GAs in such real-world constrained optimisation problems we have introduced a new technique : the Varying Fitness Function Technique (VFF) [7], [11], [12]. According to this technique the penalty terms are not static functions of the amount of constraint violation but are dynamic functions of the constraint violation as well as the “evolution time”, expressed by the generation index. Relating the penalties with time it is possible to construct a penalty function that relaxes the constraints at the beginning of the evolution process, simplifying thus the fitness landscape, and increases them later to separate the areas of valid and invalid solutions. This dynamic landscape facilitates the GA search in avoiding the local traps and locating the global optimum. For a minimisation problem a general Varying Fitness Function could be of the form: Qv(S,g) = O(S) + Pv(S,g) (2) where O(S) is the objective function to be minimised and Pv(S,g) is the varying penalty function that depends on the degree of constraint violation introduced by solution S and the generation index g. The properties of the dynamic penalty function seem to be critical to the success of the VFF technique. In order to extract useful conclusions for the effectiveness of the VFF technique and its dependencies upon the shape of the increasing penalty function, we have tested its performance using seven different penalty functions on two different real-world problems. The problems chosen are : (a) the Cutting Stock problem, that consists in cutting a number of predefined two-dimensional shapes out of a piece of stock material with minimum waste [2], [4], [11], [12], [15] and (b) the Unit Commitment problem, that consists in the determination of the optimum operating schedule of a number of electric power production units, in order to meet the forecasted demand over a short term period, with the minimum total operating cost [7], [8], [12], [16]. An introduction to the VFF technique is provided in Section 1. Section 2 describes the chosen penalty functions for the comparison tests. Sections 3 and 4 describe the two optimisation problems and the corresponding simulation tests performed, respectively. Finally conclusions are presented in Section 5.

1. The Varying Fitness Function technique The VFF technique consists in adjusting the penalty factors dynamically during the search procedure. At the beginning of the GA search the penalty factors are kept low in order to simplify the search and give the GA the opportunity to explore the search space more efficiently. As the evolution proceeds the penalty factors increase according to an increasing penalty function, so that at the end of the run they reach appropriately large values, which result in the separation of valid solutions from invalid ones. This technique facilitates the GA to locate the general area of the global optimum at the early stages of the search. As the search proceeds, the penalty factors increase and the GA adapts to the changing search hypersurface. Near the end of the run, when the penalty factors reach their appropriately large values, the

final search hypersurface is formed, preventing thus the GA from converging to invalid solutions. In a constrained minimisation problem the normal (static) fitness function, built according to the Penalty Assignment Method, could be of the form: NC . Q(S) = O(S) + P(S) = O(S) + A ( /i . wi . -i( di(S) ) ) + B ) . /S (3)



i=1 where : A is a “severity” factor, NC is the number of the problem constraints, /i is a binary factor (/i =1 if constraint i is violated and /i =0 otherwise), wi is a “weight” factor for constraint i, di(S) is a measure of the degree of violation of constraint i introduced by S, -i(.) is a function of this measure, B is a penalty threshold factor and /S is a binary factor (/S =1 if S is infeasible and /S =0 otherwise). In a Varying Fitness Function scheme the static penalty factor must be replaced with a function depending on the evolution time (i.e. the generation index). So, the corresponding Varying Fitness Function Qv(S,g) could be of the following form : NC . . Qv(S,g) = O(S) + Pv(S,g) = O(S) + V(g) (A ( /i . wi . -i( di(S) ) ) + B) . /S)



i=1 where V(g) is an increasing function of g in the range (0..1).

(4)

2. Penalty Functions The shape of the function V(g) determines the rate of change in the penalty term of the fitness function. Linear functions have been used in the past [7], [11], [12] of the form : V(g) = g/G (5) where G is the total number of generations the GA is allowed to run. In this paper seven shapes for the function V(g) have been tested while all the other quality function parameters have been kept constant. The chosen functions are designed for an arbitrary run limit of G generations : 1) Exponential function 1: V(g)=1-e-10⋅g/G 2) Exponential function 2: V(g)=1-e-5⋅g/G 3) Linear function : V(g)=g/G 4) Square function : V(g)=(g/G)2

5) Cubic function: V(g)=(g/G)3 6) Quartic function: V(g)=(g/G)4 7) 5-step function: V(g) = int(5⋅g/G)/5 (where int is truncating the decimal part)

3. Simulation tests on the Cutting Stock problem The problem addressed in this section belongs to the category of Cutting and Packing problems [2], [4], [11], [12], [15]. The common objective of such problems is the determination of an optimal arrangement of a set of predefined objects (pieces) so that they fit within a container or stock material with minimum waste. Problems of this category can be found in many industries such as the clothing and the furniture

industry. The specific problem addressed in this section is a two-dimensional Cutting Stock problem [11], [12]. It consists in finding the best position for a set of pieces or shapes within a large piece of material with standard width W and infinite length so as to minimise the material waste. Rotation of the shapes, in any angle, is not allowed. As “material waste” we define the area of material not covered by the shapes, within the bounds of the smallest rectangle that contains the shapes (bounding rectangle). Overlapping of shapes is of course prohibited, and eventually this is the constraint of this problem.

Figure 1. The optimum arrangement of the 13 shapes of the two-dimensional Cutting Stock problem. In the simulation tests we used a 13-shapes problem containing convex and nonconvex shapes. The 13 shapes were chosen so as to leave no material waste in the optimum solution (Figure 1). In order to represent a solution as a binary string we first considered a x and a y coordinate for each shape, with the origin taken at the bottom left corner of the material. So a single solution is described by 13 pairs of shape coordinates (xi, yi) i=1..13 which represent a specific cutting pattern. A solution can be considered as a point in a 2x13 = 26 - dimensional space. A 10-bit integer is used to encode a single coordinate, resulting in a genotype string of 2x10x13 = 260 bits in length, producing a search space of 2260 or 1.853x1078 different solutions. For the construction of the quality function, instead of measuring directly the area of material waste, we chose to build a different objective function that embodies gradients towards the optimum : 13



( (xi ⋅ Ai) + yi ) (6) i=1 where Ai is the area of shape i. This function creates a gradient towards positions with small x and y values, with more emphasis to the x coordinate. The constraint of no shape overlapping is incorporated into the quality function by a penalty term added to it. Thus, the following quality function is formed: 13 12 13 O(S) =



 

(7) , d(S) = OL(i,j) (8) ( (xi⋅Ai)+yi ) + V(g)⋅⋅(A⋅⋅d(S) ) i=1 i=1 j=i+1 where A is taken equal to 1000 (B of eq. 4 is taken equal to 0), d(S) is the total shape overlapping area and OL(i,j) is the overlapping area concerning shapes i and j. The GA used on this problem included the following characteristics : 13-point

Q(S) =

Crossover [14], Bit Mutation, adaptive crossover-mutation probabilities (Crossover 0.4-0.9, mutation 0.004-0.024) [1], [3], [7], [11], [12] in order to control pre-mature convergence and excessive diversity, Roulette Wheel Parent Selection [5], Generational Replacement (replacement of the whole population at every generation) [5], elitism [5], population of 50 genotypes, final run limit of 500 generations, application of problem specific recombination operators [11], [12] to the whole population and application of hill climbing operators [10], [11], [12] to the best genotype of every generation. For every one of the 7 penalty functions 20 GA runs have been performed, with different random seed at every run. In this problem, due to the design of the 13 shapes, the optimum was known and was equal to 12666. So we have set a success limit of quality 13000, that practically means that a run was considered successful only if it converged to the global optimum. The test results can be seen in Table I, Figure 2 and Figure 3. The bar chart with the Average Best Quality in Figure 3 shows the mean value of the final solution of the 20 runs, for each of the penalty functions. The horizontal line shows the global optimum value (12666). Table I : Success percentage and average quality over 20 runs of the seven rates of increase on the Cutting Stock problem. Function Expon. 1 Expon. 2 Success 10% 5% Avg.Qual. 13805 14257

Linear 15% 18251

Square 30% 17184

Cubic 10% 28252

Quartic 0% 32013

5-step 0% 29863

The test results clearly show that the GA performance is greatly affected by the penalty function chosen. The functions Exponential 1 and 2 that tend to apply a large proportion of the penalty at the beginning, generally converge to good solutions but they cannot make it to the top, because they get trapped to local minima. On the other hand the extremely sub-linear functions Cubic and Quartic do not allow the GA to distinguish valid and invalid areas early, so they have poor success rates and poor average best quality. 6XFFHVV3HUFHQWDJH  



  

 









  ([SR

([SR

/LQHDU

6TXDUH

&XELF

4XDUWLF

VWHS

Figure 2. Success percentage over 20 runs of the seven rates of increase on the Cutting Stock problem

$YHUDJH%HVW4XDOLW\         ([SR

([SR

/LQHDU

6TXDUH

&XELF

4XDUWLF

VWHS

Figure 3. Average best quality over 20 runs of the seven rates of increase on the Cutting Stock problem The best performance though is shown by the Square function, while the Step function performs poorly also.

4. Simulation tests on the Unit Commitment Problem The Unit Commitment problem [7], [8], [12], [16] comes from the Power Systems Engineering and consists in the determination of the start-up and shut down schedules of thermal units, to meet forecasted demand over a future short term (24-168 hour) period. The objective is to minimise the total production cost of the operating units while satisfying a large set of operating constraints. The problem of Unit Commitment involves both combinatorial and continuous variable optimisation and can be also characterised as a scheduling problem. Table II : Parameters of the 5 units of the Unit Commitment problem. Pmax (MW) Pmin (MW) a ($/h) b ($/MWh) c ($/MW2h) min up (h) min dn (h) hot start cost ($) cold start cost ($) cold start hrs (h) initial status (h)

Unit 1 455 150 1000 16.19 0.00048 8 8 4500 9000 5 8

Unit 2 130 20 700 16.60 0.002 5 5 550 1100 4 -5

Unit3 130 20 680 16.50 0.00211 5 5 560 1120 4 -5

Unit 4 80 20 370 22.26 0.00712 3 3 170 340 2 -3

Unit 5 55 55 660 25.92 0.00413 1 1 30 60 0 -1

The a, b and c figures are the coefficients of the fuel cost function which is of the form : fc=a+b⋅⋅P+c⋅⋅P2 where P is the power output of the unit. The min-up and min-

dn hour figures are the continuously up time limit and the continuously down time limit respectively. The “hot start cost” is considered when the unit has been down for less than the “cold start hours” figure, otherwise the “cold start cost” is used. The initial status shows the number of hours the unit is already up (positive number) or down (negative number). Table III : The demand for the 24 hours of the scheduling period of the Unit Commitment problem Hour 1 2 3 4 5 6 7 8 9 10 11 12 Demand (MW) 400 450 480 500 530 550 580 600 620 650 680 700 Hour 13 14 15 16 17 18 19 20 21 22 23 24 Demand (MW) 650 620 600 550 500 550 600 650 600 550 500 450 The problem used for our tests consisted of 5 units and 24 hours scheduling horizon. The units' parameters are shown in Table II and the demand values are shown in Table III. For this problem, a 5x24 = 120 bit sting is used to encode a single solution resulting in a search space of 2120 = 1.329x1036 different solutions. The constraints which must be satisfied during the optimisation process are: (a) System power balance (power output = demand+losses+exports), (b) System reserve requirements, (c) Unit initial conditions, (d) Unit high and low MegaWatt (MW) limits (economic/operating), (e) Unit minimum up-time and (f) Unit minimum down-time. The fitness function is built as follows : with a given operating schedule, for every hour t, a dispatch algorithm [1] calculates the optimum power output values, Pit, for every operating unit i in order to meet the given forecasted demand (Dt) at that hour. The operating units are the ones that have, according to the schedule, their genotype bit, corresponding to hour t, equal to “1”. The high and low limits of the units are also taken into account. The quality function is then calculated as follows: a)The total fuel cost FC(S) of the operating units is calculated by: 5 24 FC(S) =

 

uit ⋅ fci(Pit)

(9)

i=1 t=1 where uit is the state (0,1) of unit i at time t and fci(⋅) is the unit’s fuel cost function. E The units' start-up cost SC(S) and shut-down cost DC(S) are calculated by: 5 24 5 24

 u

⋅ (1-uit-1) ⋅ SUi(xit) i=1 t=1 (10)

 

uit-1 ⋅ (1-uit) ⋅ SDi i=1 t=1 (11) t . where xi is the number of hours the unit i has been down at time t, SUi( ) is the startup cost function of unit i and SDi is the shut-down cost of unit i, and they are both calculated from the units' parameters of Table II. The final Varying Fitness Function is built by summing all the cost and penalty factors : NC SC(S)=

t i

DC(S)=

Qv(S,g) = FC(S) + SC(S) + DC(S) + V(g) ⋅ (A ⋅



( /i ⋅ -i( di(S) ) ) ) i=1

(12)

where A is taken equal to 1000 and B (of eq. 4) equal to 0. The GA used on this problem, included the following characteristics : 5-point Crossover, Bit Mutation, adaptive crossover-mutation probabilities (Crossover 0.40.9, mutation 0.004-0.024) in order to control pre-mature convergence and excessive diversity, Roulette Wheel Parent Selection, Generational Replacement (replacement of the whole population at every generation), elitism, population of 50 genotypes, final run limit of 500 generations, application of problem specific recombination operators to the whole population [7], [12] and application of hill climbing operators to the best genotype of every generation [7], [12]. Table IV : Success percentage and average quality over 20 runs of the seven rates of increase on the Unit Commitment problem Function Expon. 1 Expon. 2 Linear Success 35% 25% 55% Avg.Qual. 272180 272549 272051

Square 95% 271597

Cubic 95% 271549

Quartic 90% 271553

5-step 95% 271597

For every one of the 7 penalty functions 20 GA runs have been performed, with different random seed at every run. In this problem, a Dynamic Programming algorithm was also used and gave the optimum quality of 271535 ($). So we have set as a success limit the quality 271540, that practically means that a GA run was considered successful only if it converged to the global optimum. The test results can be seen in Table IV, Figure 4 and Figure 5. The bar chart with the Average Best Quality in Figure 5 shows the mean value of the final solution of the 20 runs, for each of the penalty functions. The horizontal line shows the global optimum value (271535). The test results clearly show that, in this problem also, the GA performance is greatly affected by the penalty function chosen. The functions Exponential 1 and 2 perform poorly in this case as well, while the sub-linear functions do better than the Linear function. The best performance though is exhibited by the Square and the Cubic functions, while the 5-step function performs satisfactorily in this problem.

6XFFHVV3HUFHQWDJH   



 





 



  

 

  ([SR

([SR

/LQHDU

6TXDUH

&XELF

4XDUWLF

VWHS

Figure 4. Success percentage over 20 runs of the seven rates of increase on the Unit Commitment problem

$YHUDJH%HVW4XDOLW\         ([SR

([SR

/LQHDU

6TXDUH

&XELF

4XDUWLF

VWHS

Figure 5. Average best quality over 20 runs of the seven rates of increase on the Unit Commitment problem

5. Conclusions Comparing the test results of the seven increase rates of the varying penalty function on the two problems some general observations can be made : • In the application of the VFF technique, the increase rate of the penalty terms, during the GA run, directly affects the overall GA performance and must be selected carefully to suit the specific GA application. • The gradual application of the penalties for constraint violations, is critical for the success of the GA. The penalty functions Exponential 1 and Exponential 2 that quickly reach the maximum value of the penalty function, perform very poorly in the comparison tests. • The optimum increase rate of the penalty term seems to be that of the Square function over the two problems considered, and not the Linear function which could be seen as an obvious choice. • The extreme sub-linear increase rates (Cubic and Quartic functions) perform very well in the case of the Unit Commitment problem though they exhibit a poor performance in the case of the Cutting Stock problem. • The 5-step function exhibits very good characteristics on the Unit Commitment problem but not on the Cutting Stock problem a fact that is partly due to the problem specific operators used in the Cutting Stock problem. Further research is required in using the VFF technique on other constrained optimisation problems. Also other types of penalty functions could be used and tested (e.g. bimodal functions etc.).

References [1] A. Bakirtzis, V. Petridis and S. Kazarlis, “A Genetic Algorithm Solution to the Economic Dispatch Problem”, IEE Proceedings - Generation Transmission Distribution, Vol. 141, No. 4, July 1994, p.p. 377-382.

[2] A. R. Brown, “Optimum packing and Depletion”, American Elsevier Inc., 1971, New York. [3] L. Davis, “Adapting operator probabilities in genetic algorithms”, Proceedings of the Third International Conference on Genetic Algorithms and Their Applications, San Mateo, California, Morgan Kaufman, 1989. [4] H. Dyckhoff, “A Typology of Cutting and Packing Problems”, European Journal of Operational Research 44, 1990, pp. 145-159. [5] D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning, Reading, Mass.: Addison Wesley, 1989. [6] J. A. Joines and C. R. Houck, “On the Use of Non-Stationary Penalty Functions to Solve Nonlinear Constrained Optimisation Problems with GA’s,” in Proceedings of the First IEEE Conference on Evolutionary Computation, IEEE Service Center, 1994, pp. 579-584. [7] S. A. Kazarlis, A. G. Bakirtzis and V. Petridis, “A Genetic Algorithm Solution to the Unit Commitment Problem,” IEEE Transactions on Power Systems, Vol. 11, No. 1, February 1996, pp. 83-92. [8] D. Dasgupta and D. R. McGregor, “Thermal Unit Commitment using Genetic Algorithms,” IEE Proceedings - Part C: Generation, Transmission and Distribution, Vol. 141, No. 5, September 1994, pp. 459-465. [9] Z. Michalewicz and G. Nazhiyath, “Genocop III: A Co-evolutionary Algorithm for Numerical Optimisation Problems with Nonlinear Constraints,” in Proceedings of the 2nd IEEE International Conference on Evolutionary Computation, Vol. 2, Perth-Australia, 29 Nov. - 1 Dec. 1995, pp. 647-651. [10] J. A. Miller. W. D. Potter, R. V. Gandham and C. N. Lapena, “An Evaluation of Local Improvement Operators for Genetic Algorithms”, in IEEE Transactions on Systems, Man, and Cybernetics, Vol. 23, No. 5, Sep./Oct. 1993. [11] V. Petridis and S. Kazarlis “Varying Quality Function in Genetic Algorithms and the Cutting Problem”, in Proceedings of the First IEEE Conference on Evolutionary Computation (ICEC ’94 as part of WCCI’94), IEEE Service Center, 1994, Vol. 1, pp. 166-169. [12] V. Petridis, S. Kazarlis and A. Bakirtzis, “Varying Fitness Functions in Genetic Algorithm Constrained Optimisation: The Cutting Stock and Unit Commitment Problems,” accepted for publication at the IEEE Transactions on Systems, Man, and Cybernetics, Vol 28 Part B No 5 issue of October 1998. [13] A. E. Smith and D. M. Tate, “Genetic Optimisation Using A Penalty Function,” in Proceedings of the Fifth International Conference on Genetic Algorithms, S. Forrest, Ed. Los Altos, CA: Morgan Kaufmann, 1993, pp. 499-505. [14] W.M. Spears and K.A. De Jong, “An Analysis of Multi-Point Crossover” in Foundations of Genetic Algorithms, San Mateo California, Morgan Kaufman, 1991, pp. 301-315. [15] Paul. E. Sweeney, Elizabeth Ridenour Paternoster, “Cutting and Packing Problems: A categorized Application - Oriented Research Bibliography”, Journal of the Operational Research Society, Vol. 43, No. 7, p.p. 691-706. [16] A.J. Wood and B.F. Wollenberg, Power Generation Operation and Control, 1984, John Wiley, New York.