amarjitdhillon / find-shortest-path-using-generic-algorithm-in-matlab Goto Github PK
View Code? Open in Web Editor NEWObjective of this project was to select minimum cost path for sending packets from router A to router B such that all routers are traversed, hence this problem is different to Travelling Salesmen Problem (TSP), where Intermediate nodes can be left off. Initial location for all routers was randomly generated in 3-D space. Hinged upon initially generated locations, distance amidst them is computed using Euclidian formula which serves as Fitness function. Initial Population was selected using Roulette wheel selection using aforementioned Fitness function. Then Crossover was computed if, Probability of crossover. Pc > (Randomly generated probability) using two-point crossover. After this initial population was updated and mutation was done if Pm > (Randomly generated probability). Best chromosome was computed using max fitness function and Inversion / Swapping / Sliding was done on 2nd,3rd,4th chromosome, while 1st chromosome was passed as such using Elite Selection method to preserve best chromosome (Solution in this case). User have laxity to enter number of initial routers, size of initial population and number of iterations for Genetic algorithm to simulate. This method was named as MGA (Modified Genetic Algorithm) and itβs performance was juxtaposed with SGA (Simple Genetic Algorithm) where Initial Selection / Fitness function / Crossover / Mutation method deployed were computed differently using same set of routers co-ordinates used for SGA. Results were shown using six simulation Graphs, three for each case.