ai paper - ga, nn, fuzzy logic

43
Page | 0 NATIONAL UNIVERSITY OF MALAYSIA FACULTY OF INFORMATION SCIENCE & TECHNOLOGY ADVANCED ARTIFICIAL INTELLIGENCE (TS6544) INSTRUCTOR: DR. AZURALIZA BT ABU BAKAR / DR. ZALINDA OTHMAN ASSIGNMENT # 2 GROUP MEMBERS: 1) DOLI ANGGIA HARAHAP MATRIC NO.: P50152 2) RAZALE BIN IBRAHIM MATRIC NO.: P50106 3) NORSYIDAH BINTI MAT SAAT @ ABAS MATRIC NO.: P50086

Upload: doliharahap

Post on 08-Apr-2015

398 views

Category:

Documents


6 download

DESCRIPTION

Genetic Algorithms, Neural Networks and Fuzzy Logic

TRANSCRIPT

Page 1: AI Paper - GA, NN, Fuzzy Logic

Page | 0

NATIONAL UNIVERSITY OF MALAYSIA FACULTY OF INFORMATION SCIENCE & TECHNOLOGY

ADVANCED ARTIFICIAL INTELLIGENCE (TS6544)

INSTRUCTOR: DR. AZURALIZA BT ABU BAKAR / DR. ZALINDA OTHMAN

ASSIGNMENT # 2 GROUP MEMBERS:

1) DOLI ANGGIA HARAHAP MATRIC NO.: P50152

2) RAZALE BIN IBRAHIM MATRIC NO.: P50106

3) NORSYIDAH BINTI MAT SAAT @ ABAS MATRIC NO.: P50086

Page 2: AI Paper - GA, NN, Fuzzy Logic

Page | 1

TABLE OF CONTENTS

SECTION CONTENT PAGE

Section 1 Finding Minimum Pipeline Network of Offshore Natural Gas Well Using Genetic Algorithm

- 3

Section 2 Solving A Permutation Flow-Shop Scheduling Problem With Genetic Algorithm

- 14

Section 3 Developing New Product Pricing Model Using Fuzzy Inference System

- 26

Section 4

Neural Network: Using Backpropagation Algorithm For Character Recognition

- 33

Page 3: AI Paper - GA, NN, Fuzzy Logic

Page | 2

SECTION 1 : Genetic Algorithm

Figure 1 shows the mileages of the feasible links connecting nine offshore natural gas well heads with an inshore delivery point. Since well head 1 is closest to the shore, it is equipped with sufficient pumping and storage capacity to pump the output of the remaining eight wells to the delivery point. Using GA, determine the minimum pipeline network that links the well heads to the delivery point.

Page 4: AI Paper - GA, NN, Fuzzy Logic

Page | 3

FINDING MINIMUM PIPELINE NETWORK OF OFFSHORE NATURAL GAS WELL USING GENETIC ALGORITHM

Doli Anggia Harahap, Razale Ibrahim, Norsyidah Mat Saat @ Abas

Department of Management Information System Faculty of Information Science and Technology

National University of Malaysia, 43600 UKM Bangi Selangor, MALAYSIA.

[email protected]; [email protected]; [email protected]

1. Introduction

1.1. Genetic Algorithm

Genetic algorithms are an optimization technique based on natural evolution. They include the survival of the fittest idea into a search algorithm which provides a method of searching which does not need to explore every possible solution in the feasible region to obtain a good result. Genetic algorithms are based on the natural process of evolution. In nature, the fittest individuals are most likely to survive and mate; therefore the next generation should be fitter and healthier because they were bred from healthy parents. This same idea is applied to a problem by first ’guessing’ solutions and then combining the fittest solutions to create a new generation of solutions which should be better than the previous generation. We also include a random mutation element to account for the occasional ’mishap’ in nature.

The genetic algorithm process consists of the 5 steps as follows: (1) Encoding, (2) Evaluation, (3) Crossover, (4) Mutation, and (5) Decoding.

A suitable encoding is found for the solution to our problem so that each possible solution has a unique encoding and the encoding is some form of a string. The initial population is then selected, usually at random though alternative techniques using heuristics have also been proposed. The fitness of each individual in the population is then computed; that is, how well the individual fits the problem and whether it is near the optimum compared to the other individuals in the population. This fitness is used to find the individual’s probability of crossover. If an individual has a high probability (which indicates that it is significantly closer to the optimum than the rest of its generation) then it is more likely to be chosen to crossover. Crossover is where the two individuals are recombined to create new individuals which are copied into the new generation. Next mutation occurs. Some individuals are chosen randomly to be mutated and then a mutation point is randomly chosen. The character in the corresponding position of the string is changed. Once this is done, a new generation has been formed and the process is repeated until some stopping criteria has been reached. At this point the individual which is closest to the optimum is decoded and the process is complete.

Abstract. The problem is about to determine the minimum pipeline network to connect a nine natural gas well. The well head no 1 is closest to the shore and it is equipped with sufficient pumping and storage capacity to pump the output of the remaining eight well to the delivery point. The pipeline network must start at well 1 as delivery point and not all well are connected with each other. This problem is similar to Travelling Salesman Problem (TSP). The idea of the TSP is to find a tour of a given number of cities, visiting each city exactly once and returning to the starting city where the length of this tour is minimized. Homaifar states that “one approach which would certainly find the optimal solution of any TSP is the application of exhaustive enumeration and evaluation”. The procedure consists of generating all possible tours and evaluating their corresponding tour length. The tour with the smallest length is selected as the best, which is guaranteed to be optimal. Keywords: Artificial Intelligence, Genetic Algorithm, Pipeline Network, Travelling

Salesman Problem

Page 5: AI Paper - GA, NN, Fuzzy Logic

Page | 4

1.2. Basic Explanation

Genetic algorithms range from being very straightforward to being quite difficult to understand. Before proceeding, a basic explanation is required to understand how genetic algorithms work. We will use the following problem throughout this section. We want to maximize the function f = −2x2 + 4x − 5 over the integers in the set {0, 1, . . . , 15}. By calculus or brute force we see that f is maximized when x =1.

1.3. Encoding

The encoding process is often the most difficult aspect of solving a problem using genetic

algorithms. When applying them to a specific problem it is often hard to find an appropriate representation of the solution that will be easy to use in the crossover process. Remember that we need to encode many possible solutions to create a population. The traditional way to represent a solution is with a string of zeros and ones. However genetic algorithms are not restricted to this encoding, as we will see in section 2.4. For now we will use a binary string representation. Consider the problem defined above. Our possible solutions are obviously just numbers, so our representation is simply the binary form of each number. For instance, the binary representations of 12 and 7 are 1100 and 0111 respectively. Note that we added a zero to the beginning of the string 0111 even though it has no real meaning. We did this so that all the numbers in the set {0, . . . , 15} have the same length. These strings are called chromosomes and each element (or bit) of the string is called a gene. We now randomly generate many chromosomes and together they are called the population. 1.4. Evaluation

The evaluation function plays an important role in genetic algorithms. We use the evaluation

function to decide how ’good’ a chromosome is. The evaluation function usually comes straight from the problem. In our case the evaluation function would simply be the function f = −2x2 + 4x − 5, and because we are trying to maximize the function, the larger the value for f, the better. So, in our case, we would evaluate the function with the two values 7 and 12.

f(7) = −71

f(12) = −241

Obviously 7 is a better solution than 12, and would therefore have a higher fitness. This fitness is then used to decide the probability that a particular chromosome would be chosen to contribute to the next generation. We would normalize the scores that we found and then create a cumulative probability distribution. This is then used in the crossover process.

The stopping criteria are used in the evaluation process to determine whether or not the current generation and the best solution found so far are close to the global optimum. Various stopping criteria can be used, and usually more than one is employed to account for different possibilities during the running of the program: the optimal solution is found, the optimal solution is not found, a local optimum is found, etc. The standard stopping criteria that is used stops the procedure after a given number of iterations. This is so that if we do not find a local optimum or a global optimum and do not converge to any one point, the procedure will still stop at some given time. Another stopping criteria is to stop after the “best” solution has not changed over a specified number of iterations. This will usually happen when we have found an optimum - either local or global - or a point near the optimum. Another stopping criteria is when the average fitness of the generation is the same or close to the fitness of the ’best’ solution. 1.5. Crossover

Crossover can be a fairly straightforward procedure. In our example, which uses the simplest case

of crossover, we randomly choose two chromosomes to crossover, randomly pick a crossover point, and then switch all genes after that point. For example, using our chromosomes

v1 = 0111

Page 6: AI Paper - GA, NN, Fuzzy Logic

Page | 5

v2 = 1100

We could randomly choose the crossover point after the second gene. v1 = 01 | 11

v2 = 11 | 00

Switching the genes after the crossover point would give

V’1 = 0100 = 4

V’2 = 1111 = 15

We now have two new chromosomes which would be moved into the next population, called the next generation.

Not every chromosome is used in crossover. The evaluation function gives each chromosome a ’score’ which is used to decide that chromosome’s probability of crossover. The chromosomes are chosen to crossover randomly and the chromosomes with the highest scores are more likely to be chosen. We use the cumulative distribution created in the evaluation stage to choose the chromosomes. We generate a random number between zero and one and then choose which chromosome this corresponds to in our distribution. We do this again to get a pair, then the crossover is performed and both new chromosomes are moved into the new generation. This will hopefully mean that the next generation will be better than the last - because only the best chromosomes from the previous generation were used to create this generation. Crossover continues until the new generation is full.

It is possible to check each new chromosome to make sure it does not already exist in the new generation. This means that we will get a variety of possible solutions in each generation, but also that once we have found the optimal solution in one chromosome, the other chromosomes will probably not be optimal. That means that the average fitness of the generation can never be as good as the fitness of the optimal chromosome, which could make deciding when to stop difficult. It is also possible to move the best solution from the previous generation directly into the new generation. This means that the best solution can never get any worse since even if on average the generation is worse, it will still include the best solution so far. We can also have two point crossover. In this case we randomly choose two crossover points and switch the genes between the two points. In our problem we could pick the points after the first gene and after the third gene.

V1 = 0 | 11 | 1

V2 = 1 | 10 | 0

to get

V’1 = 0101 = 5

V’2 = 1110 = 14

There are many different crossover routines, some of which will be explored later. We often need to change the crossover routine to make sure that we do not finish with an illegal chromosome - that is, an infeasible solution. In this way, crossover is very problem specific. 1.6. Mutation

Mutation is used so that we do not get trapped in a local optimum. Due to the randomness of the

process we will occasionally have chromosomes near a local optimum but none near the global optimum. Therefore the chromosomes near the local optimum will be chosen to crossover because they will have the better fitness and there will be very little chance of finding the global optimum. So mutation is a completely random way of getting to possible solutions that would otherwise not be found. Mutation is performed after crossover by randomly choosing a chromosome in the new

Page 7: AI Paper - GA, NN, Fuzzy Logic

Page | 6

generation to mutate. We then randomly choose a point to mutate and switch that point. For instance, in our example we had

