{"id":49592708,"url":"https://github.com/ceodaniyal/q_learning","last_synced_at":"2026-05-04T01:39:53.185Z","repository":{"id":273236467,"uuid":"919071621","full_name":"ceodaniyal/q_learning","owner":"ceodaniyal","description":"Q-Learning Implementation for Process Optimization A reinforcement learning project that calculates the shortest route between locations using the Q-Learning algorithm. This code demonstrates how AI can optimize processes in a simulated environment with predefined states and rewards. 🚀","archived":false,"fork":false,"pushed_at":"2025-01-19T16:36:53.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-04T01:39:52.054Z","etag":null,"topics":["ai-in-operations","artificial-intelligence","dynamic-programming","machine-learning","markov-decision-process","pathfinding-algorithms","process-optimization","python","q-learning","reinforcement-learning","reward-systems","route-optimization","shortest-path-algorithm","state-transition-models","temporal-difference-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceodaniyal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-19T16:30:43.000Z","updated_at":"2025-01-19T16:40:29.000Z","dependencies_parsed_at":"2025-01-19T17:40:06.216Z","dependency_job_id":"2f9306e6-f1d0-4399-8c45-574867f5bf8b","html_url":"https://github.com/ceodaniyal/q_learning","commit_stats":null,"previous_names":["ceodaniyal/q_learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ceodaniyal/q_learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceodaniyal%2Fq_learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceodaniyal%2Fq_learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceodaniyal%2Fq_learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceodaniyal%2Fq_learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceodaniyal","download_url":"https://codeload.github.com/ceodaniyal/q_learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceodaniyal%2Fq_learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32591603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai-in-operations","artificial-intelligence","dynamic-programming","machine-learning","markov-decision-process","pathfinding-algorithms","process-optimization","python","q-learning","reinforcement-learning","reward-systems","route-optimization","shortest-path-algorithm","state-transition-models","temporal-difference-learning"],"created_at":"2026-05-04T01:39:52.548Z","updated_at":"2026-05-04T01:39:53.177Z","avatar_url":"https://github.com/ceodaniyal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### README for \"Q-Learning Process Optimization\"\n\n---\n\n# Q-Learning Implementation for Process Optimization\n\nThis project demonstrates a Q-Learning implementation to optimize routes between locations in a predefined environment. It uses the principles of reinforcement learning to determine the shortest path between locations while considering rewards for each state transition.\n\n## Features\n- **Environment Definition**: States, actions, and reward matrices define the system's environment.\n- **Reinforcement Learning**: Implements the Q-Learning algorithm to learn and optimize routes.\n- **Shortest Route Calculation**: Calculates the shortest route between a starting location, intermediary location, and ending location.\n\n## Getting Started\n\n### Prerequisites\n- Python 3.x\n- Numpy library (`pip install numpy`)\n\n### Installation\n1. Clone the repository:  \n   ```bash\n   git clone \u003crepository_url\u003e\n   ```\n2. Navigate to the project directory:\n   ```bash\n   cd q-learning-process-optimization\n   ```\n3. Run the script:\n   ```bash\n   python q_learning_optimization.py\n   ```\n\n## Usage\n\n1. Define your starting, intermediary, and ending locations.\n2. Use the `best_route` function to calculate the optimal route:\n   ```python\n   print(best_route('E', 'K', 'G'))\n   ```\n3. Modify the reward matrix (`R`) to represent different environments as needed.\n\n## Example\nTo calculate the optimal route from location `E` to `K` to `G`:\n```python\nprint(best_route('E', 'K', 'G'))\n```\nOutput:\n```\nRoute:\n['E', 'I', 'J', 'K', 'G']\n```\n\n## How It Works\n1. **Q-Learning Algorithm**:  \n   - Randomly explores the environment.\n   - Updates the Q-Table using the Temporal Difference (TD) formula.\n2. **Route Calculation**:  \n   - Starts from the initial state.\n   - Iteratively selects the next state with the highest Q-value until reaching the destination.\n\n## Customization\n- Adjust `gamma` (discount factor) and `alpha` (learning rate) to fine-tune the learning process.\n- Modify the reward matrix (`R`) to represent different environments.\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceodaniyal%2Fq_learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceodaniyal%2Fq_learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceodaniyal%2Fq_learning/lists"}