{"id":29253486,"url":"https://github.com/anishsarkar22/nbga-optimization","last_synced_at":"2026-01-20T16:28:09.552Z","repository":{"id":302063504,"uuid":"1011121466","full_name":"AnishSarkar22/nbga-optimization","owner":"AnishSarkar22","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-30T10:42:59.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-30T11:45:39.394Z","etag":null,"topics":["genetic-algorithm","python3","streamlit"],"latest_commit_sha":null,"homepage":"https://nbga-optimization.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnishSarkar22.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-30T10:33:48.000Z","updated_at":"2025-06-30T10:43:02.000Z","dependencies_parsed_at":"2025-06-30T11:45:41.153Z","dependency_job_id":"3162e518-4e6f-4340-84bb-7493058f37d3","html_url":"https://github.com/AnishSarkar22/nbga-optimization","commit_stats":null,"previous_names":["anishsarkar22/nbga-optimization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AnishSarkar22/nbga-optimization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishSarkar22%2Fnbga-optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishSarkar22%2Fnbga-optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishSarkar22%2Fnbga-optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishSarkar22%2Fnbga-optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnishSarkar22","download_url":"https://codeload.github.com/AnishSarkar22/nbga-optimization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishSarkar22%2Fnbga-optimization/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263432279,"owners_count":23465575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetic-algorithm","python3","streamlit"],"created_at":"2025-07-04T02:02:47.140Z","updated_at":"2026-01-20T16:28:09.540Z","avatar_url":"https://github.com/AnishSarkar22.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NBGA Optimization\n\nThis project implements a **Neighborhood-Based Genetic Algorithm (NBGA)** for ligand optimization, inspired by the approach described in [An Evolutionary Approach to Drug-Design Using a Novel Neighbourhood Based Genetic Algorithm](https://arxiv.org/abs/1205.6412) research paper. The algorithm evolves ligand structures to minimize their interaction energy with a protein's active site, using a tree-based representation for ligands and a dynamic neighborhood topology for genetic operations.\n\n## Features\n\n- **NBGA implementation** for ligand-protein binding optimization.\n- **TSP Algorithm Comparison**: Compare NBGA, SWAP_GATSP, OX_SIM, and MOC_SIM on classic TSPLIB datasets with interactive plots and tables.\n- See [algorithm documentation and comparisons](algorithms/README.md) for details on TSP implementations and improvements.\n- Ligand structure represented as a variable-length tree of functional groups.\n- Interaction energy calculated using a modified Lennard-Jones potential.\n- Streamlit integration for interactive parameter tuning and visualization.\n- Reproducible results with fixed random seed.\n\n## Algorithm Overview\n\n- **Ligand Representation:** Each ligand is a chromosome (list) where each gene represents a functional group or an empty position.\n- **Fitness Evaluation:** The interaction energy between the ligand and protein residues is minimized. Empty or mostly empty ligands are penalized.\n- **Genetic Operators:** Single-point crossover, uniform random mutation, and trio tournament selection.\n- **Neighborhood Topology:** Individuals are arranged in a ring, and neighborhoods are randomized each generation to maintain diversity.\n- **Visualization:** The evolution of the best fitness (energy) is plotted and can be smoothed for trend analysis.\n\nFor more details, see the [original paper](https://arxiv.org/abs/1205.6412).\n\n## Getting Started\n\n\u003e **Dependency management:**  \n\u003e All dependencies are managed using `pyproject.toml` and locked in `poetry.lock`.\n\u003e It is recommended to use [Poetry](https://python-poetry.org/) to manage dependencies and the virtual environment\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/AnishSarkar22/nbga-optimization.git\ncd NBGA-TSP\n```\n\n### 2. Set Up the Environment with Poetry\n\n```bash\n# Install Poetry if you don't have it\npip install poetry\n\n# Install dependencies and create a virtual environment\npoetry install\n\n# Activate the virtual environment\npoetry shell\n```\n\n### 3. Run the Streamlit App\n\n```bash\nstreamlit run Home.py\n```\n\nThis will launch a web interface where you can adjust algorithm parameters and visualize the optimization process.\n\n## Usage\n\n- **NBGA Ligand Optimization**: Adjust parameters and run the genetic algorithm to optimize ligand binding.\n- **TSP Algorithm Comparison**: Select the TSP Comparison from the sidebar, choose your dataset directory, and run the comparison to visualize and compare algorithm performance.\n- View the best ligand found and its interaction energy.\n- Analyze the energy evolution plot for convergence trends.\n\n## File Structure\n\n- `Home.py` — Main NBGA implementation and Streamlit interface.\n- `pages/1_Ligand_Optimization.py` — Script for Ligand Optimization.\n- `pages/2_TSP_Comparison.py` — Script for TSP algorithm Comparison.\n- `algorithms/ligand.ipynb` — NBGA algorithm and utilities for ligand optimization.\n- `algorithms/tsp.ipynb` — NBGA and other algorithms for TSP (original version).\n- `algorithms/tsp_enhanced.ipynb` — Enhanced NBGA and TSP algorithms.\n- `algorithms/README.md` — [Comparison and documentation of algorithms](algorithms/README.md).\n- `evaluation_dataset/` — Reference optimal TSP datasets and extraction scripts.\n- `tsp_dataset/` — TSP datasets and extraction scripts.\n- Other scripts and data files as needed.\n\n## Reference\n\nIf you use this code or approach in your research, please cite:\n\n\u003e Arnab Ghosh, Avishek Ghosh, Arkabandhu Chowdhury, Amit Konar.  \n\u003e \"An Evolutionary Approach to Drug-Design Using a Novel Neighbourhood Based Genetic Algorithm.\"  \n\u003e [arXiv:1205.6412](https://arxiv.org/abs/1205.6412)\n\nThis repository provides an implementation based on the above paper, with additional improvements and extensions.\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE). See the original paper for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishsarkar22%2Fnbga-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanishsarkar22%2Fnbga-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishsarkar22%2Fnbga-optimization/lists"}