Run the HGS-CVRP algorithm
mainOnce the hgs executable is built, you can run it by providing an instance path and a solution path.
Example usage:
./hgs ../Instances/CVRP/X-n157-k13.vrp mySolution.sol -seed 1 -t 30Command Syntax
./hgs instancePath solPath [-it nbIter] [-t myCPUtime] [-bks bksPath] [-seed mySeed] [-veh nbVehicles] [-log verbose]
Primary Options
| Option | Type | Description |
|---|---|---|
-it <int> | integer | Maximum number of iterations without improvement. Defaults to 20,000. |
-t <double> | double | Time limit in seconds. If set, the code runs iteratively until the limit is reached. |
-seed <int> | integer | Fixed seed for reproducibility. Defaults to 0. |
-veh <int> | integer | Prescribed fleet size. Otherwise, a reasonable upper bound is calculated. |
-round <bool> | boolean | Round distance to nearest integer. 1 for rounding (default, recommended for X instances), 0 for no rounding (e.g., CMT or Golden instances). |
-log <bool> | boolean | Verbose level of the algorithm log. 1 for enabled (default), 0 for disabled. |
-bks <path> | path | Path to best known solution (bksPath). |
Additional Parameters
| Option | Type | Description |
|---|---|---|
-nbIterTraces <int> | integer | Iterations between trace displays. Defaults to 500. |
-nbGranular <int> | integer | Granular search parameter (limits moves in RI local search). Defaults to 20. |
-mu <int> | integer | Minimum population size. Defaults to 25. |
-lambda <int> | integer | Generation size (solutions created before reaching max population). Defaults to 40. |
-nbElite <int> | integer | Number of elite individuals. Defaults to 5. |
-nbClose <int> | integer | Number of closest solutions considered for diversity calculation. Defaults to 4. |
-nbIterPenaltyManagement <int> | integer | Iterations between penalty updates. Defaults to 100. |
-targetFeasible <double> | double | Target ratio of feasible individuals between penalty updates. Defaults to 0.2. |
-penaltyIncrease <double> | double | Penalty increase if insufficient feasible individuals. Defaults to 1.2. |
-penaltyDecrease <double> | double | Penalty decrease if sufficient feasible individuals. Defaults to 0.85. |
./hgs ../Instances/CVRP/X-n157-k13.vrp mySolution.sol -seed 1 -t 30