V1 = 0111

If we chose the mutation point to be gene three, v1 would become

V’1 = 0111

We simply changed the 1 in position three to a 0. If there had been a 0 in position three then we would have changed it to a 1. This is extremely easy in our example but we do not always use a string of zeros and ones as our chromosome. Like crossover, mutation is designed specifically for the problem that it is being used on. Inversion is a different form of mutation [1]. It is sometimes used in appropriate cases and we will investigate some of these later. Here we will explain the inversion operator on our basic example.

The inversion operator consists of randomly choosing two inversion points in the string and then inverting the bits between the two points. For example

V2 = 1100

We could choose the two points after gene one and after gene three.

V2 = 1 | 10 | 0

Now, since there are only two genes between our inversion points, we then switch these two genes to give

V’2 = 1010

If we had a larger chromosome, say

V3 = 110100101001111

We could choose the inversion points after the third point and after the eleventh point.

V3 =110 | 10010100 | 1111

Now, we start at the ends of the ’cut’ region and switch the genes at either end moving in. So we get

V’3 = 110001010011111

Essentially we are just reversing (or inverting) the order of the genes in between the two chosen points.

2. Methodology, concept, problem solving strategy This problem is similar to Travelling Salesman Problem (TSP). The idea of the TSP is to find a

tour of a given number of cities, visiting each city exactly once and returning to the starting city where the length of this tour is minimized. 2.1 Travelling Salesman Problem

The idea of the travelling salesman problem (TSP) is to find a tour of a given number of cities,

visiting each city exactly once and returning to the starting city where the length of this tour is minimized. The first instance of the travelling salesman problem was from Euler in 1759 whose problem was to move a knight to every position on a chess board exactly once.

Page 8: AI Paper - GA, NN, Fuzzy Logic

Page | 7

The travelling salesman first gained fame in a book written by German salesman BF Voigt in 1832 on how to be a successful travelling salesman. He mentions the TSP, although not by that name, by suggesting that to cover as many locations as possible without visiting any location twice is the most important aspect of the scheduling of a tour. The origins of the TSP in mathematics are not really known - all we know for certain is that it happened around 1931.

The standard or symmetric travelling salesman problem can be stated mathematically as follows:

Given a weighted graph G = (V,E) where the weight cij on the edge between nodes i and j is a non-negative value, find the tour of all nodes that has the minimum total cost.

Currently the only known method guaranteed to optimally solve the travelling salesman problem of

any size, is by enumerating each possible tour and searching for the tour with smallest cost. Each possible tour is a permutation of 123 . . . n, where n is the number of cities, so therefore the number of tours is n!. When n gets large, it becomes impossible to find the cost of every tour in polynomial time. Many different methods of optimization have been used to try to solve the TSP.

3. Strategy and Solution of the problem

In a TSP context, each chromosome encodes a solution to the problem (i.e. a tour). The fitness of the chromosome is related to the tour length, which in turn depends on the ordering of the cities. Since the TSP is a minimization problem, the tour lengths must be transformed, so that high fitness values are associated with short tours, and conversely. A well-known approach is to subtract each tour length to the maximum tour length found in the current population. Other approaches are based on the rank of the tours in the population.

The genetic algorithm searches the space of solutions by combining the best features of two good tours into a single one. Since the fitness is related to the length of the edges included in the tour, it is clear that the edges represent the basic information to be transferred to the offspring.

A genetic algorithm applies the following major steps according to Davis, 1991 and Mitchell, 1996.

Step 1: Represent the problem variable domain as a chromosome of a fixed length, choose the size of a chromosome population N, the crossover probability pc and mutation probability pm.

Step 2 : Define a fitness function to measure the performance, or fitness, of an individual chromosome in the problem domain. The fitness function establishes the basis for selecting chromosomes that will be mated during the reproduction.

Step 3 : Randomly generate an initial population of chromosomes of size N: x1, x2, … , xn

Step 4 : Calculate the fitness of each individual chromosome: f�x1�, f�x2�, … , f�xN�

Step 5 : Select a pair of chromosomes for matting from the current population. Parent chromosomes are selected with a probability related to their fitness. Highly fit chromosomes have a higher probability of being selected for mating than less fit chromosomes.

Step 6 : Create a pair of offspring chromosomes by applying the genetic operators - crossover and mutation.

Step 7 : Place the created offspring chromosomes in the new population. Step 8 : Repeat Step 5 until the size of the new chromosome population becomes equal

to the size of the initial population, N. Step 9 : Replace the initial (parent) chromosome population with the new (offspring)

population. Step 10 : Go to Step 4, and repeat the process until the termination criterion is satisfied.

Page 9: AI Paper - GA, NN, Fuzzy Logic

Page | 8

3.1 Solution Of The Problem

As we know, the problem is about pipeline network to connect a nine natural gas well. The well head no 1 is closest to the shore and it is equipped with sufficient pumping and storage capacity to pump the output of the remaining eight well to the delivery point. The distance and connectivity between wells show as Table 1.

Table 1 : Distance and connection between well.

WELL 1 2 3 4 5 6 7 8 9

1 5 X X 20 X X 14 X

2 5 6 X 7 X X X X

3 X 6 15 10 X X X X

4 X X 15 20 7 12 X X

5 20 7 10 20 3 5 13 6

6 X X X 7 3 X X X

7 X X X 12 5 X 7 X

8 14 X X X 13 X 7 5

9 X X X X 6 X X 5

A constrains of the problem is pipeline network must start at well no 1 as delivery point and pumping all well. As shown in Table 1, not all well are connected each other. The summary about connection between well as shown in Table 2.

Table 2 : Connection between well

Well Well can connect

1 2, 5, 8

2 1, 3, 5

3 2, 4, 5

4 3, 5, 6, 7

5 1, 2, 3, 4, 5,6, 7, 8, 9

6 4, 5

7 5, 8

8 1, 5, 7, 9

9 5, 8

This is similar to Travelling Salesman Problem to find a tour of a given number of cities, visiting

each city exactly once where the length of tour is minimized.

We will solve the above problem using genetic algorithms by taking the example of solution Traveling Salesman Problem. There are 8 total wells to be connected to well head 1. Criteria to quit determined first that is after several generations consecutively achieved value fitness lowest as that condition because that value are representing minimum pipeline network links. There are 8 wells that will be the genes in the chromosomes apart from well head 1.

3.1.1 Initialize Chromosome

Suppose we use 6 populations in one generation as follows:

Chromosome [1] = 2 3 5 6 4 7 8 9 Chromosome [2] = 2 3 4 6 5 7 8 9 Chromosome [3] = 2 3 4 7 8 9 5 6 Chromosome [4] = 5 9 8 7 5 6 4 3 2 (penalty)

Page 10: AI Paper - GA, NN, Fuzzy Logic

Page | 9

Chromosome [5] = 8 9 5 7 4 6 5 3 2 (penalty) Chromosome [6] = 2 5 6 4 3 5 9 8 7 (penalty)

A penalty is added because pipeline not connected and needs to go through well 5 two times. 3.1.2 Chromosome evaluation

Then we need to calculate the fitness value for each chromosome has been described previously.

Fitness [1] = 12+23+35+56+64+47+78+89 = 5+6+7+3+7+12+7+5 = 52 Fitness [2] = 12+23+34+46+65+57+78+89

=5+6+15+7+3+5+7+5 = 53 Fitness [3] = 12+23+34+47+78+89+95+56 = 5+6+15+12+7+5+6+3=59 Fitness [4] = 15+59+98+87+75+56+64+43+32 = 20+6+5+7+5+3+7+15+6 = 74 Fitness [5] = 18+89+95+57+74+46+65+53+32 = 14+5+6+5+12+7+3+7+6 = 65 Fitness [6] = 12+25+56+64+43+35+59+98+87 = 5+7+3+7+15+10+6+5+7 = 65

3.1.3 Fitness Selection

A chromosome with fitness smaller will have the highest possibility to choose against. Therefore, inverse process is used as follows:

Q[i] = 1 / Fitness[i] Q[1] = 1 / 52 = 0.0192 Q[2] = 1 / 53 = 0.0187 Q[3] = 1 / 59 = 0.0169 Q[4] = 1 / 74 = 0.0135 Q[5] = 1 / 65 = 0.0154 Q[6] = 1 / 65 = 0.0154 Total = 0.0192+0.0187+0.0169+0.0135+0.0154+0.0154 = 0.0991

To find probability, we use the following formula:

P[i] = Q[i] / Total P[1] = 0.0192/0.0991= 0.1937 P[2] = 0.0187/0.0991= 0.1887 P[3] = 0.0169/0.0991= 0.1705 P[4] = 0.0135/0.0991= 0.1362 P[5] = 0.0154/0.0991= 0.1534 P[6] = 0.0154/0.0991= 0.1554

Probability of the above found that chromosome 1 has the highest fitness. Therefore, chromosome 1

has a high probability that selected for the next generation than other chromosomes.

Page 11: AI Paper - GA, NN, Fuzzy Logic

Page | 10

For the selection process, we use the roulette-wheel. Therefore, we need to find the value of the cumulative probabilities.

C[1] = 0.1937 C[2] = 0.1937+0.1887=0.3824 C[3] = 0.3824+0.1705=0.5529 C[4] = 0.5529+0.1362=0.6891 C[5] = 0.6891+0.1534=0.8425 C[6] = 0.8425+0.1554=0.9979 ≈ 1

Roulete-wheel process is to find a random value R between 0-1. If R (k) <C (k) then k

chromosomes as parent with the condition C[k-1] <R[k] <C[k]. We have an initial population of six chromosomes. Thus, to establish the same population in the next generation, the roulette wheel would be spun six times. Therefore, random R values are as follows:

R[1] = 0.3142 R[2] = 0.1111 R[3] = 0.3422 R[4] = 0.7431 R[5] = 0.5212 R[6] = 0.4111

Therefore, the population will be formed as follows:

Chromosome [1] = [2] = 2 3 4 6 5 7 8 9 Chromosome [2] = [1] = 2 3 5 6 4 7 8 9 Chromosome [3] = [3] = 2 3 4 7 8 9 5 6 Chromosome [4] = [5] = 8 9 5 7 4 6 5 3 2 Chromosome [5] = [4] = 5 9 8 7 5 6 4 3 2 Chromosome [6] = [6] = 2 5 6 4 3 5 9 8 7

3.1.4 Crossover

Crossover can be implemented using the scheme order crossover. In this scheme, the crossover operator randomly chooses a crossover point where two parent chromosomes break, and then exchanges the chromosome parts after point. Number of chromosomes involved parameters influenced by crossover probability (pc). For example, we choose pc = 25%, then expected in the 1 generation is 50% (3 chromosomes) of the population experienced crossover. For this purpose, we generate 6 random value R as follows:

R[1] = 0.1311 R[2] = 0.2112 R[3] = 0.2411 R[4] = 0.8772 R[5] = 0.7711 R[6] = 0.6422

