This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
# Routing and appointment scheduling | ||
|
||
This repository contains the code implementation of our paper "A queueing-based approach for integrated routing and appointment scheduling." | ||
This repository contains the code implementation of our paper [*A queueing-based approach for integrated routing and appointment scheduling*](preprint.pdf). | ||
|
||
TODO | ||
## Installation | ||
|
||
To use this repository, make sure to have [Poetry](https://python-poetry.org/) installed with version 1.2 or higher. The following command will then create a virtual environment with all necessary dependencies: | ||
|
||
```shell | ||
poetry install | ||
``` | ||
|
||
If you don't want to use Poetry, you can use install all packages listed in the `pyproject.toml` file (requires Python 3.9 or higher). | ||
|
||
|
||
## Usage | ||
|
||
You can use the `benchmark.py` script to solve instances. Here's an example: | ||
|
||
``` shell | ||
poetry run python benchmark.py instances/*.json \ | ||
--num_procs 4 \ | ||
--weight_travel 1 \ | ||
--weight_idle 2.5 \ | ||
--weight_wait 10 \ | ||
--algorithm lns \ | ||
--seed 1 \ | ||
--max_runtime 1 | ||
``` | ||
|
||
This command solves all instances, four in parallel at a time. The objective weights are 1, 2.5 and 10 for the travel, idle and waiting time contributions, respectively. The selected algorithm is LNS with seed 1 and runs for one second. | ||
|
||
All results presented in our paper can be found in this repository. In particular, the raw results data is stored in `data/` and the notebooks that generate tables and figures can be found in `notebooks/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from ast import literal_eval as make_tuple | ||
from pathlib import Path | ||
from typing import Union | ||
|
||
import pandas as pd | ||
|
||
|
||
def read_single_instance_benchmark_output(path: Union[str, Path]) -> pd.DataFrame: | ||
with open(path, "r") as fh: | ||
line = fh.read() | ||
|
||
print(line) | ||
row = list(make_tuple(line.strip())) | ||
|
||
# Parse the instance name to identify the instance characteristics | ||
values = [s.strip("nidxdistributiontravelserv") for s in row[0].split("-")] | ||
data = values + row[1:] | ||
|
||
headers = [ | ||
"n", | ||
"idx", | ||
"distribution", | ||
"travel", | ||
"serv", | ||
"obj", | ||
"iters", | ||
"time", | ||
"alg", | ||
"cost_profile", | ||
] | ||
dtypes = [int, int, int, int, int, float, float, float, str, str] | ||
return pd.DataFrame([data], columns=headers).astype(dict(zip(headers, dtypes))) |
Binary file not shown.