Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

87 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LcVRPContest

Description

The LcVRPContest project is a C++ implementation of a local search optimization algorithm for the loading-constrained vehicle routing problem (LCVRP). The program loads an instance from the data/lcvrp directory, runs optimization, and prints the final solution fitness.

Requirements

  • Windows
  • Visual Studio with C++ support (e.g. Visual Studio 2019 / 2022)
  • Or MSBuild available from the Developer Command Prompt

Building

Visual Studio

  1. Open the solution file LcVRPContest.sln in Visual Studio.
  2. Choose Debug or Release configuration.
  3. Build the solution (Build > Build Solution).

Command Line (MSBuild)

  1. Open Developer Command Prompt for VS.
  2. Navigate to the repository root, for example:
    cd <path-to-repo>\LcVRPContest
  3. Build the project:
    msbuild LcVRPContest.sln /p:Configuration=Release

Running

The default program configuration in LcVRPContest.cpp runs the instance:

  • data folder: Vrp-Set-D
  • instance: ORTEC-n323-k21
  • iterations: 10
  • random permutation: enabled

Visual Studio

  1. After building the project, run it in Visual Studio (Debug > Start Debugging or Debug > Start Without Debugging).

Command Line

  1. From the repository root, run the executable with optional arguments:

    .\x64\Release\LcVRPContest.exe [folder_name] [instance_name] [max_iterations] [use_random_permutation]
  2. Or run directly from the build output folder:

    cd .\x64\Release
    .\LcVRPContest.exe [folder_name] [instance_name] [max_iterations] [use_random_permutation]

The program automatically searches parent directories for the data/lcvrp folder, so it works from both the repo root and the build folder.

Examples

  • Default settings:
    .\LcVRPContest.exe
  • Specify folder and instance:
    .\LcVRPContest.exe Vrp-Set-A A-n32-k5
  • Specify iterations and disable random permutation:
    .\LcVRPContest.exe Vrp-Set-A A-n32-k5 50 0

Changing the instance

To use a different instance or dataset, edit the StartOptimization call in LcVRPContest.cpp. The first parameter is the folder name under data/lcvrp, and the second parameter is the instance file name without the .lcvrp extension.

Example:

StartOptimization("Vrp-Set-A", "A-n32-k5", max_iterations, use_random_permutation);

Data structure

Input files are located under:

  • data/lcvrp/Vrp-Set-A
  • data/lcvrp/Vrp-Set-B
  • data/lcvrp/Vrp-Set-CMT
  • data/lcvrp/Vrp-Set-D
  • ...

Note

The program accepts optional command-line arguments for folder, instance, iteration count, and random permutation. It also searches parent directories for the data/lcvrp folder, so you can run the executable from the build folder or from the repository root.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages