Quantcast
Channel: Machine Learning | Towards AI
Viewing all articles
Browse latest Browse all 792

Genetic Algorithm For Optical Spectrum Defragmentation

$
0
0
Author(s): Bassem Essam Originally published on Towards AI. Genetic Algorithm For Optical Spectrum Defragmentation Bassem Essam · Follow Published in Towards AI ·9 min read·1 hour ago Listen Share Photo by digitale.de on Unsplash The genetic algorithm has many applications in real-world problems. It works well in many optimization problems due to its simplicity and speed. The genetic algorithm is inspired by the evolution theory. It uses the randomness of generating new instances and the “survival to the fittest” concept to generate the optimal solution. In this blog, the main idea and concepts of the genetic algorithm will be explained. They will be illustrated with the traveling salesman problem to clear the mechanisms of the algorithm with a practical example. Afterward, the optical spectrum fragmentation problem will be explained briefly, and why the genetic algorithm is a good solution for this problem. Finally, we will go through the application of the genetic algorithm to solve the spectrum fragmentation problem. What is Genetic Algorithm? The genetic algorithm mimics the concepts of the evolution theory. If we have a generation of a specific animal species and their pairs are mated, the resultant individuals will inherit the genes from both parents. The next generation of this species will have the individuals with the best genes inherited from the best parents and others with weak genes. After generations, the weak genes will disappear since the individuals who are carrying these genes will not be fit enough to survive and pass their genes to the next generations. In optimization problems usually, we are trying to find the optimal solution from a large space of solutions, and we keep track of the different solutions to know if we are approaching the optimal solution or not. If we use the same concepts of evolution in our problem, we can find a semi-optimal solution in a reasonable time. The genetic algorithm goes into the same stages as happens with genes moving through the generations. At the beginning the population initialization, then the mating, the selection, and the mutation stage to explore larger search space. At this point, the concepts are still not clear, so we can explore the traveling salesman problem as an example and see how a genetic algorithm can find a solution to it in less time. The Traveling Salesman Problem The traveling salesman problem (TSP) is a famous NP-Hard problem that can be solved in exponential time. Let’s assume that a salesman has to visit 5 cities and return to the city where he started. What is the shortest path to go to all cities without passing by the same city twice? The straightforward approach is to calculate the distances of all possible solutions and choose the one with the lowest distance. This approach is good but it’s very time-consuming and not scalable as the number of cities increases the time complexity increases. In our example, the five cities have 5! possible paths, which is 120 paths, what if we have 100 cities, the possible paths are 36828800, so another approximate solution can be developed to find the near-optimal solution. One of the algorithms is the greedy algorithm, in which you choose the nearest unvisited city to the current city as the next destination city until you are done with all the cities. This algorithm is very good in the sense of the reduction of the time complexity which is reduced to n instead of n! The greedy algorithm is really fast but the solution is not optimal especially when the number of cities (n) is high. Here the genetic algorithm comes to play a role. Figure(1) Traveling salesman Problem First, let’s assume that we take a sequence of cities randomly and calculate the total distances between these cities. Again, we keep randomizing this set and hopefully, we get the minimum distance. Here, we still have a chance to hit the optimal solution (the minimum total distances between the cities). The challenge is to select the best random solution and keep track of how you are approaching the optimal solution. Now let’s see how the genetic algorithm helps solve these challenges. When we generate a set of cities, we will call it a chromosome and the total distances between cities in this set will be the chromosome fitness. Here our goal is to minimize the fitness of the chromosome as much as possible. Let’s generate thousands of chromosomes (combinations of cities) and call them the population. The next step is to mate the individuals in the population somehow and crossover their chromosomes. This means that we take the first half of the sequence from the first chromosome and the second half from the second chromosome. Afterward, we calculate the fitness of the individuals in the population. We select the best individuals (the chromosome with the minimum fitness score) then, move them to the next generation and repeat these steps for each generation until we solve with the best fitness when the algorithm converges. Till this point, we missed a very important step which is the mutation, in this step, we make some changes to the generated chromosomes at a very low rate to help the algorithm explore other areas in the search space. Without mutation, the algorithm will keep searching in the possible variations of the cities and might end up without getting any optimal solution. Figure(2) Single-point Crossover in TSP and replacing duplicates with missing cities Optical Spectrum Fragmentation The optical spectrum fragmentation problem is very common in DWDM networks. The fragmented spectrum is the spectrum that is not efficiently utilized. In DWDM networks, the wavelengths are multiplexed together in one fiber core to be sent to the far-end site. In the C band, there are traditionally 88 X 50GHz channels in one link. If we have a complex optical network, the wavelengths are routed between sites to fulfill the traffic matrix needs of the customers. In the example shown in Figure (3), we need to avail a wavelength between site 1 to […]

Viewing all articles
Browse latest Browse all 792

Trending Articles