Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Latest commit

 

History

History
23 lines (17 loc) · 862 Bytes

File metadata and controls

23 lines (17 loc) · 862 Bytes

Traveling salesman

A variant of the traveling salesman problem (visiting every city in a country only once, starting and ending in the same city, and moving between cities using the existing connections) where, in addition, we want to find out the length of the Hamiltonian cycle.

Solutions for this problem using CLP(FD) and ASP appear in (Dovier et al. 2005), with comparable performance. However, they show that the ASP encoding is more compact, even if the CLP(FD) version uses the library predicate circuit/1, which does the bulk of the work and whose code is non-trivial.

We will show that also in this problem, where the ASP solution is more compact than that of CLP(FD), s(CASP) is more expressive.

s(CASP) implementation

scasp hamiltonian_scasp.pl