Chromosome k is chosen as the parent if R [k] <pc. Therefore, the chromosome will become the

parent are chromosome [1], chromosome [2] and chromosome [3]. The process is further determined the position of crossover with random number between 1 and 3. Random numbers for 3 parents of chromosomes are as follows:

C[1] = 2 C[2] = 1 C[3] = 2

Page 12: AI Paper - GA, NN, Fuzzy Logic

Page | 11

Crossover process :

Chromosome [1] = Chromosome [1]>< Chromosome [2] = [2 3 4 6 5 7 8 9]><[ 2 3 5 6 4 7 8 9] = [2 3 5 6 4 7 8 9] Chromosome [2] = Chromosome [2]>< Chromosome [3] = [2 3 5 6 4 7 8 9]><[2 3 4 7 8 9 5 6] = [2 3 4 7 8 9 5 6] Chromosome [3] = Chromosome [3]>< Chromosome [1] = [2 3 4 7 8 9 5 6]><[2 3 4 6 5 7 8 9] = [2 3 4 6 5 7 8 9]

New population after crossover:

Chromosome [1] = 2 3 5 6 4 7 8 9 Chromosome [2] = 2 3 4 7 8 9 5 6 Chromosome [3] = 2 3 4 6 5 7 8 9 Chromosome [4] = 8 9 5 7 4 6 5 3 2 Chromosome [5] = 5 9 8 7 5 6 4 3 2 Chromosome [6] = 2 5 6 4 3 5 9 8 7

3.1.5 Mutation

The mutation is the random deformation of one or more genes that occurs infrequently during the evolutionary process. The purpose of the mutation is to provide a mechanism to increase coverage of the search space and help prevent premature convergence into a local optimum. There are a lot of manners for doing sequence swapping operation. Easiest way is in using random swap. Unfortunately, such strategy unable to achieve an optimum quickly but can prevent convergence into a local optimum.

We use a new mutation operator, greedy-swap of two well positions. The basic idea of greedy-swap is to randomly select two adjacent well from one chromosome and swap them if the new (swapped) tour length is shorter than the elder.

Number of chromosomes that have mutations in a population is determined by the parameters of mutation rate (pm). Firstly we counted the number of the gene in a population as follows:

Total gene = 24 + 27 = 51

To select the position of the gene mutations have done by creating a random number between 1 and 51. For example, set pm = 20%. Therefore, the numbers of gene mutations that will be experienced are = 0.2*51 = 10.2 ≈ 10

10 positions have mutated genes that will, after randomly selected positions are involved 3, 5, 13, 14, 19, 21, 32, 33, 49, 51.

Mutation process:

Chromosome [1] = 2 3 4 6 5 7 8 9 Chromosome [2] = 2 3 4 7 (5) 9 8 5 6 (penalty) Chromosome [3] = 2 3 5 6 4 7 8 9 Chromosome [4] = 8 9 5 7 4 6 (5) 2 3 (penalty) Chromosome [5] = 5 9 8 7 (5) 6 4 3 2 (penalty) Chromosome [6] = 2 5 6 4 3 (5) 7 8 9 (penalty)

Page 13: AI Paper - GA, NN, Fuzzy Logic

Page | 12

Genetic algorithms process for the first generation has been completed. Therefore, the fitness values for the first generation are as follows:

Fitness [1] = 12+23+34+46+65+57+78+89 = 5+6+15+7+3+5+7 +5= 53 Fitness [2] = 12+23+34+47+75+59+98+85+56 = 5+6+15+12+5+6+5+13+3=70 Fitness [3] = 12+23+35+56+64+47+78+89 = 5+6+7+3+7+12+7+5 = 52 Fitness [4] = 18+89+95+57+74+46+65+52+23

= 14+5+6+5+12+7+3+7+6 = 65 Fitness [5] = 15+59+98+87+75+56+64+43+32 = 20+6+5+7+5+3+7+15+6 = 74 Fitness [6] = 12+25+56+64+43+35+57+78+89 = 5+7+3+7+15+10+5+7+5 = 65

4. Analysis and discussion of the findings Before this has been determined that when the criteria to stop after several successive generations

obtained the lowest fitness value does not change. In the first generation has obtained the smallest fitness value does not change. Therefore, when the process continues until the N generation convinced that the lowest fitness value will not change.

The key to success getting the optimal fitness value in this problem is the determination or selection of penalty value because not all well are connected with each other. 5. Conclusion & references

5.1 Conclusion

Genetic algorithms can solve the question of searching the minimum pipeline network that links the

well heads to the delivery point by using the method of solving Travelling Salesman Problem. Although the solution produced by this algorithm may not be the optimal solution, but genetic algorithm will produce a better optimal solution in each generation. The advantage of genetic algorithms in comparison with conventional methods of searching is solutions generated at each generation even up to N generations.

5.2 References [1] J. H. Holland et. Al., “Induction: Processes of Inference, Learning, and Discovery”, MIT

Press, 1989. [2] Kylie Bryant, Arthur Benjamin, “Genetic Algorithms and the Travelling Salesman Problem”,

2000 [3] Abdollah Homaifar, Shanguchuan Guan, and Gunar E. Liepins. Schema Analysis Of The

Traveling Salesman Problem Using Genetic Algorithms. Complex Systems, 6(2):183–217, 1992.

[4] Jean-Yves Potvin, Genetic Algorithm for the Travelling Salesman Problem [5] Zbigniew Michalewicz. Genetic Algorithms + Data Structures = Evolution

Programs.Springer-Verlag, 2nd edition, 1994. [6] Mohamad Irvan Faradian, Perbandingan Penggunaan Algoritma Genetika dengan

Algoritma Konvensional pada Travelling Salesman Problem.

Page 14: AI Paper - GA, NN, Fuzzy Logic

Page | 13

SECTION 2 : Genetic Algorithm

Five jobs are scheduled first on machine A, then on machine B and finally on machine C. The time required for the completion of the jobs in the three machines is given in the following table.

Jobs Processing time (hour)

Machine A Machine B Machine C

1 8 3 8

2 3 4 7

3 7 5 6

4 2 2 9

5 5 1 10

Using GA, find the sequence of jobs that minimizes the time required to complete all the jobs.

Page 15: AI Paper - GA, NN, Fuzzy Logic

Page | 14

SOLVING A PERMUTATION FLOW-SHOP SCHEDULING PROBLEM WITH GENETIC ALGORITHM

Doli Anggia Harahap, Razale Ibrahim, Norsyidah Mat Saat @ Abas

Department of Management Information System Faculty of Information Science and Technology

National University of Malaysia, 43600 UKM Bangi Selangor, MALAYSIA.

[email protected]; [email protected]; [email protected]

1. Introduction

1.1 Scheduling Problems

Scheduling problem is concerned with the allocation of scarce resources to activities with the objective of optimizing one or more performance measures. There are many different performance measures to optimize, one of which is the minimization of the makespan or the completion time. One of the most popular methods of dealing with scheduling problems is to model them as a “job shop”. The job shop model involves a set of n jobs which must be processed through m machines. Technological constraints demand that each job should be processed through the machines in a particular order. There are basically two types of job shop models, the “general job shop” model and the “flow shop” model.

1.2 General Job Shop Model vs. Flow-shop Model

For the general job shop model there are no restrictions in the form of technological constraints.

Each job has its own processing order and this may bear no relation to the processing order of any other job. The flow shop model is a special case of the general job shop. This case arises when all jobs share the same technological order. For example if job 1 must be processed on machine a before machine b, then the same is true for all jobs. In many manufacturing and assembly facilities, a number of operations have to be done on every job. Often these operations have to be done on all jobs in the same order implying that the jobs follow the same route. These machines are assumed to be set up in series, and the environment is referred to as a flow-shop. Each job consists of a sequence of operations, which may have different processing times. Operations in a job must be processed in a specified order, and each machine can process only one operation at a time. The objective is to find the minimum time to complete all the jobs.

2. Problem Notations and Assumptions

In this problem, we are given a set of 3 machines (MA, MB and MC) and a set of 5 jobs (J1, J2, J3, J4 and J5). Each job has a technological sequence of machines to be processed. The 5 jobs are scheduled first on Machine A, then on Machine B and finally on Machine C.

Abstract. Flow shops are useful tools in modelling manufacturing processes. A permutation flow shop is a job processing facility which consists of several machines and several jobs to be processed on the machines. In a permutation flow shop all jobs follow the same machine or processing order. Flow shop refers to the fact that job processing is not interrupted once started. There are many approaches to solve this problem as attempted in previous research. In this paper, we used genetic algorithm (GA) to find the best possible solution, i.e.: to find the sequence of jobs that minimizes the time required to complete all the jobs. For crossover technique, we implement a hybrid of Two-Point Crossover and NEH Algorithm to best find the fittest chromosomes of the next generation. Keywords: Artificial Intelligence, Genetic Algorithm, Machine Scheduling Problem, Job

Shop Scheduling Problem.

Page 16: AI Paper - GA, NN, Fuzzy Logic

Page | 15

The time required for the completion of the jobs in the 3 machines differs as illustrated in Table 1 below.

Table 1 : The processing time for each operation

Jobs Processing Time (hour)

MA MB MC

J1 8 3 8 J2 3 4 7 J3 7 5 6 J4 2 2 9 J5 5 1 10

The objective when solving or optimizing this general problem is to determine the schedule or the

job sequence which minimizes the time required to complete all the jobs. The time required to complete all the jobs is called the makespan, L. The makespan has been defined as consisting of the total waiting time plus the total processing time (the latter being the sum of all the operation times for the job), assuming that handling and transportation time is negligible. The makespan for a particular schedule comprises of the total time elapsed from the beginning of the first job to the beginning of the last job plus the total processing time for the last job. The makespan is therefore a characteristic of the entire schedule. The processing of a job on a certain machine is referred to as an operation, O. The operation processing times are fixed and known in advance. Every job passes every machine exactly once in a prescribed order, resulting in a total of 5 x 3 operations. In the flow shop model there are n! possible unique permutations of the n jobs for a given machine. With m machines there are a total of (n!)m possible solutions to the problem. So in this particular problem, there are (5!)3 possible solutions to the problem.

A number of assumptions were made concerning the nature of the problem:

i. Every job requires processing on every machine; ii. Every machine processes only one job at a time; iii. No job requires processing more than once on the same machine; iv. Each job must go through the machine sequence A, B and then C; v. Each job cannot start at the next machine until its process in the previous machine ends; vi. Each machine is continuously available for processing (i.e. breakdowns, maintenance etc.

are ignored); and vii. Processing times are independent of the order in which the operations are performed.

3. Methodology, concept, problem solving strategy

In this paper, we use the Genetic Algorithm method to find solution to the problem. The GA approach for solving the problem uses a ‘chromosome’ to represent a sequence of the n jobs. The search space is comprised of all current chromosomes in a population numbering, N. Every chromosome is evaluated by a ‘fitness’ function. The fitness function of a chromosome reflects the efficacy of the makespan that corresponds to the sequence of jobs it represents. The GA searches the solution space by selecting at random two ‘parent’ chromosomes from the population. A ‘mating’ of these chromosomes results in an ‘offspring’ that inherits genetic traits from both parents. The fitness value of the new chromosome is calculated, and it is added to the population. The population is maintained constant at N by the removal of one chromosome every time a new offspring is introduced in the population. The chromosome that is replaced may be selected at random, or on the basis of its fitness value. This use of the fitness value to determine which chromosomes remain in the population simulates a ‘survival of the fittest’ scenario, where chromosomes representing solutions with good makespans have a higher probability of remaining in the population and of being selected for further mating.

To evaluate the minimum processing time, we can construct a Gantt Chart to represent the given set of operations. Gantt chart is constructed with a horizontal axis and horizontal bars. Horizontal axis represents the total time span for each operation while the horizontal bars or blocks represent the operations. The length of each block is proportional to the processing time required to perform the

Page 17: AI Paper - GA, NN, Fuzzy Logic

Page | 16

operation. The operation blocks are arranged in rows in accordance with the machine it should be processed on and the sequence ordered constructed by the solution methods.

In constructing the genetic operators, the chromosomes has to be broken in a way that is legal and

bound to the constraints as discussed earlier. The reproduction of an offspring from two parent involves splitting the parent chromosomes at a randomly selected point (or points), and then joining sections from the different parents to create a new chromosome. This procedure is called a ‘crossover’, and there are several strategies for conducting crossovers. The difficulty in applying the crossover operators to chromosomes that are non-binary, as in the case of the representation used for

the flowshop, is that the recombination usually results in an illegitimate chromosome, where jobs will appear twice or non at all in the offspring. A number of crossover operators that are appropriate for the representation employed for the flowshop have been suggested, including the partially matched crossover (PMX), cycle crossover and order crossover. Murata et. al. (1996) experimented with ten different types of operators, and concluded that the two-point and one-point crossover operators

performed somewhat better in flowshop problems than the partially matched and cycle crossover operators.

In the one-point crossover, both parents are split at identical points on the chromosomes. The child inherits a section, in tact, from one of the parents. The rest of the chromosome, however, is completed by arranging the outstanding jobs in their order of appearance in the chromosome of the other parent. In the case of a two-point crossover, a parent chromosome is cut at two random points. The jobs on the extreme ends of the two cuts are inherited by the child, and in the exact locations and order in which they appear in the parent chromosome. The central section in the child is then filled with the outstanding jobs, and in the order of their appearance in the other parent. Figure 11 below show an example of a-two-point crossover operation.

Figure 11: An example of a-two-point crossover operation

So in this paper, we will adopt a hybrid approach combining the two-point crossover operator described in Figure 11 above, with the NEH algorithm.

The permutation flowshop has also been investigated by using ‘construction’ heuristics, where a schedule is built iteratively by assigning jobs to a partial schedule. Nawaz et. al. developed a constructive heuristic, the NEH algorithm, which is widely acknowledged as one of the best currently available, in terms of solution quality, for minimizing the makespan in a permutation flowshop (Reeves, 1995). The NEH algorithm computes the sum of the processing times for each job and then lists them in non-increasing order of this value. The job at the top of the list is removed and inserted into the partial schedule. The position where it is inserted is determined by considering all the possible positions it can occupy, without altering the relative positions of the jobs already in the partial schedule. The selected position is the one that minimizes the makespan in the partial schedule. This is repeated until the last of the unscheduled jobs is assigned.

This hybrid operator works as follows: a parent chromosome is selected and cut at two random spots. The strings on both ends of the cut are inherited by the child chromosome in a manner identical to that in the two-point crossover. Then, the NEH procedure is applied in order to assign the remaining jobs into the center section for the child chromosome. Using the example shown in Figure1, the hybrid operator proceeds in the following manner. First, the missing jobs (those not included in the two end sections) are arranged in a list according to their order of appearance in the second parent. This list for the example in Figure 11 is: jobs 5, 4, 3 and 6, in that order. The first job on the list is inserted in the center section so that the partial child chromosome now appears as [1-2-5-7]. The next job on the list, job number 4, is examined in the two possible locations it may take in the section, i.e. immediately before or immediately after job 5. For each of these two possible positions, the makespan of the partial schedule is computed. The position that results in the lower makespan is selected. Then, the

Page 18: AI Paper - GA, NN, Fuzzy Logic

Page | 17

third job (no. 3) is taken off the list, and the makespans are evaluated for the three possible positions that job 3 can assume within the center section of the chromosome. In this fashion, the NEH algorithm is used as the basis for assigning the central section in the child chromosome.

Many genetic algorithms also employ a mutation operator for inciting random alterations in randomly selected chromosomes. The benefit of mutation is to introduce an element of neighborhood search for improving existing solutions in the current population. However, in preliminary investigations, it was observed that mutation had no significant effect on the performance of the genetic algorithm considered in this study. This is probably due to, as Reeves has pointed out (Reeves, 1995), the fact that disruptions in the chromosome sections that accompany the two-point crossover procedure inherently introduce an element of mutation.

The hybrid operator is implemented within a genetic algorithm based largely on (Ackley, 1987).

This algorithm is outlined below. Step 1: Initialization. Fitness value is computed for all chromosomes in the initial population. Step 2: Select a random pair of chromosomes from the current population. Step 3: Perform the hybridized crossover using the pair of selected chromosomes as parents. Step 4: Compute the fitness value for the child chromosome and return it and its parents to the population. Step 5: Select from the population the chromosome with the lowest fitness value and eliminate it. Step 6: If the desired number of generations is achieved, then stop. The chromosome having the highest fitness value in the current population represents the solution to the flowshop problem. Otherwise, return to Step 2 to iterate through a new generation.

Page 19: AI Paper - GA, NN, Fuzzy Logic

4. Strategy and Solution of the problem

In finding the solution, we use the typical process of the GA development which is done in 5 following steps as below. 4.1 Step 1: Specify the Problem, define constraints and optimum criteria

The purpose of solving this problem is to find the sequence of jobs which minimizes the time required to complete all the jobs that must follow the technological sequence of the machines (Machine A, then B and finally C). The optimum criterion is to find

As the sequence of machine is fixed (Machine A, then B and finally C), we can only rotate the sequence of job. The problem can be described by a disjunctive graph as illustrated in Figure 1 below:

4.2 Step 2: Represent the problem domain as a chromosome

The string representation is depending on the problem in hand. Three commonly used type of

coding is the binary encoding, permutation encoding and value encoding. The problem is mainordering or a sequencing problem, which require us to list the problem, we represent each chromosome by a list of job order, respective operation and machine sequence, known as permutation encoding.

Figure 2: Representation of Chromosome string for job sequence 1: J1

J1 O1 MA O2 MB O3 MC J2

J4 O1 MA O2

In Figure 2, the chromosome consists of 5 jobs with 3 operations each. T

the Machine A, followed by Machine B and then on machine C. In Job1 (J1), the first operation (O1) is to be done at machine A, then followed by operation two (O2) at Machine B and then operation three (O3) at machine C. Similarly, for job number 2 (J2), the first operation is to be done at MA, the second operation at MB and third operation at MC. There are all together 15 operations to be done to complete all the tasks. For the first instance, we can see that the last job processemachine C.

Strategy and Solution of the problem

In finding the solution, we use the typical process of the GA development which is done in 5

Step 1: Specify the Problem, define constraints and optimum criteria

The purpose of solving this problem is to find the sequence of jobs which minimizes the time required to complete all the jobs that must follow the technological sequence of the machines (Machine A, then B and finally C). The optimum criterion is to find the minimum completion time.

As the sequence of machine is fixed (Machine A, then B and finally C), we can only rotate the sequence of job. The problem can be described by a disjunctive graph as illustrated in Figure 1 below:

Figure 1: A disjunctive graph

Step 2: Represent the problem domain as a chromosome

The string representation is depending on the problem in hand. Three commonly used type of coding is the binary encoding, permutation encoding and value encoding. The problem is mainordering or a sequencing problem, which require us to list the job in a particular order. Thus for this problem, we represent each chromosome by a list of job order, respective operation and machine

, known as permutation encoding.

: Representation of Chromosome string for job sequence 1: J1-J2

J2 O1 MA O2 MB O3 MC J3 O1

MB O3 MC J5 O1 MA O2 MB O3

, the chromosome consists of 5 jobs with 3 operations each. The order of the machine is the Machine A, followed by Machine B and then on machine C. In Job1 (J1), the first operation (O1) is to be done at machine A, then followed by operation two (O2) at Machine B and then operation three

, for job number 2 (J2), the first operation is to be done at MA, the second operation at MB and third operation at MC. There are all together 15 operations to be done to complete all the tasks. For the first instance, we can see that the last job processe

Page | 18

In finding the solution, we use the typical process of the GA development which is done in 5

The purpose of solving this problem is to find the sequence of jobs which minimizes the time required to complete all the jobs that must follow the technological sequence of the machines

the minimum completion time.

As the sequence of machine is fixed (Machine A, then B and finally C), we can only rotate the sequence of job. The problem can be described by a disjunctive graph as illustrated in Figure 1 below:

The string representation is depending on the problem in hand. Three commonly used type of coding is the binary encoding, permutation encoding and value encoding. The problem is mainly an

in a particular order. Thus for this problem, we represent each chromosome by a list of job order, respective operation and machine

J2-J3-J4-J5

O1 MA O2 MB O3 MC

O3 MC

he order of the machine is the Machine A, followed by Machine B and then on machine C. In Job1 (J1), the first operation (O1) is to be done at machine A, then followed by operation two (O2) at Machine B and then operation three

, for job number 2 (J2), the first operation is to be done at MA, the second operation at MB and third operation at MC. There are all together 15 operations to be done to complete all the tasks. For the first instance, we can see that the last job processed is Job 5 at

Page 20: AI Paper - GA, NN, Fuzzy Logic

4.3 Step 3: Define a fitness function to evaluate the chromosome’s performance

For the purpose of this paper, we focus on the static and deterministic environment. In other words, the number of jobs and its processing time armachines breakdown occurred. We used makespan of the operation as fitness value. Makespan is denoted as Cmax is the time when the last operation leaves the workplace.

Cmax = max(C1, C2......., Cwhere,

Cj = rj + k=1(W jk +pjm(k)

Cj is the completion time of job j, rsequence k and pjm(k) is the processing time needed by job j on machine m at sequence k.

From figure 2, we derive 5 otherinstances, we take out the Operation (O) as we have understood the representation as previously stated. In this paper, we generate the initial population randomly and choose 6 chromosomes. This technique will allow the search process in a wide space. However, this kind of technique will take a lot of time to get the optimal value. Below is an example of the chromosome strings and its fitness value.

Figure 3: Representation of Chromosome string

J1 MA MB MC J2 MA

The Gantt-Chart is represented as follows:

Figure 4: The Gantt

Thus, the makespan or fitness value for Chromosom

The same process is done on 5 other chromosomes to find its fitness value. The chromosomes and its makespan or fitness value are as below:

Figure 5: Representation of Chromosome string for job sequence

J4 MA MB MC J5 MA

Fitness Value = 44 hours

Figure 6: Representation of Chromosome string for job sequence

J2 MA MB MC J3 MA

Fitness Value = 48 hours

n

Step 3: Define a fitness function to evaluate the chromosome’s performance

this paper, we focus on the static and deterministic environment. In other words, the number of jobs and its processing time are known, fixed and we assume that there are no machines breakdown occurred. We used makespan of the operation as fitness value. Makespan is

is the time when the last operation leaves the workplace.

......., Cn)

jm(k))

