Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.98 KB

File metadata and controls

65 lines (41 loc) · 1.98 KB
# 🧬 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)
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the app:
streamlit run GA_app.py

🧬 How it Works

  1. Initial Population: Generates random integer candidates.
  2. Fitness Function: Calculates the absolute difference (error) between the current sum and the target.
  3. Selection: Keeps the top 50% of the best-performing candidates.
  4. Crossover: Combines attributes of parents to create children.
  5. 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?**