{"id":24864912,"url":"https://github.com/iamrajhans/mcts","last_synced_at":"2025-03-26T18:43:39.122Z","repository":{"id":272262147,"uuid":"916004593","full_name":"iamrajhans/mcts","owner":"iamrajhans","description":"monte carlo tree search implementation in python","archived":false,"fork":false,"pushed_at":"2025-01-13T09:31:09.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T23:56:21.046Z","etag":null,"topics":["google-maps","monte-carlo-tree-search","route-optimization"],"latest_commit_sha":null,"homepage":"","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/iamrajhans.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}},"created_at":"2025-01-13T09:20:10.000Z","updated_at":"2025-01-13T09:33:23.000Z","dependencies_parsed_at":"2025-01-13T10:35:09.016Z","dependency_job_id":"93583a6a-2b9f-4267-9641-2efcb691849a","html_url":"https://github.com/iamrajhans/mcts","commit_stats":null,"previous_names":["iamrajhans/mcts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajhans%2Fmcts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajhans%2Fmcts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajhans%2Fmcts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajhans%2Fmcts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamrajhans","download_url":"https://codeload.github.com/iamrajhans/mcts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245717608,"owners_count":20661143,"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":["google-maps","monte-carlo-tree-search","route-optimization"],"created_at":"2025-01-31T23:56:30.987Z","updated_at":"2025-03-26T18:43:39.082Z","avatar_url":"https://github.com/iamrajhans.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logistics Route Optimization with Monte Carlo Tree Search\n\nThis project demonstrates how to optimize a delivery route using the **Monte Carlo Tree Search (MCTS)** algorithm, integrated with the **Google Maps API** for real-world distance calculations. The goal is to minimize delivery costs and time by finding the most efficient route.\n\n---\n\n## Features\n\n- Utilizes **Monte Carlo Tree Search** for route optimization.\n- Integrates **Google Maps API** for accurate distance and route calculations.\n- Scalable to multiple destinations.\n- Provides an optimal delivery route based on simulations and backpropagation.\n\n---\n\n## Prerequisites\n\n### 1. Python Installation\nEnsure you have Python 3.7 or higher installed. You can download it from [python.org](https://www.python.org/).\n\n### 2. Required Libraries\nInstall the required Python libraries using pip:\n```bash\npip install -r requirements.txt\n```\n\n### 3. Google Maps API Key\n- Obtain a Google Maps API key from the [Google Cloud Console](https://console.cloud.google.com/).\n- Enable the **Directions API** for your project.\n- Replace the placeholder `YOUR_GOOGLE_MAPS_API_KEY` in the code with your actual API key.\n\n---\n\n## How to Run\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/iamrajhans/mcts.git\ncd mcts\n```\n\n### 2. Configure the API Key\nOpen the script file and update the following line with your Google Maps API key:\n```python\ngmaps = googlemaps.Client(key=\"GOOGLE_MAPS_API_KEY\")\n```\n\n### 3. Run the Script\nExecute the Python script:\n```bash\npython mcts.py\n```\n\n---\n\n## Example\n\n### Input:\n- Starting Location: **Bangalore**\n- Delivery Destinations:\n  - Kempegowda International Airport Bengaluru,\n  - Cubbon Park, Bangalore\n\n### Output:\n```\nOptimal Route: Kempegowda International Airport Bengaluru -\u003e Cubbon Park, Bangalore\n```\n\n---\n\n## Project Structure\n\n```\nlogistics-route-optimization/\n├── mcts.py                # Main Python script for MCTS and route optimization\n├── README.md              # Documentation file\n└── requirements.txt       # List of required Python libraries\n```\n\n---\n\n## Concepts Used\n\n### 1. Monte Carlo Tree Search (MCTS)\nMCTS is a heuristic search algorithm that balances exploration and exploitation to optimize decision-making. It iteratively builds a decision tree by simulating possible outcomes and refining the tree.\n\n### 2. Google Maps API\nThe Google Maps API is used to calculate distances between locations, providing real-world accuracy for route optimization.\n\n---\n\n## Limitations\n\n- **API Quota**: The script is limited by the free tier quota of the Google Maps API.\n- **Scalability**: Computational complexity increases with the number of destinations.\n\n---\n\n## Future Improvements\n\n- Include **live traffic data** for real-time optimization.\n- Allow dynamic updates (e.g., new destinations during route execution).\n- Visualize the optimal route on a map.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrajhans%2Fmcts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamrajhans%2Fmcts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrajhans%2Fmcts/lists"}