Skip to content

salamlakhan7/Genetics-Algorithm-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# 🧬 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?**

About

A high-performance optimization engine designed to solve complex combinatorial problems. This solver implements custom selection, crossover, and mutation strategies to evolve optimal solutions for tasks like scheduling, resource allocation, and pathfinding.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages