# 𧬠Genetic Algorithm Solver
A web-based tool built with **Streamlit** that uses Genetic Algorithms to solve linear equations of the form:
`ax + by + cz + ... = Target`
## π Live Demo
[Insert your Streamlit URL here]
## β¨ Features
* **Custom Coefficients**: Input any number of variables.
* **Real-time Evolution**: Watch the population evolve through a progress bar and live fitness chart.
* **Adjustable Parameters**: Fine-tune Population Size, Mutation Rate, and Max Generations.
* **Interactive Visualization**: Line charts showing Best vs. Average fitness convergence.
## π οΈ Installation & Local Setup
1. Clone the repository:
```bash
git clone [https://github.com/YOUR_USERNAME/Genetics-Algorithm-Solver.git](https://github.com/salamlakhan7/Genetics-Algorithm-Solver.git)
- Install dependencies:
pip install -r requirements.txt
- Run the app:
- Initial Population: Generates random integer candidates.
- Fitness Function: Calculates the absolute difference (error) between the current sum and the target.
- Selection: Keeps the top 50% of the best-performing candidates.
- Crossover: Combines attributes of parents to create children.
- Mutation: Randomly tweaks values to maintain genetic diversity and avoid local optima.
---
### π Final Sync to GitHub
After saving the file, run these commands in your VS Code terminal to update your repository:
1. **Stage the new file**: `git add README.md`
2. **Commit the update**: `git commit -m "Added README documentation"`
3. **Push to GitHub**: `git push`
### π‘ Pro Tip for Streamlit
Once you push this, go to your **Streamlit Cloud** dashboard. You will see it automatically re-deploying because it detected the change in your GitHub repo.
**Your project is now fully documented! Would you like me to show you how to add a "Math Mode" toggle to the UI so you can switch between linear and quadratic equations?**