is the completion time of job j, rj is the release time of job j, W jk is the waiting time of job j at is the processing time needed by job j on machine m at sequence k.

From figure 2, we derive 5 other chromosomes with difference operation sequence. In the next instances, we take out the Operation (O) as we have understood the representation as previously stated. In this paper, we generate the initial population randomly and choose 6 chromosomes. This echnique will allow the search process in a wide space. However, this kind of technique will take a lot

Below is an example of the chromosome strings and its fitness value.

Figure 3: Representation of Chromosome string for job sequence 1: J1-J2

MB MC J3 MA MB MC J4 MA MB

Chart is represented as follows:

Figure 4: The Gantt-Chart for job sequence 2: J1-J2-J3-J4-J5

fitness value for Chromosome 1 in Figure 3 is 51 hours.

The same process is done on 5 other chromosomes to find its fitness value. The chromosomes its makespan or fitness value are as below:

: Representation of Chromosome string for job sequence 2: J4-J5

MB MC J3 MA MB MC J2 MA MB

: Representation of Chromosome string for job sequence 3: J2-J3

MB MC J4 MA MB MC J5 MA MB

Page | 19

Step 3: Define a fitness function to evaluate the chromosome’s performance

this paper, we focus on the static and deterministic environment. In other words, e known, fixed and we assume that there are no

machines breakdown occurred. We used makespan of the operation as fitness value. Makespan is

is the waiting time of job j at is the processing time needed by job j on machine m at sequence k.

chromosomes with difference operation sequence. In the next instances, we take out the Operation (O) as we have understood the representation as previously stated. In this paper, we generate the initial population randomly and choose 6 chromosomes. This echnique will allow the search process in a wide space. However, this kind of technique will take a lot

J2-J3-J4-J5

MB MC J5 MA MB MC

J5

The same process is done on 5 other chromosomes to find its fitness value. The chromosomes

J5-J3-J2-J1

MB MC J1 MA MB MC

J3-J4-J5-J1

MB MC J1 MA MB MC

Page 21: AI Paper - GA, NN, Fuzzy Logic

Page | 20

Figure 7: Representation of Chromosome string for job sequence 4: J3-J2-J4-J1-J5

J3 MA MB MC J2 MA MB MC J4 MA MB MC J1 MA MB MC J5 MA MB MC

Fitness Value = 52 hours

Figure 8: Representation of Chromosome string for job sequence 5: J5-J4-J1-J3- J2

J5 MA MB MC J4 MA MB MC J1 MA MB MC J3 MA MB MC J2 MA MB MC

Fitness Value = 51 hours

Figure 9: Representation of Chromosome string for job sequence 6: J5-J1-J2-J4-J3

J5 MA MB MC J1 MA MB MC J2 MA MB MC J4 MA MB MC J3 MA MB MC

Fitness Value = 48 hours

In parent selection we choose two individuals to reproduce. There are many ways of choosing parents to evaluate. In order to avoid the premature convergence, we randomly choose two individuals from the population and called them parent1, P1 and parent2, P2. This means that all individuals in the population have the same chances to reproduce.

For the purpose of this paper, we choose the fittest chromosomes with the fittest value, i.e. the minimum fitness value. So among 6 chromosomes in the initial population, Chromosome in figure 5 for job sequence J4-J5-J3-J2-J1 and 2 other chromosomes in figure 6 and figure 9 for job sequence J2-J3-J4-J5-J1 and job sequence J5-J1-J2-J4-J3. To reproduce, we choose chromosome in figure 5 to be P1 and chromosome in figure 9 for P2.

Figure 10: Parent 1 (P1) and Parent 2 (P2) chosen to reproduce P1: J4 MA MB MC J5 MA MB MC J3 MA MB MC J2 MA MB MC J1 MA MB MC

Fitness Value = 44 hours P2: J5 MA MB MC J1 MA MB MC J2 MA MB MC J4 MA MB MC J3 MA MB MC

Fitness Value = 48 hours

Page 22: AI Paper - GA, NN, Fuzzy Logic

4.4 Step 4: Construct the genetic operators

The performance of the hybrid operator is tested by means of a genetic algorithm, designed with the following GA parameters:

i. Population Size: 6 ii. Mutation: None

We construct the genetic operators as discussed

Crossover Operation and NEH Algorithm as illustrated in Figure 12 below.

Figure 12: The result of constructing a and the NEH

The possible child for P1 and P2 is either C1 or C2. We then calculate the C2 and find the lowest among the two.

Figure 13: The Gantt

Because the makespan or fitness value for C1 is lower tha

return to the population with its parents, P1 and P2. So the chosen chromosome is: C1: J5 MA MB MC J1 MA

Fitness Value = 46 hours

Step 4: Construct the genetic operators

The performance of the hybrid operator is tested by means of a genetic algorithm, designed with

We construct the genetic operators as discussed in Section 3 of this paper using the TwoCrossover Operation and NEH Algorithm as illustrated in Figure 12 below.

The result of constructing a hybrid operator combining Two-Point Cand the NEH Procedure to P1 and P2

The possible child for P1 and P2 is either C1 or C2. We then calculate the fitness valueC2 and find the lowest among the two.

Figure 13: The Gantt-Chart showing makespan for C1

Because the makespan or fitness value for C1 is lower than C2, 46 < 48, then we choose C1 to return to the population with its parents, P1 and P2. So the chosen chromosome is:

MB MC J4 MA MB MC J2 MA MB

Page | 21

The performance of the hybrid operator is tested by means of a genetic algorithm, designed with

in Section 3 of this paper using the Two-Point

Crossover Operation

fitness value for C1 and

n C2, 46 < 48, then we choose C1 to return to the population with its parents, P1 and P2. So the chosen chromosome is:

MB MC J3 MA MB MC

Page 23: AI Paper - GA, NN, Fuzzy Logic

4.5 Step 5: Run the GA and tune its param

The most important step in GA is to choose the individual to be replaced by child. It is known that we always choose the best chromosomes or the fittest individual to reproduce in the next iterati

If the fitness value of the child is less than treplace the worst individual with child. If there is a member of the population having the same fitness value, replace the member with the child.

The fitness value for all the chromosomes in the populatF(1) = 51 F(2) = 44 F(3) = 48 F(4) = 52 F(5) = 51 F(6) = 48

We have performed crossover on Chromosome 2 and Chromosome 6 as in Section 4.4.

select from the population the chromosome with the lowest fitness value and replace it comparing all the fitness value of all the chromosomes in the new population after adding C1, we conclude that the lowest makespan is for Chromosome 4. So the fitness value for as follows:

F(1) = 51 F(2) = 44 F(3) = 48 F(4’) = 46 F(5) = 51 F(6) = 48

We can perform another crossover by combining the fittest chromosomes (with highest and second

highest fitness value) to find if they can still produce child with lower fitness value than the values in current population. In this case, we shall choose Chromosome 2Chromosome 4 to become P2. P1: J4 MA MB MC J5 MA

Fitness Value = 44 hours P2: J5 MA MB MC J1 MA

Fitness Value = 46 hours

We found that the possible child for P1 and P2 shall be as follows:

Figure 14: The result of constructing a hybrid operator combining two

the NEH procedure to next P1 and P2

Step 5: Run the GA and tune its parameters

The most important step in GA is to choose the individual to be replaced by child. It is known that we always choose the best chromosomes or the fittest individual to reproduce in the next iterati

If the fitness value of the child is less than the worst and not equal to any member of population, replace the worst individual with child. If there is a member of the population having the same fitness value, replace the member with the child.

The fitness value for all the chromosomes in the population are as follows:

We have performed crossover on Chromosome 2 and Chromosome 6 as in Section 4.4. select from the population the chromosome with the lowest fitness value and replace it comparing all the fitness value of all the chromosomes in the new population after adding C1, we conclude that the lowest makespan is for Chromosome 4. So the fitness value for

We can perform another crossover by combining the fittest chromosomes (with highest and second highest fitness value) to find if they can still produce child with lower fitness value than the values in

is case, we shall choose Chromosome 2 to become P1

MB MC J3 MA MB MC J2 MA MB

MB MC J4 MA MB MC J2 MA MB

We found that the possible child for P1 and P2 shall be as follows:

Figure 14: The result of constructing a hybrid operator combining two-point crossover operation and

the NEH procedure to next P1 and P2

Page | 22

The most important step in GA is to choose the individual to be replaced by child. It is known that we always choose the best chromosomes or the fittest individual to reproduce in the next iteration.

he worst and not equal to any member of population, replace the worst individual with child. If there is a member of the population having the same fitness

We have performed crossover on Chromosome 2 and Chromosome 6 as in Section 4.4. We then select from the population the chromosome with the lowest fitness value and replace it with C1. After comparing all the fitness value of all the chromosomes in the new population after adding C1, we conclude that the lowest makespan is for Chromosome 4. So the fitness value for new population is

We can perform another crossover by combining the fittest chromosomes (with highest and second highest fitness value) to find if they can still produce child with lower fitness value than the values in

to become P1 and the new

MB MC J1 MA MB MC

MB MC J3 MA MB MC

point crossover operation and

Page 24: AI Paper - GA, NN, Fuzzy Logic

We then calculate the makesparesult is as in figure 15 below.

Figure 15: The Gantt

The makespan for C1 is the same as C2. So

to the population. But I chose C1 because the delay between the jobs is only 5 hours compared to the delay in C1 which is 11 hours. previous machine to end before it can move to the next machine

5. Analysis and discussion of the findings. The chromosomes that represent the job sequence in the N=6 chromosomes population are as

follows:

Chromosome 1: J4 MA MB MC J5 MA

Chromosome 2: J4 MA MB MC J5 MA

Chromosome 3: J2 MA MB MC J3 MA

Chromosome 4: J5 MA MB MC J1 MA

Chromosome 5: J5 MA MB MC J4 MA

Chromosome 6: J5 MA MB MC J1 MA

We then calculate the makespan of C1 and C2 again to decide on which child to be chosen. The

Figure 15: The Gantt-Chart showing makespan for C1

the same as C2. So we can choose whichever child that we want But I chose C1 because the delay between the jobs is only 5 hours compared to the

delay in C1 which is 11 hours. The delay is the time when the job has to wait for the same job at before it can move to the next machine.

Analysis and discussion of the findings.

The chromosomes that represent the job sequence in the N=6 chromosomes population are as

MB MC J2 MA MB MC J3 MA MB

MB MC J2 MA MB MC J2 MA MB

MB MC J4 MA MB MC J5 MA MB

MB MC J4 MA MB MC J2 MA MB

MB MC J1 MA MB MC J3 MA MB

MB MC J2 MA MB MC J4 MA MB

Page | 23

n of C1 and C2 again to decide on which child to be chosen. The

we can choose whichever child that we want to return But I chose C1 because the delay between the jobs is only 5 hours compared to the

The delay is the time when the job has to wait for the same job at

The chromosomes that represent the job sequence in the N=6 chromosomes population are as

MB MC J1 MA MB MC

MB MC J1 MA MB MC

MB MC J1 MA MB MC

MB MC J3 MA MB MC

MB MC J2 MA MB MC

MB MC J3 MA MB MC

Page 25: AI Paper - GA, NN, Fuzzy Logic

Page | 24

The fitness value for new population is as follows:

F(1’) = 44 F(2) = 44 F(3) = 48 F(4’) = 46 F(5) = 51 F(6) = 48

The chromosome having the highest fitness value in the current population represents the solution

to the flow shop problem. So in this case, the solution to the problem is in the following sequence: Job 4, Job 5, Job 2, Job 3 and finally Job 1. It can be presented in the following chromosome: J4 MA MB MC J5 MA MB MC J2 MA MB MC J3 MA MB MC J1 MA MB MC

Fitness Value = 44 hours

The minimum time required to complete all the jobs is 44 hours with the above-mentioned job sequences.

6. Conclusion and References 6.1 Conclusion

As we are doing literature review for the problem in hand, we concluded that there are many ways to solve the job shop / flow shop scheduling problem. One of the best solutions can be achieved via the use of Genetic Algorithm (GA). Even in GA also, there are many techniques can be used from the simplest as represented in this paper or to more complex approaches as highlighted in many other research papers. As the ultimate aim of this paper is to show how GA works and not the solution, we chose the easiest to comprehend method that will better reflects benefits of using GA approach. One of the benefits in using GA is better optimal solution can be developed using the fittest chromosomes to generate the fittest offspring that will replace the worst chromosomes in the current population. This will ensure the survival of the fittest chromosomes. And the fittest chromosomes in this case represent the job sequences with minimum number of hours to finish off all the jobs in all machines. 6.2 References: [1] Y-T. Leung, Joseph , Handbook of Scheduling: Algorithms, Models, and Performance Analysis, [2] Jen-Shiang Chen, Jason Chao-Hsien Pan and Chien-Min Lin, A Hybrid Genetic Algorithm For

The Re-Entrant Flow-Shop Scheduling Problem, Open Access Database www.i-techonline.com [3] Adams, J., Balas, E. and Zawack, D. (1988). The Shifting Bottleneck Procedure for Job-Shop

Scheduling. Management Science, 34(3), 391-401. [4] James Caffrey, and Graham Hitchings, Makespan Distributions In Flow Shop Scheduling,

International Journal of Operations & Production Management, Volume 15, Number 3, Year 1995, pp 50-58

[5] Ahmed El-Bouri, A Hybrid Genetic Algorithm for Flowshop Scheduling, 2001. [6] Murata, T., Ishibuchi, H. & Tanaka, H. (1996). Genetic Algorithms For Flowshop Scheduling

Problems, Computers Ind. Engng., 30(4), 1061-1071. [7] Reeves, C. (1995). A Genetic Algorithm For Flowshop Sequencing , Computers Ops Res.,

22(1), 5-13.

Page 26: AI Paper - GA, NN, Fuzzy Logic

Page | 25

SECTION 3 : Fuzzy Logic

Developing a price for a new product involves a critical mix of many imprecise and uncertain factors such as the estimated demand for the product; the competition’s pricing and price strategies; the sensitivity of the market to price; the costs of

manufacturing, transportation, storing and replenishing standing stock; spoilage rates; seasonality of demand and etc. Figure 2

shows a basic structure of the new product pricing model. Select three input parameters, and appropriate set of rules, run the fuzzy

model that integrates the constraints in pricing to yield an estimated price for the product.

Page 27: AI Paper - GA, NN, Fuzzy Logic

Page | 26

DEVELOPING NEW PRODUCT PRICING MODEL USING FUZZY

RULE-BASED INFERENCE SYSTEM

Doli Anggia Harahap, Razale Ibrahim, Norsyidah Mat Saat @ Abas Department of Management Information System Faculty of Information Science and Technology

National University of Malaysia, 43600 UKM Bangi Selangor, MALAYSIA.

[email protected]; [email protected]; [email protected]

Abstract. The price estimation model for new products is a classic example of the way approximate reasoning is used in decision support. In this paper, we use the Mamdani-style Fuzzy Inference techniques to best estimate the new product price. Fuzzy Rule-Based Inference System is a method that interprets the values in the input vector and, based on user-defined rules, assigns values to the output vector. Fuzzy inference engine evaluates the rules stored in the rule base.

Keywords: Fuzzy Inference System, Fuzzy Sets, Fuzzy Logic, Price Estimation Model

1. Introduction

Fuzzy in lay-man terms means blurry, shadowy, vague or unclear. Expressions like “very flexible”, “easily integrated” and “good solution” are vague expressions. It is the characteristic of the way we humans communicate through language and as such is an integral part of our thinking process. This contrasts sharply with the traditional Boolean logic of computer programming. Fuzzy logic bridges the gap between them, providing a framework that allows us to numerically encode linguistic expressions and through that gives a flexible rule-based system.

When communicating in a natural language a form of mitigating device is commonly used to

weaken or strengthen the impact of a statement. In terms of fuzzy logic, hedges are operators that are applied on the membership function. The operators are defined in such a way to reflect their linguistic meaning and they create a sort of virtual set.

2. Problem Definition and Overview Developing a price for a new product involves a critical mix of many imprecise and uncertain

factors: the estimated demand for the product, the competition’s pricing and price strategies, the sensitivity of the market to price, the costs of manufacturing, transportation, storing, and replenishing standing stock, spoilage rates, seasonality of demand, probable life cycle of product, capitalization requirements, lead time to market, product uniqueness, and its window of opportunity. In this model we want to establish a price based on just a few factors: the cost to manufacture the product, the average price of the competition’s product in our market place and the sensitivity of the market to the change in price.

Page 28: AI Paper - GA, NN, Fuzzy Logic

Page | 27

3. Methodology, Concept, and Problem Solving Strategy

Fuzzy inference can be defined as a process of mapping from a given input to an output, using the theory of Fuzzy Sets. There are two widely used models of fuzzy logic, i.e.: Mamdani and Takagi-Sugeno. The most commonly used fuzzy inference technique is the Mamdani-style inference. This inference allows system to take in a set of crisp input value and apply a set of fuzzy rules those value. The basic structure of Mamdani-style fuzzy inference are as follows:

i. Fuzzification

− This is the mapping from “crisp” numerical values to the membership functions of the fuzzy variables.

ii. Rule evaluation − To be able to express ourselves with this new fuzzy thing, we need some basic rules. Our

ultimate goal is to be able to define logical expressions that we later can turn into statements. − There are three relevant operators in the fuzzy set logic: OR, AND and NOT. They also

obviously exist for regular Boolean logic, but we need to expand their definition to support our new non-sharp membership functions.

− The rules defined are evaluated using the set logic.

iii. Aggregation of Rule Outputs − The results of the rules are aggregated so that they are mapped to the output variables.

iv. Defuzzification

The final step is the mapping from fuzzy output variables to crisp numerical values

For the purpose of this paper, we are going to use the Mamdani-style to build the inference system.

Figure 1 below better illustrates how the Fuzzy Inference System works.

Figure 1: Fuzzy Inference System

For the purpose of solving the problem in hand, we are going to follow the steps below:- i) Specify the problem and define linguistic variables; ii) Determine fuzzy sets; iii) Elicit and construct fuzzy rules; iv) Apply fuzzy operator to evaluate rules; v) Aggregate all the outputs; and finally vi) Defuzzification using centre of gravity to find the output value.

Page 29: AI Paper - GA, NN, Fuzzy Logic

Page | 28

4. Strategy and Solution of the Problem

4.1 Step 1: Specify the problem and define linguistic variables

In our problem, we want to design a price estimation system for some new product. We wish to estimate the product price, p depending on 3 variables: manufacturing cost m, competition’s price c, and the price sensitivity knowledge, s. Thus, we have 3 inputs, m, c and s and 1 output, p.

The first step is to design our fuzzy variables: manufacturing cost m, competition’s price c, the

price sensitivity knowledge, s and the product price. For each of these variables, we define the membership functions. Before that, let us define what does the variables referring to.

m: cost to manufacture the product (e.g.: raw materials, labour cost, operational cost, etc). c: the average price for an alternative product produced by a competitor in the market. s: represent price sensitivity information. They indicate what points are considered, for this kind

of product, to be a high price and a low price. p: market price for the product For the purpose of solving the problem, we assume that the domain expert has chosen the

linguistic variables, linguistic values and ranges as illustrated in Table 1 below.

Table 1: Linguistic Variables and Linguistic Values

Linguistic Variable : Manufacturing cost, m

Linguistic Value Notation Numerical Range

Low L (0, 0.3)

Medium M (0.1, 0.5)

High H (0.4, 0.7)

Linguistic Variable : Competition’s Price, c

Linguistic Value Notation Numerical Range

Low L (0, 0.35)

Medium M (0.30, 0.70)

High H (0.60, 1)

Linguistic Variable : Price Sensitivity Knowledge, s

Linguistic Value Notation Numerical Range

Low L (0, 0.6)

High H (0.50, 1)

Linguistic Variable : Product Price, p

Linguistic Value Notation Numerical Range

Low L (0, 0.40)

Moderate M (0.30, 0.70)

High H (0.60, 1)

Page 30: AI Paper - GA, NN, Fuzzy Logic

4.2 Step 2: Determine The Fuzzy Sets

We have to take the crisp inputs knowledge) and determine the degree to which these inputs belong to each of the appropriate fuzzy sets. A crisp set is a set for which each value either is or is not contained in the set.every value has a membership value, and so is a member to some extent.defines the extent to which a variable is a member of a fuzzy se(not at all a member of the set) to 1.variables.

Figure

Figure

Figure 4

Figure

Step 2: Determine The Fuzzy Sets

We have to take the crisp inputs (manufacturing cost, competition’s price and price sensitivity knowledge) and determine the degree to which these inputs belong to each of the appropriate fuzzy

crisp set is a set for which each value either is or is not contained in the set.every value has a membership value, and so is a member to some extent. The membership value defines the extent to which a variable is a member of a fuzzy set. The membership value is from 0 (not at all a member of the set) to 1. The following Figure 2 to 5 shows the fuzzy sets for all linguistic

Figure 2: Fuzzy sets of Manufacturing Cost

Figure 3: Fuzzy sets of Competition’s Price

4: Fuzzy sets of Price Sensitivity Knowledge

Figure 5: Fuzzy sets of Product Price

Page | 29

(manufacturing cost, competition’s price and price sensitivity knowledge) and determine the degree to which these inputs belong to each of the appropriate fuzzy

crisp set is a set for which each value either is or is not contained in the set. For a fuzzy set, The membership value

The membership value is from 0 the fuzzy sets for all linguistic

Page 31: AI Paper - GA, NN, Fuzzy Logic

Page | 30

4.3 Step 3: Elicit and Construct Fuzzy Rules

The next step is to define the rules for the system. A fuzzy rule is assembled as follows:

IF antecedent THEN consequent

The fuzzy rules can be represented in a matrix form. For three inputs and one output, the representation takes the shape of an MxNxK cube. This form of representation is called a Fuzzy Associative Memory (FAM).

After a detailed analysis on the product price, we derived 45 rules that represent complex relationships between all variables and came out with the following rule table. Out of 45 rules below, the domain expert reject the highlighted rules based on its logic.

RULE

m c s p RULE

m c s p

1 L L L L 24 H M L M 2 M L L L 25 L H L M 3 H L L L 26 M H L M 4 L M L L 27 H H L M 5 M M L L 28 L L L H 6 H M L L 29 M L L H 7 L H L L 30 H L L H 8 M H L L 31 L M L H 9 H H L L 32 M M L H 10 L L H L 33 H M L H 11 M L H L 34 L H L H 12 H L H L 35 M H L H 13 L M H L 36 H H L H 14 M M H L 37 L L H H 15 H M H L 38 M L H H 16 L H H L 39 H L H H 17 M H H L 40 L M H H 18 H H H L 41 M M H H 19 L L L M 42 H M H H 20 M L L M 43 L H H H 21 H L L M 44 M H H H 22 L M L M 45 H H H H 23 M M L M

Then, we constructed 2 rule bases. The first rule base consists of 12 rules and the second one

consists of 18 rules.

Rule Base 1

1. If (manufacturing_cost is L) then (product_price is L) 2. If (manufacturing_cost is M) then (product_price is M) 3. If (manufacturing_cost is H) then (product_price is H) 4. If (manufacturing_cost is L) and (competition_price is L) then (product_price is L) 5. If (manufacturing_cost is M) and (competition_price is L) then (product_price is L) 6. If (manufacturing_cost is H) and (competition_price is L) then (product_price is M) 7. If (manufacturing_cost is L) and (competition_price is M) then (product_price is L) 8. If (manufacturing_cost is M) and (competition_price is M) then (product_price is M) 9. If (manufacturing_cost is H) and (competition_price is M) then (product_price is M) 10. If (manufacturing_cost is L) and (competition_price is H) then (product_price is M) 11. If (manufacturing_cost is M) and (competition_price is H) then (product_price is M)

Page 32: AI Paper - GA, NN, Fuzzy Logic

Page | 31

12. If (manufacturing_cost is H) and (competition_price is H) then (product_price is H)

Rule Base 2

1. If (manufacturing_cost is L) and (competition_price is L) and (price_sensitivity is L) then (product_price is L) 2. If (manufacturing_cost is M) and (competition_price is L) and (price_sensitivity is L) then (product_price is L) 3. If (manufacturing_cost is H) and (competition_price is L) and (price_sensitivity is L) then (product_price is L) 4. If (manufacturing_cost is L) and (competition_price is M) and (price_sensitivity is L) then (product_price is L) 5. If (manufacturing_cost is M) and (competition_price is M) and (price_sensitivity is L) then (product_price is M) 6. If (manufacturing_cost is M) and (competition_price is M) and (price_sensitivity is L) then (product_price is M) 7. If (manufacturing_cost is L) and (competition_price is H) and (price_sensitivity is L) then (product_price is L) 8. If (manufacturing_cost is M) and (competition_price is H) and (price_sensitivity is L) then (product_price is M) 9. If (manufacturing_cost is H) and (competition_price is H) and (price_sensitivity is L) then (product_price is H) 10. If (manufacturing_cost is L) and (competition_price is L) and (price_sensitivity is H) then (product_price is L) 11. If (manufacturing_cost is M) and (competition_price is L) and (price_sensitivity is H) then (product_price is M) 12. If (manufacturing_cost is H) and (competition_price is L) and (price_sensitivity is H) then (product_price is M) 13. If (manufacturing_cost is L) and (competition_price is M) and (price_sensitivity is H) then (product_price is L) 14. If (manufacturing_cost is M) and (competition_price is M) and (price_sensitivity is H) then (product_price is M) 15. If (manufacturing_cost is H) and (competition_price is M) and (price_sensitivity is H) then (product_price is H) 16. If (manufacturing_cost is L) and (competition_price is H) and (price_sensitivity is H) then (product_price is M) 17. If (manufacturing_cost is M) and (competition_price is H) and (price_sensitivity is H) then (product_price is M) 18. If (manufacturing_cost is H) and (competition_price is H) and (price_sensitivity is H) then (product_price is H)

Page 33: AI Paper - GA, NN, Fuzzy Logic

Page | 32

4.4 Step 4: Apply Fuzzy Operator to Evaluate Rules

To see how everything fits together, we examine three rules below: Rule: 1 IF OR THEN

x is A3 y is B3 p is D3

Rule: 1 IF OR THEN

manufacturing_ cost is high competitor_price is high product_price is high

Rule: 2 IF AND THEN

x is A2 z is C2 p is D2

Rule: 1 IF AND THEN

manufacturing_ cost is medium price_sensitivity is low product_price is moderate

Rule: 3 IF OR THEN

x is A1 y is B1 p is D1

Rule: 1 IF OR THEN

manufacturing_ cost is low competitor_price is low product_price is low

where x, y, z and p (manufacturing cost, price for competitor’s product, price sensitivity knowledge and product price) are linguistic variables; A1, A2 and A3 (low, medium and high) are linguistic values determined by fuzzy sets on universe for discourse M (manufacturing cost); B1, B2 and B3 (low, medium, high) are linguistic values determined by fuzzy sets on universe of discourse C (price for competitor’s product); C1 and C2 (low and high) are linguistic values determined by fuzzy sets on universe of discourse S (price sensitivity knowledge) while D1, D2 and D3 (low, moderate, high) are linguistic values determined by fuzzy sets on universe of discourse P (product price). The crisp input x1 (manufacturing cost rated by the expert as RM25.00) corresponds to the membership functions A1 and A2 (low and medium) to the degrees of 0.5 and 0.2 respectively, and the crisp input y1 (price of competitor’s product rated as RM35.00) maps the membership functions B1 , B2 and B3 (low, medium and high) to the degrees of 0.6, 0.4 and 0.2 respectively; and the crisp input z1 (price sensitivity rated as 30%) maps the membership functions C1 and C2 (low and high) to the degrees of 0.1 and 0.7 respectively. We then take the fuzzified inputs, µ(x=A1)=0.5, µ(x=A2)=0.2, µ(y=B1)=0.6, µ(y=B2)=0.4, µ(y=B3)=0.2, µ(z=C1)=0.1, µ(z=C2)=0.7, and apply them to the antecedents of the fuzzy rules. If a given fuzzy rule has multiple antecedents, the fuzzy operator (AND or OR) is used to obtain a single number that represents the result of the antecedent evaluation. This number (the truth value) is the applied to the consequent membership function. To evaluate the disjunction of the rule antecedents, we use the OR fuzzy operation.

µAUB(x) = max [µA(x), µB(x)] Similarly, to evaluate the conjunction of the rule antecedents, we apply AND fuzzy operation intersection:

µA∩B(x) = min [µA(x), µB(x)]

Let us examine our rules again:

Rule: 1 IF OR THEN

x is A3 (0.0) y is B3 (0.2) p is D3 (0.2)

µAUB(x) = max [µA(x), µB(x)] = max [0.0, 0.2] = 0.2

Page 34: AI Paper - GA, NN, Fuzzy Logic

Rule: 2 IF AND THEN

