V
- the graph vertex typeE
- the graph edge typepublic class GeneticColoring<V,E> extends Object implements 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.
Constructor and Description |
---|
GeneticColoring(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) |
Modifier and Type | Method and Description |
---|---|
org.jgrapht.alg.interfaces.VertexColoringAlgorithm.Coloring<V> |
getColoring() |
Copyright © 2023. All rights reserved.