genetic algorithms for shortest path routing
DESCRIPTION
TRANSCRIPT
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
Complexity Of Internet
• 2.2 Billion Users• Millions Of
Backbone Routers
• Costs Involved - transmission
delay - Low bandwidth - no of routers in
between
3
• Files broken into packets• Virtual circuits• Weights for a path assigned by network
provider
Packet Data Transfer Basics
4
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
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 !
7
Real World Example
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
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
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
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
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
13
Crossover
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
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..
Genetic Algorithm Applied to Shortest Path Problem
• 20 Nodes• 62 Links
• 20chromosomes randomly by a simple algorithm.
Test Case
16
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
Cost Matrix
• Eg: cost of path 0-1 is 52
18
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
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
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
Termination Conditions
• No change in population fitness and stall generation(Convergence)
• Reached N generations• Chromosome has attained some
predefined Fitness Level
22
Results
First 20 Individuals in Initial Polulation
50 Such generations were produced.
Fitness Value ranged from 147 to 1138 , Average value 687
23
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
Results
25
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
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
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 )
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