genetic-algorithmpolynomial-mathequation-solvinggenetic-programminggenetics

Genetic programming for symbolic equation solving


I'm trying to perform a genetic programming system which solves an equation (basically first and second degree polynom equations) symboliclly.

It means that for a*x+b=0 it must give me a tree representation of -b/a. What i mean by symbolically is that i'm not giving numbers for 'a' and 'b' ... basically what Generic Programming are made for.

I'm actually stuck in finding the fitness function. For a given gene (potential solution), how can i predict how far is this one from the right solution.

My doubt is that there's no way to do such a thing unless i convert the problem into a numerical one.

I've been searching in the net, but all i found was related to genetic algorithms and so numerical resolution for such problem.

a link exposing such topic is found here: Generic Programming but it's not explaining a detailed approach about the problem.

Any ideas ?

Thanks in advance.


Solution

  • I've finally found a solution.

    I've found a powerfull library which is designed for Genetic Algorithms for java developpers, and have a module specialized in Genetic Programming (GP).

    Library's link: Jenetics

    My implementation of the solution is available on my github at this link: Symbolic Equation Solver

    It's basically a Maven based project, which makes use of Java 11 and the above library to solve Linear and Quadratic equations and gives symbolic (and not numeric) result.