Fuzzy Scheduling Contents 1. Introduction to Fuzzy Sets 2. Application of Fuzzy Sets to Scheduling Problems 3. A Genetic Algorithm for Fuzzy Flowshop Scheduling Problem 1 Literature 1. Fuzzy sets, uncertainty, and information, G. J. Klir and T.A. Folger. Englewood Cliffs, N.J : Prentice Hall, 1988. 2. "Flowshop Scheduling with Fuzzy Duedate and Fuzzy Processing Time", by H. Ishibuchi and T. Nurata, in: Scheduling Under Fuzziness, R. Slowinski, and M. Hapke, (eds), Physica-Verlag, A Springer-Verlag Company, 2000, pages 113-143 3. "Genetic algorithms and neighborhood search algorithms for fuzzy flowshop scheduling problems", Ishibuchi, H., Yamamoto, N., Murata, T., Tanaka., H, Fuzzy Sets and Systems Vol. 67, No.1, 1994, pages 81-100. 2 Introduction to Fuzzy Sets crisp versus • dichotomous yes-or-no-type fuzzy • more-or-less type • conventional logic: statement is true • "classical" set theory: an element belongs to a set or not • optimisation: a solution is feasible or not • Basic foundations of fuzzy sets: Lotfi Zadeh, Fuzzy Sets, Information and Control, Vol. 8, 1965 3 xA • Classical set: or xA Example. A - set of even natural numbers less than 10 A = {2, 4, 6, 8} A(x) degree of membership of x in A A(1) = 0 A(2) = 1 1 if x A A ( x) 0 if x A or ... • Fuzzy sets A~ : A~ ( x) takes on values in the range [0, ], is usually 1 ~ A { ( x, A~ ( x) ) | x X } 4 Examples. ~ A = "real number close to 10" A~ ( x) 1.0 0 5 ~ A 10 15 x = ”integers close to 10” = { (7, 0.1), (8, 0.5), (9, 0.8), (10, 1), (11, 0.8), (12, 0.5), (13, 0.1) 5 Fuzzy sets and probability measure two bottles of liquid first bottle has membership 0.91 in the fuzzy set of all drinkable liquids second bottle probability that it contains drinkable liquids is 0.91 Which bottle would you choose? 6 Application of Fuzzy Sets to Scheduling Problems 1. Approximate reasoning Approximate Reasoning is the process by which a possible imprecise conclusion is deduced from a collection of imprecise premises. Fuzzy IF-THEN Production Rules 2. Fuzzy constraints How to calculate satisfaction of the flexible constraints? 3. Fuzzy parameters Most often imprecise or incomplete are: • fuzzy due dates • fuzzy processing times 7 Approximate Reasoning Example of a rule-based system for dispatching Release job j next Time characteristics Slack time Machine utilisation External priority Waiting time 8 Waiting time: {long, medium, short} Slack time: {critically short, short, sufficient} Time characteristics: {urgent, not urgent} IF Waiting time is long AND Slack time is critically short THEN Time characteristics is urgent j(T) 1.0 critically short short sufficient IF Waiting time is medium AND Slack time is critically short THEN Time characteristics is urgent IF Waiting time is short AND Slack time is critically short THEN Time characteristics is urgent 0 3 4.5 6 T 8 IF Waiting time is medium AND Slack time is short THEN Time characteristics is not urgent ... 9 Fuzzy Rules + Observed System State Waiting time is A - crisp Slack time is B - crisp Fuzzy Advice Time criterion is C - fuzzy DEFUZZIFICATION 10 Fuzzy Constraints C(x) satisfaction grade of the solution x crisp constraint 1 if x satisfies constraint C C ( x) 0 if x violates constraint C fuzzy constraint if x complitely satisfies constraint C 1 C ( x) (0,1) if x partially satisfies constraint C 0 if x violates constraint C 11 Fuzzy Due Date dj Cj duedate of job j completion time of job j 1 if C j d j satisfaction grade j (C j ) 0 if C d j j j(Cj) 1.0 0 dj Cj 12 j(Cj) 1.0 0 djL d jU Cj ejU djL djU Cj j(Cj) 1.0 0 eL j 13 A Genetic Algorithm for Fuzzy Flowshop Scheduling Problems Problem Statement flow shop scheduling n jobs which have fuzzy duedates m machines sequence of n jobs is represented by a vector x=(x1, x2, ... ,xn) pi,j - processing time of job j on machine i Ci,j - completion time of job j on machine i C1,x1 = p1,x1 Ci,x1 = Ci-1,x1 + pi,x1 for machines i=2,3,...,m C1,xk = C1,xk-1 + p1,xk for jobs k=2,3,...,n Ci,xk= max {Ci-1,xk , Ci,xk-1 } + pi,xk for machines i=2,3,...,m for jobs k=2,3,...,n and 14 Objective 1: Maximisation of minimum satisfaction grade Maximise fmin = min{ j(Cj) : j=1,2,...,n} Objective 2: Maximisation of total satisfaction grade n Maximise f sum j (C j ) j 1 15 total number of possible solutions: n! optimal solution can be found only for small-size problems for large-size problems search techniques could be used Genetic algorithm Notation N number of individuals in each population xpi i-th individual in the p-th population p = {xpi : i=1,2, ... , N} individuals in the p-th population Characteristics of the algorithm • selection based on the roulette wheel • two-point order crossover • shift mutation • elite strategy 16 Step 1. Initialisation Randomly generate N individuals to construct an initial population 1 Step 2. Selection Select N-1 individuals from the current population using the roulette wheel selection method with linear scaling objective function of the individual minimum objective function of the whole population Selection probability P( x p ) i g ( x p ) g min ( p ) i j { g ( x p ) g min ( p ) } x p j p g(x) objective function fmin or fsum gmin(p ) = min { g(xpj ) : xpj p} 17 Step 3. Crossover • Two-point order crossover is applied to each of the selected pairs with a pre-specified crossover probability. • When the crossover operator is not applied one parent becomes an offspring. Parent 1 J1 J2 J3 J4 J5 J6 J7 J8 J9 J10 Offspring J1 J2 J5 J3 J6 J7 J4 J8 J9 J10 Parent 2 J5 J3 J6 J9 J10 J1 J7 J2 J4 J8 18 Step 4. Mutation • Applied to each of the individuals generated by the crossover with a pre-specified mutation probability. J1 J2 J5 J3 J6 J7 J4 J8 J9 J10 J1 J2 J8 J5 J3 J6 J7 J4 J9 J10 19 Step 5. Elitist strategy • Add the best individual from the previous population to the new N-1 individuals generated by the crossover and mutation. Step 6. Termination test • If a pre-specified stopping condition is satisfied stop. 20 The value of the Objective function 1 (maximisation of the minimum satisfaction grade) is 0 if the satisfaction grade of at least one job is 0. j(Cj) (C j e j L ) if C j e j L L U j (C j ) j (C j ) if e j C j d j (d U C ) if d U C j j j j 1.0 0 eL j is a positive constant ejU djL d jU Cj Objective 1’: Maximisation of minimum satisfaction grade Maximise f’min = min{j(Cj) : j=1,2,...,n} 21 Summary Fuzzy sets and logic can be successfully used to treat various types of uncertainty that exist in scheduling problems. Fuzzy duedate and fuzzy processing time are typical examples of such uncertainty. Many conventional scheduling problems could be reformulated as fuzzy scheduling problems. 22 23 Experiments • • • • Population size N = 50 Crossover probability = 0.9 Mutation probability = 0.3 Stopping condition = 2000 generations • Number of machines m = 10 • 100 problems with n = 10 jobs 100 problems with n = 20 jobs 100 problems with n = 50 jobs • Processing time pi,j is a random integer from the interval [1,99] 24 • Each job has a fuzzy duedate How to generate djL and djU ? j(Cj) 1.0 0 djL djU Cj 1. Randomly generate a sequence x=(x1, x2, ... ,xn), n=10, 20, 50 for each test problem 2. Calculate the completion time of each job Cj(x) 3. Calculate for each job j djL = Cj(x) - djU = Cj(x) + is a random integer from the interval [100, 200] 25 j(Cj) 1.0 0 djL djU Cj L 1 if C j d j j (C j ) 1-(C j d j L ) /( d j U d j L ) if d j L C j d j U U 0 if d j C j 1 j (C j ) 1-(C j C j ( x ) ) / 2 0 if C j C j ( x ) if C j ( x ) C j C j ( x ) if C j ( x ) C j j(Cj)=0.5 if the jobs are processed in the order x x is the optimal solution for Objective 1 (maximisation of the minimum satisfaction grade) 26 Problem size Minimum satisfaction grade Average satisfaction grade 10-job 0.500 0.500 20-job 0.000 0.485 50-job 0.000 0.499 Problem size Total satisfaction grade Average satisfaction grade 10-job 20-job 50-job 8.376 17.797 46.693 0.838 0.890 0.934 The value of the Objective function 1 (maximisation of the minimum satisfaction grade) is 0 if the satisfaction grade of at least one job is 0. 27 j(Cj) 1.0 0 eL j ejU djL djU Cj (C j e j L ) if C j e j L L U j (C j ) j (C j ) if e j C j d j (d U C ) if d U C j j j j is a positive constant Objective 1’: Maximisation of minimum satisfaction grade Maximise f’min = min{j(Cj) : j=1,2,...,n} 28 Problem size Minimum satisfaction grade Average satisfaction grade 10-job 0.499 0.501 20-job 50-job 0.399 -69.030 0.621 -10.409 Heuristic method for initial solution: Process the given jobs in an increasing order of their duedates. With fuzzy duedates we can use values of djU to order the jobs Initialisation: one heuristic schedule and N-1 randomly generated Problem size Minimum satisfaction grade Average satisfaction grade 10-job 0.500 0.500 20-job 0.472 0.557 50-job 0.367 0.629 Genetic algorithm can effectively utilise heuristic initial solution 29