/tup-solver

TUP instance parser that generates logic programming code for Clingo

Primary LanguagePython

Traveling Umpire Problem Solver

Overview


This program is based on the paper Solving the Travelling Umpire Problem with Answer Set Programming . The goal is to solve instances of traveling umpire problem (TUP), the definition of TUP can be viewed here . This program uses a Python script to generate source code files in Clingo language which are used together with the Clingo solver to find optimal solutions for the instances of TUP.

Dependencies


  • Python version 3.8.3
  • Clingo - easiest way to install is conda install -c potassco clingo, otherwise see release

Running the Project


  1. Download TUP instance files and add them to the /instances directory
  2. (Optional) Compile your own program in Clingo language
  3. Open Anaconda Prompt
  4. (Optional) Change configuration of experiments in run.py
  5. Run python run.py [-h] [-t [TIME_OUT]] [-n [NUM_PROC]] [--src [SRC]] [--inst [INST]] script
  6. View results in the /out directory

Optional command line arguments for the TUP solver:

  • -h, --help       Show the help message and exit
  • -t [TIME_OUT], --time-out [TIME_OUT]       Time out for the Clingo solver specified in seconds, default=300
  • -n [NUM_PROC], --num-proc [NUM_PROC]       Number of parallel processes of the Clingo solver, default=1
  • --src [SRC]       Path to the directory that will contain generated '.lp' source files in Clingo language, default='src_asp'
  • --inst [INST]       Path to the directory containing TUP instancesdefault='instances'

If you want to run individual ASP programs with your own parameters you can use Clingo directly: clingo [SRC] --opt-mode=optN --time-limit=[T] --parallel-mode=[NUM_PROC],[MODE] -q

If you want to view the models that are computed, don't run Clingo with the paremeter -q. Be midful that the sheer volume of output is rather confusing. If you only want to view the setting of specific atoms you need to modify the ASP program with #show A/n directive, whereA is the name of the atom and n is its arity.