genetic algorithms for shortest path routing

29

Upload: kingbalan

Post on 20-Jan-2015

2.941 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Genetic algorithms for shortest path routing
Page 2: Genetic algorithms for shortest path routing

Outline

• Increasing Complexity Of Internet• Packet data transfer• Shortest Path Problem• Traditional Approaches(Dijkstra's

Algorithm)• Genetic Algorithms(GA)• Using GA to solve Shortest Path Problem• Test Cases and Results• Applications in other fields

2

Page 3: Genetic algorithms for shortest path routing

Complexity Of Internet

• 2.2 Billion Users• Millions Of

Backbone Routers

• Costs Involved - transmission

delay - Low bandwidth - no of routers in

between

3

Page 4: Genetic algorithms for shortest path routing

• Files broken into packets• Virtual circuits• Weights for a path assigned by network

provider

Packet Data Transfer Basics

4

Page 5: Genetic algorithms for shortest path routing

Shortest Path Problem

•  Finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized.

• Dijkstra's algorithm is the most popular algorithm for solving this

• Improves performance of the communication system.

• Used by ISPs , Internet Backbone services, even Google maps !

5

Page 6: Genetic algorithms for shortest path routing

6

Traditional Approach (Dijkstra's algorithm)

• +Simple Algorithm

• +Used extensively in OSPF(open short path first) IP routing

• -Time consuming in large networks

Need for better algorithm for faster results !

Page 7: Genetic algorithms for shortest path routing

7

Real World Example

Page 8: Genetic algorithms for shortest path routing

Genetic Algorithms

Formal Definition: Genetic Algorithms are global search and optimization techniques modeled from natural selection, genetic and evolution. It mimics natural evolution process for producing better results.

-Introduced in 1970 by James Holland

A typical genetic algorithm requires:1. a genetic representation of the solution

domain(chromosomes)2. a fitness function to evaluate the solution domain.

• New off springs are generated /evolved from the chromosomes using operators like selection, crossover and mutation

8

Page 9: Genetic algorithms for shortest path routing

Chromosomes(Candidate Solutions)

• They are candidate solutions chosen randomly• Usually binary coded • First generation is chosen randomly through some

algorithm with less complexity.• Newer generations are formed by testing fitness

of each chromosome .

9

Page 10: Genetic algorithms for shortest path routing

Fitness function

• Assigns a “figure of merit ” for each chromosome.(How close the solutions are to required solution)

• Chromosomes with higher fitness value is chosen for next generation.

• After each round of testing we delete the 'n' worst solutions, and to breed 'n' new ones from the best design solutions using operators like mutation and crossover.

10

Page 11: Genetic algorithms for shortest path routing

Mutation• Mutation is an operator used to maintain genetic

diversity from one generation of a population of  chromosomes to the next generation.

• Implemented through Bit Flipping• Mutation Probability

11

Page 12: Genetic algorithms for shortest path routing

Crossover(Recombination)

• Cross over is a process of taking more than one parent solutions and producing a child solution from them.

• Three Steps1. Selects a random pair of two individuals2. A Cross site is selected at random along the string length3. String bits after the crossover site are exchanged.

• Crossover Probability(Pc)

• Types

12

Page 13: Genetic algorithms for shortest path routing

13

Crossover

Page 14: Genetic algorithms for shortest path routing

1. [Start] Generate random population of n chromosomes (suitable solutions for the problem)

2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the population

3. [New population] Create a new population by repeating following steps until the new population is complete– [Selection] Select two parent chromosomes from a

population according to their fitness (the better fitness, the bigger chance to be selected)

– [Crossover] With a crossover probability cross over the parents to form a new offspring (children). If no crossover was performed, offspring is an exact copy of parents.

– [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome).

– [Accepting] Place new offspring in a new population

Outline of Basic Genetic Algorithm

14

Page 15: Genetic algorithms for shortest path routing

15

Outline of Basic Genetic Algorithm(contd..)

4.[Replace] Use new generated population for a further run of algorithm

5.[Test] If the end condition is satisfied, stop, and return the best solution in current population

6. [Loop] Go to step 2

Advantages Of GAs1. Can explore search space in parallel .2. Improved performance over larger no of bits in

encoding3. Easy to discover global optimum4. Solution space is wider..

Page 16: Genetic algorithms for shortest path routing

Genetic Algorithm Applied to Shortest Path Problem

• 20 Nodes• 62 Links

• 20chromosomes randomly by a simple algorithm.

Test Case

16

Page 17: Genetic algorithms for shortest path routing

Chromosomes

• We chose 50 chromosomes as initial population through random selection.

• Genes are the nodes numbers through which candidate path passes through

• Examples

0 2 3 7 9 11

12

17

18

20

0 4 5 7 10

11

13

15

16

20

17

Page 18: Genetic algorithms for shortest path routing

Cost Matrix

• Eg: cost of path 0-1 is 52

18

Page 19: Genetic algorithms for shortest path routing

Fitness Function

• Sum of weights of paths between nodes are taken as the fitness of the chromosome.

• So the candidate with lowest value are the most fit ones.

19

Page 20: Genetic algorithms for shortest path routing

Crossover

• The crossover function takes two parents to mate.

• It looks for the common points in the parents.

• The common nodes are where these two paths intersect.

• Crossover Probability=0.99

20

Page 21: Genetic algorithms for shortest path routing

Mutation

• A very low mutation probability is chosen since flipping of many bits may lead to wrong paths

• Mutation Probability =0.01

• Correction Function to validate paths after mutation

21

Page 22: Genetic algorithms for shortest path routing

Termination Conditions

• No change in population fitness and stall generation(Convergence)

• Reached N generations• Chromosome has attained some

predefined Fitness Level

22

Page 23: Genetic algorithms for shortest path routing

Results

First 20 Individuals in Initial Polulation

50 Such generations were produced.

Fitness Value ranged from 147 to 1138 , Average value 687

23

Page 24: Genetic algorithms for shortest path routing

Results

• After few Generations the average fitness of Individuals reached an Optimum value of 137

• Since the paths were repeatedly modified by crossover and mutation

24

Page 25: Genetic algorithms for shortest path routing

Results

25

Page 26: Genetic algorithms for shortest path routing

Comparison With Dijkstra's algorithm

26

15 20 25 30 35 40 45 500

0.5

1

1.5

2

2.5

3

3.5

4

4.5

Dijistkra

Genetic Algorithm

No OF NODES

COM

PUTA

TIO

N T

IME

Page 27: Genetic algorithms for shortest path routing

27

Drawbacks of the algorithm

1. Identifying Fitness Function is not easy2. Representation of problem in genetic

terms is difficult.3. Premature convergence occurs4. Choosing various parameters like size of

population, mutation and crossover probability has no defined rules.

5. Hardware implantation difficult

Page 28: Genetic algorithms for shortest path routing

28

Conclusions

• GAs perform much more faster than Dijsktras algorithm when the no of nodes in the network are increased.

• Performed well in simulations.(yet to be implemented in real world )

Page 29: Genetic algorithms for shortest path routing

29

References

• Dr. Rakesh Kumar1 et.al (2010) :Exploring Genetic Algorithm for Shortest Path Optimization in Data Networks. Global Journal of Computer Science and TechnologyVol. 10 Issue 11 (Ver. 1.0) October 2010

• Bilal Gonen (2008): Genetic Algorithm Finding the Shortest Path in Networks.

• Dr Sachith Abeysundara et.al (2005) :A Genetic Algorithm Approach to Solve the Shortest Path Problem for Road Maps

• S N Sivanandan S N Deepa (2008) : Principles Of Soft Computing

• http://en.wikipedia.org/wiki/Genetic_algorithm• R. S. Ramakrishna et.al (2002) :A Genetic Algorithm for

Shortest Path Routing Problem and the Sizing of Populations , IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. 6, NO. 6