🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

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

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
98

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Uses eval

Supply chain risk

Package uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Found 1 instance in 1 package

Dependencies have 2 high alerts.

High CVE

Version published
Created

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