{"id":30367084,"url":"https://github.com/kazemihabib/multiple-couriers-planning-problem","last_synced_at":"2026-05-19T04:01:51.353Z","repository":{"id":262152253,"uuid":"883246949","full_name":"kazemihabib/Multiple-Couriers-Planning-Problem","owner":"kazemihabib","description":"This project, also known as the Vehicle Routing Problem (VRP), addresses the Multiple Couriers Planning (MCP) problem using Constraint Programming (CP), Satisfiability Modulo Theories (SMT), and Mixed-Integer Linear Programming (MIP) to optimize courier routes efficiently.","archived":false,"fork":false,"pushed_at":"2024-12-18T16:17:13.000Z","size":1549,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T04:41:33.964Z","etag":null,"topics":["cp","mcp","minizinc","mip","pulp","smt","vrp","z3"],"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/kazemihabib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/.keep","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":"2024-11-04T16:20:16.000Z","updated_at":"2025-05-16T06:37:04.000Z","dependencies_parsed_at":"2024-11-26T16:28:58.260Z","dependency_job_id":"2383d4dc-1d55-439e-920d-7cbccc33a5e9","html_url":"https://github.com/kazemihabib/Multiple-Couriers-Planning-Problem","commit_stats":null,"previous_names":["kazemihabib/dummy-project","kazemihabib/vehicle-routing-problem-vrp","kazemihabib/multiple-couriers-planning-problem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kazemihabib/Multiple-Couriers-Planning-Problem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazemihabib%2FMultiple-Couriers-Planning-Problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazemihabib%2FMultiple-Couriers-Planning-Problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazemihabib%2FMultiple-Couriers-Planning-Problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazemihabib%2FMultiple-Couriers-Planning-Problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazemihabib","download_url":"https://codeload.github.com/kazemihabib/Multiple-Couriers-Planning-Problem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazemihabib%2FMultiple-Couriers-Planning-Problem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271236280,"owners_count":24723978,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cp","mcp","minizinc","mip","pulp","smt","vrp","z3"],"created_at":"2025-08-19T23:12:12.077Z","updated_at":"2026-04-30T00:03:25.060Z","avatar_url":"https://github.com/kazemihabib.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Combinatorial Decision Making and Optimization (CDMO) Project\n\nThis project tackles the **Multiple Couriers Planning (MCP) problem**, a complex combinatorial optimization challenge where a set of couriers must deliver items to various locations while minimizing the maximum distance any courier travels. The MCP problem, increasingly relevant in the era of online shopping and rapid delivery expectations, requires that each courier’s load capacity is respected, and routes are planned efficiently from an origin point back to the same point.\n\nThe goal of this project is to model and solve the MCP problem using three approaches:\n1. **Constraint Programming (CP)**\n2. **Satisfiability Modulo Theories (SMT)**\n3. **Mixed-Integer Linear Programming (MIP)**\n\nEach model applies different optimization techniques to allocate items fairly and efficiently to couriers. The project includes experiments to evaluate solver performance across multiple instances.\n\nYou can access the complete project description [here](https://github.com/kazemihabib/DUMMY-PROJECT/blob/master/CDMO_Project-2023-2024.pdf).\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Quick Start Guide (TL;DR)](#quick-start-guide-tldr)\n- [Detailed Setup and Usage](#detailed-setup-and-usage)\n  - [Building Docker Image](#building-docker-image)\n  - [Running Docker Image](#running-docker-image)\n  - [Running Solvers](#running-solvers)\n    - [Running All Solvers](#running-all-solvers)\n    - [Running the SMT Solver](#running-the-smt-solver)\n    - [Running the CP Solver](#running-the-cp-solver)\n    - [Running the MIP Solver](#running-the-mip-solver)\n\n## Prerequisites\n\nBefore you begin, ensure that you have the following installed:\n\n- **Docker**: Install Docker on your host machine. You can download it from [Docker's official website](https://www.docker.com/get-started).\n- **Internet Connection**:  `Gurobi` solver's license requires an internet connection during the usage.\n\n---\n\n## Quick Start Guide (TL;DR)\n\n1. **Open your terminal and navigate to the root of this project**.\n\n2. **Build Docker Image**:  \n\n    ```bash\n    docker build -t cdmo .\n    ```\n\n3. **Run Docker**:\n\n    ```bash\n    docker run -it --rm cdmo\n    ```\n\n    This command will launch the Docker container and open a shell session inside it, allowing you to run commands directly within the container environment.\n\n4. **Run All Solvers**:\n\n    ```bash\n    python multi_solver.py res/\n    ```\n5. **Check correctness of found soloutions**\n    ```bash\n    python check_solution.py instances/instances_dat res/\n    ```\n6. **Access soloutions**\n    ```bash\n    cd /app/res\n    ```\n\nFor more specific instructions on setting up and running individual solvers or using additional options, see [Detailed Setup and Usage](#detailed-setup-and-usage)\n\n## Detailed Setup and Usage\n\n\n\n\n\n### Building Docker Image\n\nTo build the Docker image:\n\n1. Open your preferred terminal.\n2. Navigate to the root of this project.\n3. Run the following command:\n\n   ```bash\n   docker build -t cdmo .\n   ```\n\n   This will create an image named `cdmo`.\n\n### Running Docker Image\n\nTo run the Docker image, execute the following command:\n\n```bash\ndocker run -it --rm cdmo\n```\n\nThis command will run the `cdmo` image and provide a bash shell for running the solvers.\n\n**Optional1**: If you want to access the solution files generated by the solvers from your host machine, mount a directory from your host into the Docker container by adding `-v \u003chost_res_directory\u003e:\u003cdocker_res_directory\u003e` option to the previous command\n\n**Examples**\n\n```bash\ndocker run -it --rm -v $(pwd)/docker_generated_files/res:/app/res cdmo\n\ndocker run -it --rm -v ~/docker_generated_files/res:/app/res cdmo\n```\n\n**Optional2**: If you have new instance files in your host that you want to solve, Again mount the new instances directory from your host into the Docker by adding `-v \u003chost_new_instances_directory\u003e:\u003cdocker_new_input_directory\u003e`\n\n**Examples**\n\n```bash\ndocker run -it --rm -v $(pwd)/new_instances:/app/new_instances cdmo\n\ndocker run -it --rm -v ~/new_instances:/app/new_instances cdmo\n```\n\nYou can use both *Optional1* and *Optional2* together\n\n**Example**\n```bash\ndocker run -it --rm -v $(pwd)/docker_generated_files/res:/app/res -v $(pwd)/new_instances:/app/new_instances cdmo\n```\n\n\nNow, you have a prompt ready to run the solvers.\n\n### Running Solvers\n\n#### Running All Solvers\n\nTo run all solvers:\n\n```bash\npython multi_solver.py \u003coutput_directory\u003e\n```\n\n- `\u003coutput_directory\u003e`: Directory where the solutions will be saved as JSON files.\n\nThis will solve all instances given in the assignment using *CP*, *SMT* and *MIP* and save the results in the output directory.\n\n**Example**:\n\n```bash\npython multi_solver.py res/\n```\n#### Running the SMT Solver\n\nTo run the SMT solver:\n\n```bash\npython SMT/SMT_Z3.py \u003cinput_directory\u003e \u003coutput_directory\u003e \u003csb|nosb|both\u003e\n```\n\nArguments:\n\n- `\u003cinput_directory\u003e`: Directory containing the instance files. The files must be `.dat`.\n- `\u003coutput_directory\u003e`: Directory to save the solutions as JSON files.\n- `\u003csb|nosb|both\u003e`: Symmetry breaking options:\n  - `both`: Run both with and without symmetry breaking.\n  - `sb`: Enable symmetry breaking.\n  - `nosb`: Disable symmetry breaking.\n\n**Examples**\n\nTo run the SMT Solver with symmetry breaking enabled:\n\n```bash\npython SMT/SMT_Z3.py instances/instances_dat res/SMT sb\n```\n\nTo run the SMT Solver without symmetry breaking:\n\n```bash\npython SMT/SMT_Z3.py instances/instances_dat res/SMT nosb \n```\n\nTo run the SMT Solver with and without symmetry breaking:\n\n```bash\npython SMT/SMT_Z3.py instances/instances_dat res/SMT both\n```\n#### Running the CP Solver\n\nTo run the CP solver:\n\n```bash\npython CP/run_cp.py \u003cinput_directory\u003e \u003coutput_directory\u003e\n```\n\nArguments:\n- `\u003cinput_directory\u003e`: Directory containing the instance files, the files must be `.dzn`.\n- `\u003coutput_directory\u003e`: Directory to save the solutions as JSON files.\n\nThe script will run three different minizinc solvers using each \"chuffed\" or \"gecode\". The solvers include:\n- `CP_SYM_LB_RML_HRSTIC`: Uses Symmetry-breaking, Lower-bound constraint, Route Matrix Limiting and non-trivial Heuristics.\n- `CP_SYM_LB`: Uses only Symmetry-breaking and Lower-bound constraint.\n- `CP`: The simplest solver without Symmetry-breaking or LB constraint. \n\n**Example**\n\n```bash\npython CP/run_cp.py instances/instances_dzn res/CP\n```\n\n\n#### Running the MIP solver\n\nTo run the MIP solver:\n\n```bash\npython run.py \u003cinput_directory\u003e \u003coutput_directory\u003e\n```\n\nArguments:\n- `\u003cinput_directory\u003e`: Directory containing the instance files. The files should follow `inst{num_instances:02}.dat` naming. convention\n- `\u003coutput_directory\u003e`: Directory to save the solutions as JSON files.\n\nSolvers:\nThe script supports multiple solvers, including:\n\n- `CBC` : Default solver provided by PuLP.\n- `HiGHS` : High-performance solver for linear programming.\n- `Gurobi` : A powerful commercial solver for linear and mixed-integer programming.\n\n**Example**\n\n```bash\npython MIP/run.py instances/instances_dat res/MIP\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazemihabib%2Fmultiple-couriers-planning-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazemihabib%2Fmultiple-couriers-planning-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazemihabib%2Fmultiple-couriers-planning-problem/lists"}