Genetic Algorithm Maximizer - a web app that evolves a population to find the maximum of a quadratic polynomial
| Layer | Technology |
|---|---|
| Backend | Haskell, Servant, Warp |
| Frontend | Vite, Plotly.js |
| Container | Docker, docker-compose |
docker-compose up --build- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
Backend requires GHC 9.6 and cabal:
cd backend
cabal run backendFrontend requires Node 20+:
cd frontend
npm install
npm run devFrontend dev server: http://localhost:5173
API calls are automatically proxied to localhost:8080 via Vite.
| Endpoint | Method | Description |
|---|---|---|
/api/init_config |
POST | Create a GA config from parameters |
/api/init_population |
POST | Generate the initial random population |
/api/next_generation |
POST | Step one generation forward |
- Set the polynomial coefficients a, b, c and the search domain [x min, x max]
- Configure population size, generations, crossover/mutation probabilities, and a random seed
- Click Initialize: the parabola and initial population appear on the chart
- Step through generations with Next Generation, or skip to the end with Fast Forward
- Open the Evolution panel to see fitness converge over generations