x is A2 (0.2)z is C2 (0.p is D2 (0.2)

Rule: 3 IF OR THEN

x is A1 (0.5)y is B1 (0.6)p is D1 (0.6)

Now the result of the antecedent evaluation can be applied to the membership function of the consequent. It can be clipped or scaled to the level of truth value of the rule antecedent. The fuzzification output is as shown in Figure 6 below.

A2 (0.2) C2 (0.7) 2 (0.2)

µA∩B(x) = min [µA(x), µC(x)] = min [0.2, 0.7] = 0.2

A1 (0.5) B1 (0.6) 1 (0.6)

µAUB(x) = max [µA(x), µB(x)] = max [0.5, 0.6] = 0.6

ult of the antecedent evaluation can be applied to the membership function of the consequent. It can be clipped or scaled to the level of truth value of the rule antecedent.

The fuzzification output is as shown in Figure 6 below.

Figure 6: Fuzzification output

Page | 33

ult of the antecedent evaluation can be applied to the membership function of the consequent. It can be clipped or scaled to the level of truth value of the rule antecedent.

Page 35: AI Paper - GA, NN, Fuzzy Logic

From previous Figure 6, we can derive the rule evaluation as in Figure 7

From previous Figure 6, we can derive the rule evaluation as in Figure 7 to 9

Figure 7: Rule Evaluation for Rule 1

Figure 8: Rule Evaluation for Rule 2

Figure 9: Rule Evaluation for Rule 3

Page | 34

to 9 below.

Page 36: AI Paper - GA, NN, Fuzzy Logic

4.5 Step 5: Aggregate All the Outputs

Aggregation is the process of unification of the outputs of all rules. In other words, we take the membership functions of all rules consequents previously clipped or scaled and combine them into asingle fuzzy set. Thus, the input of the aggregation process is the list of clipped or scaled consequent membership functions, and the output is one fuzzy set for each output variable. Figure 10 shows how the output of each rule is aggregated into a singl

Figure

4.6 Step 6: Defuzzification Using Centre of Gravity to Find the Output Value

The last step in the fuzzy inference process is defuzzification.the rules, but the final output of a fuzzy system has to be a crisp number. The input for the defuzzification process is the aggregate output fuzzy set and the output is a single number.

The most popular method to defuzzify is the cen

vertical line should slice the aggregate set into two equal masses. Mathematically this Centre Of Gravity (COG) can be represented as

COG =

----------------

� A centroid defuzzification method finds a point representing the centre of gravity of the fuzzy

set, A on the interval ab. In theory, the COG is calculated over a continuum of points in the aggregate output membership function, but in practice, a reasonable eover a sample of points. In this case, the following formula is applied:

COG = ----------------

Step 5: Aggregate All the Outputs

Aggregation is the process of unification of the outputs of all rules. In other words, we take the membership functions of all rules consequents previously clipped or scaled and combine them into asingle fuzzy set. Thus, the input of the aggregation process is the list of clipped or scaled consequent membership functions, and the output is one fuzzy set for each output variable. Figure 10 shows how the output of each rule is aggregated into a single fuzzy set for the overall fuzzy output.

Figure 10: Aggregation of Rule Consequents

Step 6: Defuzzification Using Centre of Gravity to Find the Output Value

The last step in the fuzzy inference process is defuzzification. Fuzziness hthe rules, but the final output of a fuzzy system has to be a crisp number. The input for the defuzzification process is the aggregate output fuzzy set and the output is a single number.

The most popular method to defuzzify is the centroid technique. It finds the point where a vertical line should slice the aggregate set into two equal masses. Mathematically this Centre Of Gravity (COG) can be represented as:

� A(x)xdx

----------------

� A(x)dx

entroid defuzzification method finds a point representing the centre of gravity of the fuzzy In theory, the COG is calculated over a continuum of points in the aggregate

output membership function, but in practice, a reasonable estimate can be obtained by calculating it over a sample of points. In this case, the following formula is applied:

� � � A(x)x

---------------- � � � A(x)

Page | 35

Aggregation is the process of unification of the outputs of all rules. In other words, we take the membership functions of all rules consequents previously clipped or scaled and combine them into a single fuzzy set. Thus, the input of the aggregation process is the list of clipped or scaled consequent membership functions, and the output is one fuzzy set for each output variable. Figure 10 shows how

e fuzzy set for the overall fuzzy output.

Step 6: Defuzzification Using Centre of Gravity to Find the Output Value

Fuzziness helps us to evaluate the rules, but the final output of a fuzzy system has to be a crisp number. The input for the defuzzification process is the aggregate output fuzzy set and the output is a single number.

troid technique. It finds the point where a vertical line should slice the aggregate set into two equal masses. Mathematically this Centre Of

entroid defuzzification method finds a point representing the centre of gravity of the fuzzy In theory, the COG is calculated over a continuum of points in the aggregate

stimate can be obtained by calculating it

Page 37: AI Paper - GA, NN, Fuzzy Logic

The COG for our problem is calculated as below: COG = (0+5+10+15+20+25+30) x 0.2 + (35+40+45+50) x 0.6 ---------------------------------------------------------------------- 0.2+0.2+0.2+0.2+0.2+0.2+0.2+0.5+0.6+0.6+0.6 = 33.24. Thus, the result of defuzzification, crisp output p1, is 33.24. It means for instance, that the

product price can be estimated at RM33.24. Figure 11 below shows defuzzifying

Figure 11

5. Analysis and Discussion of the Findings

The estimated price for theestimation can be done usdetermined by the crisp inptest the system by applyiactual situation.

6. Conclusion

Given 3 parameters: Manufacturing Cost, Competition’s Price and Price Sensitivity Knowledge, we manage to estimate price of a given product Mamdani’s Inference style involving 4 major steps: fuzzification, rule evaluation, aggregation of rule consequents and defuzzification. In the process, we manage to linguistic variables, linguistic values of all the parameters. We also presof membership for each variabevaluate the rules. After that, wecentroid technique or Centre of G

The COG for our problem is calculated as below:

(0+5+10+15+20+25+30) x 0.2 + (35+40+45+50) x 0.6 ----------------------------------------------------------------------

0.2+0.2+0.2+0.2+0.5+0.6+0.6+0.6

Thus, the result of defuzzification, crisp output p1, is 33.24. It means for instance, that the product price can be estimated at RM33.24.

shows defuzzifying the solution variable’s fuzzy set.

1: Defuzzifying the solution variable’s fuzzy set

Analysis and Discussion of the Findings

e given parameters is RM33.24. A more comprehsing the Fuzzy Logic Toolbox in Matlab applicatioput given by domain expert as in section 4.4. Thing all the rules in rule base and compare its c

Given 3 parameters: Manufacturing Cost, Competition’s Price and Price Sensitivity Knowledge, we manage to estimate price of a given product by using the Fuzzy Inference System following Mamdani’s Inference style involving 4 major steps: fuzzification, rule evaluation, aggregation of rule consequents and defuzzification. In the process, we manage to linguistic variables, linguistic values of

sent the linguistic variables in the form of fuzzy seble. Then, we establish the rule base and appe aggregate the rule consequents in on single andGravity (COG) method.

Page | 36

Thus, the result of defuzzification, crisp output p1, is 33.24. It means for instance, that the

hensive and accurate on. The result will be

he domain expert can consistency with the

Given 3 parameters: Manufacturing Cost, Competition’s Price and Price Sensitivity Knowledge, by using the Fuzzy Inference System following

Mamdani’s Inference style involving 4 major steps: fuzzification, rule evaluation, aggregation of rule consequents and defuzzification. In the process, we manage to linguistic variables, linguistic values of

ets to see the degree ply fuzzy operator to d defuzzy it using the

Page 38: AI Paper - GA, NN, Fuzzy Logic

Page | 37

References

[1] Kuşan, H., Aytekina, O., and Özdemira, I., The Use Of Fuzzy Logic In Predicting House Selling Price,

[2] Juang, Y.S., Lin, S.S., Kao, S.P., Design And Implementation Of A Fuzzy Inference System For Supporting Customer Requirements, Expert Systems with Applications, 32 (2007), pp. 868–878.

[3] Cox, E., The Fuzzy Systems Handbook: A Practitioner’s Guide To Building, Using and Maintaining Fuzzy Systems, Academic Press Inc. (1994)

Page 39: AI Paper - GA, NN, Fuzzy Logic

Page | 38

SECTION 4 : Neural Network

The feed forward neural network can be used for data compression. The structure involves an input layer, a hidden layer and an output layer. The input exemplar applied to the input layer is mapped to itself at the output layer, and the signal encoded as the output from the hidden layer represents the compressed data. Therefore, the number of units at the output layer equals the dimension of the input vector, whereas the hidden layer units are less in number if compression is to take place. For instance, to achieve 2:1 compression, the number of hidden layer units must be half the number of output units. Represent each of the letters E, H, F, L, M and N as an 8 x 5 binary image composed of 40 squares (8 rows of 5 squares). Denote a filled square by 1 and unfilled square by 0. Represent each letter as a binary sequence of length 40 generated from a row-by-row scan of the corresponding image. The set of binary sequences constitutes an epoch to be used for training. Let the number of hidden layer units be 20, each of which is characterized by a log-sigmoid-with-bias type of transfer characteristic. Let the number of output units be 40, each of which is characterized by another suitable non-linearity, which you have to choose. Train the structure using back propagation algorithm and test the performance of your trained network.

Page 40: AI Paper - GA, NN, Fuzzy Logic

Page | 39

NEURAL NETWORK: USING BACKPROPAGATION ALGORITHM

FOR CHARACTER RECOGNITION

Doli Anggia Harahap, Razale Ibrahim, Norsyidah Mat Saat @ Abas Department of Management Information System Faculty of Information Science and Technology

National University of Malaysia, 43600 UKM Bangi Selangor, MALAYSIA.

[email protected]; [email protected]; [email protected]

Abstract. Neural network is a branch of Artificial Intelligent. One method of neural network is backpropagation method. Many of the neural network applications including: for prediction, pattern recognition, identification and simulation. In this case, we use neural network with backpropagation algorithm method for pattern recognition alphabet, and data compression.

Keywords: Neural Network, Backpropagation, Character Recognition

1. Methodology

Backpropagation is used in this case which this methodology is very popular even though this methodology is not the best one. Backpropagation is trained without supervision. This methodology, the inputs will be continued to the hidden layer, and then to the output layers.

2. Strategy and Solution of the problem

We choose character L, H, and F to be trained.

Table 1: Letters are represented by 40 bit binary.

Letter In Pixel Output

L 1000000000000000000000000000000000000000

40 Length Input Binary = 1000010000100001000010000100001000011111

Page 41: AI Paper - GA, NN, Fuzzy Logic

Page | 40

H 0100000000000000000000000000000000000000

40 Length Input Binary = 1000110001100011111110001100011000110001

F

0010000000000000000000000000000000000000

40 Length Input Binary = 1111110000100001111110000100001000010000

20 units of hidden layers with characterized by log-sigmoid-with-bias. 40 output units with characterized by non-linearity.

Figure 1: Neural Network with 40 input layers, 20 hidden layers, and 40 output layers.

Input Hidden Layer Output

X

X2

X3

X39

X4

Y1

Y2

Y20

Z

Z2

Z3

Z3

Z40

Page 42: AI Paper - GA, NN, Fuzzy Logic

Calculate Initial Hidden Layer for Y1 for Character “L”:

Y is Hidden Layer, X is Input Layer, W is Weigh Where Weigh:

Range is , F is number of Input Layers, so:

With weigh is taken randomly:

calculation comes out with result of initial Y1:= 0.08 We used Sigmoid function to calculate Y1:

Iteration continue until reach i = 40 for Y40. Then same step is applied for getting the output

Layer

3. Analysis and discussion of the findings.

For this case, neural network is designed and trained for recognizing 3 alphabets; each is represented by binary value 5x8. At the firepresented by 1 at the first binary in output layer. Good neural network is able to respond to the one existing character and the other output value is 0.

This neural network is consist of 3 lused because the range of output results is between 0 and 1. It is suitable for output with Boolean/Binary value.

4. Conclusion & references

It has shown that neural network is able to identify lettepossibilities for development of pattern recognition further.

Calculate Initial Hidden Layer for Y1 for Character “L”:

ayer, W is Weigh Where Weigh:

calculation comes out with result of initial Y1:

We used Sigmoid function to calculate Y1:

ntil reach i = 40 for Y40. Then same step is applied for getting the output

Analysis and discussion of the findings.

For this case, neural network is designed and trained for recognizing 3 alphabets; each is represented by binary value 5x8. At the first time, we define 40 inputs and 40 outputs. At this, L is represented by 1 at the first binary in output layer. Good neural network is able to respond to the one existing character and the other output value is 0.

This neural network is consist of 3 layers; input, hidden, and output layer. Sigmoid function is used because the range of output results is between 0 and 1. It is suitable for output with

Conclusion & references

It has shown that neural network is able to identify letters L, H, and F. This provides great possibilities for development of pattern recognition further.

Page | 41

ntil reach i = 40 for Y40. Then same step is applied for getting the output

For this case, neural network is designed and trained for recognizing 3 alphabets; each is rst time, we define 40 inputs and 40 outputs. At this, L is

represented by 1 at the first binary in output layer. Good neural network is able to respond to the one

ayers; input, hidden, and output layer. Sigmoid function is used because the range of output results is between 0 and 1. It is suitable for output with

rs L, H, and F. This provides great

Page 43: AI Paper - GA, NN, Fuzzy Logic

Page | 42

References

[1] Asep Solahuddin, MT.: Penerapan Neural Network Tentang Metode Backpropagation Pada Pengenalan Pola Huruf. Proceeding, Komputer dan Sistem Intelijen, Auditorium Universitas Gunadharma, Jakarta, 21-22 August 2002.

[2] Shahank Araokar.: Visual Character Recognition using Artificial Neural Network. [3] R. Rojas.: Neural Networks. Springer-Verlag,. pp 151-184. Berlin 1996.