First, 3*x + 2*y = 5 is

**underdetermined**. Choose any x, and there is a y that will satisfy the equation. The genetic algorithm is for optimization. You need to pose this as an optimization problem. So the nearest related problem that the genetic algorithm is suitable for would be a linear regression like:

**a**x +

**b**y =

**c**

where x and y are scalars.

**a**,

**b**and

**c**are vectors of some length n. You suppose that you know n,

**a**,

**b**, and

**c**and seek x and y that minimize the error. This problem has a very well-known solution, the method of least squares. You could use the least-squares solution to check if your genetic algorithm is working.

Second, the genetic algorithm uses a lot of computer power. JavaScript is scripting language, and therefore inefficient. To write efficient code, you need to write in a compiled language.