Class GeneticColoring<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
org.jgrapht.alg.interfaces.VertexColoringAlgorithm<V>
This class implements the technique described in Genetic Algorithm Applied to the Graph Coloring Problem by Musa M. Hindi and Roman V. Yampolskiy.
The genetic algorithm process continues until it either finds a solution (i.e. 0 conflicts between adjacent vertices) or the algorithm has been run for the predefined number of generations.
The goal of the algorithm is to improve the fitness of the population (a coloring) by mating its fittest individuals to produce superior offspring that offer a better solution to the problem. This process continues until a terminating condition is reached which could be simply that the total number of generations has been run or any other parameter like non-improvement of fitness over a certain number of generations or that a solution for the problem has been found.
- Author:
- Soroush Javadi, Refactored for JGraphT by Michael Carleton
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGeneticColoring
(org.jgrapht.Graph<V, E> graph) Creates with a population size of 50; "the value was chosen after testing a number of different population sizes.GeneticColoring
(org.jgrapht.Graph<V, E> graph, int maxGenerations, int populationSize, int fitnessThreshold) -
Method Summary
-
Constructor Details
-
GeneticColoring
Creates with a population size of 50; "the value was chosen after testing a number of different population sizes. The value 50 was the least value that produced the desired results".- Parameters:
graph
-
-
GeneticColoring
-
-
Method Details
-
getColoring
- Specified by:
getColoring
in interfaceorg.jgrapht.alg.interfaces.VertexColoringAlgorithm<V>
-