GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sfuhrm/geneticalgorithm: Genetic algorithm Java library for explorers

BranchesTags
Open more actions menu

Latest commit

 

History

320 Commits
320 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
doc/uml
doc/uml
 
 
geneticalgorithm-example-int-guessing
geneticalgorithm-example-int-guessing
 
 
geneticalgorithm
geneticalgorithm
 
 
src/checkstyle
src/checkstyle
 
 
.gitignore
.gitignore
 
 
LICENSE-2.0.txt
LICENSE-2.0.txt
 
 
MAINTAINERS
MAINTAINERS
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Genetic Algorithm in Java

Java CI with Maven Coverage Maven Central javadoc ReleaseDate License

Purpose

A genetic algorithm library in Java with focus on easy usage and high performance. Genetic algorithms are meta heuristics inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms. Genetic algorithms can solve optimization problems when there's only an evaluation function available (also known as fitness function).

Illustration: Integer guessing

The following illustration shows the library guessing a sequence of 30 int values with a genetic population size of 3000 hypothesis. At the beginning many components of the population are wrong (=red). With almost every generation (=line) the population improves in fitness and more and more components turn from wrong (=red) to correct (=green).

Guessing an int sequence

See sample code.

Using the library

The process of using the library is summarized in the following picture: Steps for using GeneticAlgorithm

An overview of the classes is given in the following class diagram: Class diagram of GeneticAlgorithm

There is a javadoc documentation online for a more detailed discussion on the classes.

Example

There is a stand-alone Java application in the Maven subproject geneticalgorithm-example-int-guessing. This example tries to guess one sequence of integer numbers. One example is to guess the sequence [0, 1, 2, 3, 4].

Please see the example code in GuessingExample.java.

Including genetic algorithm in your projects

The recommended way of including the library into your project is using Apache Maven:


<dependency>
    <groupId>de.sfuhrm</groupId>
    <artifactId>geneticalgorithm</artifactId>
    <version>3.0.0</version>
</dependency>

Requirements

The library uses Java 8 functions and will only work with Java 8 and above. There are no libraries needed besides those build-in the JDK.

Algorithm reference

The algorithm is based on the book Machine learning. Tom M. Mitchell. Published by McGraw-Hill (ISBN 0-07-115467-1).

License

Copyright 2016-2025 Stephan Fuhrmann

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Genetic algorithm Java library for explorers

Topics

fastgenetic-algorithmgenetic-algorithm-frameworkgenetic-algorithmsgenetic-optimization-algorithmgeneticalgorithmgeneticsheuristicshypothesisjavalibrarymachine-learningmachine-learning-algorithmsmachine-learning-librarymachinelearningmultithreadingoptimization-algorithmsproblem-solving

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.