Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/they4kman/experimentation/machine-learning/genetic-algorithms

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/they4kman/experimentation/machine-learning/genetic-algorithms

  • v0.0.0-20210726075050-35895dc4d375
  • Source
  • Go
  • Socket score

Version published
Created
Source

Genetic Arithmetic Expression Solver

Execute python genetic_expr_ui.py to get a graphical interface.

Description: a number is randomly chosen, and the aim of the program is to drum up a simple arithmetic equation using only addition, subtraction, multiplication, and division of a number of components less than 10. For instance, for the number 184, a solution might be 6*7*4+1-5+8+7+5.

To find its solutions, the program begins with a population of 30 "chromosomes", each consisting of 30 "genes" representing digits or operators. At each step, two chromosomes are chosen at random-ish. We roll a die to see if we should crossover them, which is to swap their bits around a random bit

The program defines a simple language with characters defined as 4-bit nibbles:

IndexBinaryCharacter
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010+
111011-
121100*
131101/
141110Invalid
151111Invalid

These are called genes. A chromosome is a list of genes. In the demonstration, we use chromosomes with 30 genes.

TODO

FAQs

Package last updated on 26 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc