<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>ASPOCP</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Geometric reasoning on the Traveling Salesperson Problem: comparing Answer Set Program ming and Constraint Logic Program ming Approaches</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessandro Bertagnon</string-name>
          <email>alessandro.bertagnon@unife.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Gavanelli</string-name>
          <email>marco.gavanelli@unife.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Answer Set Programming, Euclidean Traveling Salesperson Problem, Experimental Comparison of ASP</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Engineering, University of Ferrara</institution>
          ,
          <addr-line>Via Saragat 1, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Environmental and Prevention Sciences, University of Ferrara, C.so Ercole I D'Este</institution>
          ,
          <addr-line>32, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>16</volume>
      <fpage>09</fpage>
      <lpage>10</lpage>
      <abstract>
        <p>The Traveling Salesperson Problem (TSP) is one of the best-known problems in computer science. Many instances and real world applications fall into the Euclidean TSP special case, in which each node is identified by its coordinates on the plane and the Euclidean distance is used as cost function. It is worth noting that in the Euclidean TSP more information is available than in the general case; in a previous publication, the use of geometric information has been exploited to speedup TSP solving for Constraint Logic Programming (CLP) solvers.</p>
      </abstract>
      <kwd-group>
        <kwd>Approaches</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>UK
in Constraint Logic Programming (CLP) solvers. The work started from the observation that,
due to the triangular inequality, in a Euclidean TSPs two edges cannot cross each other, since
eliminating the crossing would result in another cycle of shorter length. This observation was
then extended and exploited in the development of eficient algorithms that reduce the search
space.</p>
      <p>
        Beside CLP, Answer Set Programming (ASP) is another logic programming paradigm that due
to the expressiveness of the language and the availability of eficient solving systems [
        <xref ref-type="bibr" rid="ref3 ref4 ref5 ref6">3, 4, 5, 6</xref>
        ]
is used in advanced applications.
      </p>
      <p>In this paper we study the applicability of geometric reasoning to the Euclidean TSP in the
context of ASP. We propose an encoding of Euclidean TSP as ASP program with the reasoning
based on geometric properties. We compare how solving time is afected when diferent types
of geometric information are exploited in the encoding.</p>
      <p>Finally, we compare the speedup of the additional filtering based on geometric information
on an ASP solver and a CLP on Finite Domain (CLP(FD)) solver.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>
        An ASP program consists of a set of clauses interpreted in the Stable Model semantics [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
Each clause in an implication  ←  . The full ASP syntax is reported in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The head  of
the clause can be an atom of the form a(t1, … , tn) (where t1, … tn are terms), a choice atom
{a(t1, … , tn)} or an aggregate atom. The body  is a set of literals of the form of the form
either a or not a where again a can be an atom or an aggregate atom. An aggregate atom
can be { t1, … , tm ∶ c1, … , cm} ∘ n where  can be #sum, #min, #max or #count, and ∘ can be a
relational operator.
      </p>
      <p>Clauses with empty body are called facts, while clauses with empty head are called Integrity
Constraints (ICs), and their body must evaluate to false in all stable models.</p>
      <p>Since each node in a graph of a Euclidean TSP is associated with a point in a plane, in the
rest of the paper we will often use the terms “point” and “node” indistinctly.
3. Filtering techniques for the Euclidean TSP
As stated in previous sections, Euclidean TSP instances include the coordinates on the plane
of the points; such coordinates in ASP can be represented by facts point(I,X,Y) where I is a
numerical identifier of the point and X,Y are its coordinates in the Euclidean plane. Instances
also include cost(A,B,C) facts where C is the Euclidean distance between points A and B. A
cycle on the graph, so a solution, will be represented by a set of cycle(A,B) atoms.</p>
      <p>The basic Euclidean TSP encoding in ASP is presented in Listing 1. This encoding includes
the degree constraint that ensures that, in the solution, the degree of each node is equal to two.
Line 1 ensures that each point has exactly one outgoing edge while line 2 ensures that each
point has exactly one incoming edge. Lines 3–5 state that starting from the point with smallest
I all other points can be reached through the cycle; this ensures that all points are visited. Line
6 is the objective function; we want to minimize the cost of the cycle.</p>
      <p>Pi</p>
      <p>b
Pb l</p>
      <p>Pk
b</p>
      <p>Pb j
1 1 { cycle(A,B) : cost(A,B,_) } 1 :- point(A,_,_).
2 1 { cycle(A,B) : cost(A,B,_) } 1 :- point(B,_,_).
3 reached(A) :- A = #min{ I : point(I,_,_) }.</p>
      <sec id="sec-2-1">
        <title>4 reached(B) :- cycle(A,B), reached(B).</title>
        <p>5 :- point(B,_,_), not reached(B).</p>
      </sec>
      <sec id="sec-2-2">
        <title>6 #minimize{ C,A,B : cycle(A,B), cost(A,B,C) }.</title>
        <sec id="sec-2-2-1">
          <title>Listing 1: Euclidean TSP encoding in ASP</title>
          <p>3.1. Avoiding intersections
The following is a well-known result in the literature.</p>
          <p>
            Theorem 1. (Flood [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ]). The optimal solution of a metric TSP in the plane cannot include two
edges that cross each other.
          </p>
          <p>Intuitively, in Figure 1 instead of taking segments     and     , a shorter tour chooses the
dotted edges     and     .</p>
          <p>The Euclidean TSP is a special case of the metric TSP since the Euclidean distance satisfies
the triangular inequality; from Theorem 1, one can avoid, during the search for an optimal
Euclidean TSP, those paths that include crossing edges.</p>
          <p>
            Avoiding crossings is particularly simple and declarative in ASP; in Listing 2, line 1 imposes
that a pair of segments in the TSP should not cross each other (except, possibly, in one endpoint).
The cross(A,B,C,D) predicate declaratively states that segment  and segment  cross
each other. To verify the intersection of two segments given their endpoints, we implemented
the Faster Line Segment Intersection algorithm proposed by F.Antonio [
            <xref ref-type="bibr" rid="ref10">10</xref>
            ]. The idea of this
algorithm is to represent each point as a 2D vector (A = (  ,   )). Now a generic point P on 
can be represented parametrically by a linear combination of A and B as follows:
          </p>
          <p>
            P =  A + (1 − ) B
where  is in the interval [
            <xref ref-type="bibr" rid="ref1">0, 1</xref>
            ] when representing a point on the segment  . Finding the
crossing point Q of two segments  and  reduces to solving the following system of
{
Q = A + ( B − A)
          </p>
          <p>
            Q = C + ( D − C)
However, we are not interested in explicitly calculating the intersection point, so we do not
need  and  explicitly, it is suficient to verify that  and  are in the range [
            <xref ref-type="bibr" rid="ref1">0, 1</xref>
            ] (see lines 2–18).
1 :- cycle(A,B), cycle(C,D), cross(A,B,C,D).
          </p>
          <p>
            It is interesting to notice that currently available intelligent grounders (such as gringo [
            <xref ref-type="bibr" rid="ref11">11</xref>
            ])
are able to compile the cross/4 predicate in Listing 2 into a series of facts, and the integrity
constraint in line 1 is grounded into a series of denials that forbid the pairs of edges that intersect.
In their turn, these denials help the solver reducing the search space without adding new choices
to the code.
3.2. Reasoning on the convex hull
A useful consequence of Theorem 1 is based on the concept of convex hull and is given in
Corollary 1. The convex hull of a set of points  in a Euclidean space is the minimum convex set
containing all the points. In the plane it corresponds to a convex polygon, and it is completely
defined by its vertices. We denote with  () the sequence of nodes on the boundary of the
convex hull.
          </p>
          <p>
            Corollary 1. (Deineko, van Dal, and Rote [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ]). Assuming that not all nodes of the graph lie on
the same line, nodes on the boundary of the convex hull are always visited in their cyclic order in
an optimal TSP.
          </p>
          <p>Corollary 1 can be exploited in several ways to reduce the search space; the main idea is to
define an order of visit (either clockwise or counterclockwise) of the tour, and impose that in
all points belonging to the border of the convex hull such order is preserved. In a sense this
type of pruning can be thought as a symmetry breaking constraint, and in the experimental
evaluation it will be compared with another symmetry breaking technique that imposes one
order of visit of the tour.</p>
          <p>The points on the boundary of the convex hull will be identified by means of the
hull(X) predicate. The counterclockwise visiting order of the hull will be encoded through
convex_hull_next(A,B) facts, which state that point B follows point A on the boundary of the
convex hull.</p>
          <p>
            In [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ] we devised three ways to exploit the information about the hull for propagation. In the
following we report them together with the corresponding ASP encoding. The first constraint,
implemented in Listing 3, impose that the successor of a convex hull vertex cannot be another
vertex member of  () except for the one that immediately follows it.
          </p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>1 :- not convex_hull_next(X,Y), cycle(X,Y), hull(X), hull(Y).</title>
        <p>Listing 3: The successor of a convex hull vertex cannot be another vertex on the boundary of
the convex hull except for the one that immediately follows it.</p>
        <p>This integrity constraint imposes that edges connecting far away nodes in the border of the
convex hull cannot be taken, and are immediately propagated by the unit propagation of the
solver with no need of search.</p>
        <p>The second way is reasoning on the angle formed by the incoming and the outgoing arcs
in hull vertexes: in order to visit nodes in a counterclockwise order, the angle between the
incoming edge and the outgoing edge of   cannot be negative (it must be between 0 and  ) or,
stated otherwise, it must correspond to a left turn.</p>
      </sec>
      <sec id="sec-2-4">
        <title>2 :- hull(X), cycle(From,X), cycle(X,To), turn_right(From,X,To).</title>
      </sec>
      <sec id="sec-2-5">
        <title>3 turn_right(From,P,To):</title>
      </sec>
      <sec id="sec-2-6">
        <title>4 point(From,X,Y), point(P,X0,Y0), point(To,X1,Y1), 5 (Y-Y0)*(X1-X0) - (X-X0)*(Y1-Y0) &lt; 0.</title>
        <p>Listing 4: In order to visit nodes in a counterclockwise order, the angle between the incoming
edge and the outgoing edge of a convex hull vertex cannot be negative.</p>
        <p>The third way results from stating that any path starting from a convex hull vertex cannot
reach any other convex hull vertex except the one that directly follows it. Put it more precisely,
each vertex in a path originating from a point   cannot reach any vertex in  () except for
 (+1 mod | ()|) .</p>
      </sec>
      <sec id="sec-2-7">
        <title>6 path_hull(A,B):- hull(A), cycle(A,B), not hull(B).</title>
      </sec>
      <sec id="sec-2-8">
        <title>7 path_hull(A,C):- hull(A), path_hull(A,B), cycle(B,C), not hull(C).</title>
      </sec>
      <sec id="sec-2-9">
        <title>8 :- path_hull(A,B), cycle(B,C), hull(C), not convex_hull_next(A,C).</title>
        <p>Listing 5: Each path originating from a convex hull vertex cannot reach any convex hull vertex
except for the one immediately following it.</p>
        <p>Predicate path_hull(A,B) is true if from a vertex A on the border of the convex hull there
is a path connecting it to an internal vertex B (i.e., a vertex that is not on the boundary of the
convex hull) passing only through internal vertexes. The integrity constraint in line 8 imposes
that such path cannot terminate in any vertex on the border of the convex hull, except the
immediate successor of vertex A.
3.2.1. Computing the convex hull
Several algorithms exist to compute the border of the convex hull of a set of vertices, however
we preferred to compute it with a declarative program directly in ASP. We can declaratively
state that a vertex is on the border of the convex hull if it is not internal to any triangle having
as vertexes any three nodes of the graph (line 1 in Listing 6). In order to check if a point P
is internal to some triangle (predicate inside in Listing 6), it is enough to check if it stands
always on the same side with respect to the line segments on the sides of the triangle; on its
turn, this can be easily defined leveraging on the previously defined predicate turn_right.</p>
        <p>This approach computes the set of vertices on the border of the hull in ( 4), if  is the number
of vertexes; this is much higher than other available algorithms (e.g., Andrew’s monotone chain
has ( log ) complexity), but it is worth noting that all the computation can be performed
by the grounder, and indeed gringo provides a ground set of facts so that during the search
for an answer set it is not necessary to compute  () . In future work we will explore other
algorithms to compute the convex hull.</p>
        <p>Once the points belonging to the boundary of the hull have been found, it is necessary to
ifnd what is their cyclic order. Given two points  and  on the boundary of the convex hull,
point  is successor to point  , chosen the counterclockwise direction, if there are no other
points to the “right” of segment  . (see line 5).</p>
        <p>Note that all the computation in Listing 6, concerning the calculation of the convex hull, is
performed by the grounder therefore it does not afect solving performance.</p>
      </sec>
      <sec id="sec-2-10">
        <title>1 hull(P) :- point(P,_,_), not inside(P).</title>
      </sec>
      <sec id="sec-2-11">
        <title>2 inside(P):</title>
        <p>3 point(P1,_,_), point(P2,_,_), point(P3,_,_),</p>
      </sec>
      <sec id="sec-2-12">
        <title>4 turn_right(P,P1,P2), turn_right(P,P2,P3), turn_right(P,P3,P1). 5 convex_hull_next(A,B):- hull(A), hull(B), A != B, not turn_right(A,B,_).</title>
        <sec id="sec-2-12-1">
          <title>Listing 6: Calculation of convex hull in ASP</title>
          <p>
            3.3. Exploiting acyclicity checker
The clingo solver includes an eficient acyclicity checker [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ]: edges identified with the #edge
keyword must form an acyclic graph. Such acyclicity can be exploited in TSP solving as follows.
          </p>
          <p>Listing 7: Euclidean TSP encoding in ASP with acyclicity constraints</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Experimental evaluation</title>
      <p>
        To assess the efectiveness of the proposed algorithms, we compared experimentally a classical
ASP encoding for the Euclidean TSP with encodings using the reasoning based on geometric
properties presented in the previous section. We also devised experiments to compare the
speedup of the additional filtering based on geometric information on an ASP solver and a
CLP(FD) solver. As CLP(FD) solver, we chose the ic library of ECL PS v.7.0 build #54 [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and
as ASP solver we chose clingo 5.6.21.
      </p>
      <p>
        To generate realistic Euclidean TSP instances, we used the generator of the DIMACS
challenge [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], that provides instances in two classes: uniform and clustered. We randomly generated
instances from 10 to 35 nodes, in both classes. For each size and class, we generated 16 instances.
      </p>
      <p>Uniform random generated instances consist of integer coordinate points uniformly
distributed in a square of 103 side. Randomly generated instances consist of clusters of points,
whose centers are uniformly distributed in a square of 103 side. Each point is then randomly
associated with a cluster center and two normally distributed variables, each of which is then
multiplied by 103/# , rounded, and added to the corresponding integer coordinate of the
chosen center to obtain the coordinates of the point.</p>
      <p>For simplicity, we summarized in Table 1 the structure of the various ASP programs tested
in the experimental evaluation. The ASP_BASE program is the reference encoding for TSP in
ASP, ASP_HULL and ASP_NOCROSS implement only convex hull-based pruning and crossing
removal-based pruning, respectively. Finally, ASP_GEOMETRIC implements both geometric
reasoning. ASP_ACY_BASE and ASP_ACY_GEOMETRIC use the Euclidean TSP encoding with
acyclicity constraint. Since convex hull-based constraints also behave as symmetry breaking by
imposing the direction of cycle, we added the following constraint
:- cycle(A,1), cycle(1,B), A&gt;B.
to the ASP_BASE program to remove symmetries and have a fair comparison.</p>
      <p>Name
ASP_BASE
ASP_NOCROSS
ASP_HULL
ASP_GEOMETRIC
ASP_ACY_BASE
ASP_ACY_GEOMETRIC</p>
      <p>Configuration
Listing 1 + symmetry breaking
Listing 1 + 2
Listing 1 + 3 + 4 + 5 + 6
ASP_NOCROSS + ASP_HULL
Listing 7 + symmetry breaking</p>
      <p>Listing 7 + 2 + 3 + 4 + 5 + 6</p>
      <p>In CLP(FD), we adopted the successor representation. In the successor representation, 
variables Next are defined Next = (Next1, Next2, … , Next ); variable Next represents the node
that follows node  in the circuit, and its initial domain is {1, … , } ⧵ {} . For example, if  = 5
and Next = (3, 5, 4, 2, 1) the corresponding tour will be (1, 3, 4, 2, 5, 1).</p>
      <p>
        The basic Euclidean TSP encoding includes an alldifferent(Next) constraint on the Next
array of variables, which ensures that each node has exactly one incoming edge (degree
constraints), and a circuit(Next) [
        <xref ref-type="bibr" rid="ref16 ref17 ref18">16, 17, 18</xref>
        ] constraint (sometimes called nocycle) that avoids
subtours, i.e., cycles of length less than  . This encoding also includes, as redundant
representation, a set of Prev variables: Prev represents the node that precedes node  in the circuit.
      </p>
      <p>CLP_GEOMETRIC program includes the basic CLP(FD) encoding for Euclidean TSP together
with constraints for crossing removal and convex hull-based pruning, which in this program
also acts as a symmetry breaking constraint. CLP_BASE program, on the other hand, besides
the basic encoding, includes only the Next1 &lt; Prev1 symmetry breaking constraint.
4.1. Results
All tests were run with a time limit of 1800s on Intel® Xeon® Processor E5-2630 v3 running at
2.4GHz, using only one core and with 8GB of reserved memory.</p>
      <p>Figure 2 compares ASP encodings without acyclicity constraints. In Figure 2a, each point
represents one instance solved with ASP_BASE encoding (whose running time is in the  axis)
and with one of the encodings exploiting geometric reasoning (whose running time is reported
in the  axis). Since all points stand below the  =  straight line, the geometric properties
were able to speedup the running time in all instances. Note the log-log scale: speedups from 1
to 3 order of magnitudes were often obtained. Taken individually, both ASP_NOCROSS and
ASP_HULL encoding showed a lower solving time when compared with ASP_BASE encoding.
However, the best encoding turns out to be ASP_GEOMETRIC containing all the geometric
reasoning presented in this paper. The graph in Figure 2b shows in the  -axis the number of
instances that could be solved within the runtime plotted in the  -axis. In particular, note how
the use of ASP_GEOMETRIC encoding allowed us to solve twice as many instances within the
time limit.</p>
      <p>Figure 3 shows the efect of the acyclicity checker; the use of the acyclicity checker provided
some improvement, and mostly in conjunction with the use of geometric constraints.</p>
      <p>Grounding times of the various encodings are compared in Figure 4. The grounding time
of the ASP_GEOMETRIC encoding grows quadratically as the number of cross/4 predicates
grows quadratically. However, the time required for grounding never exceeds 4 seconds in the
larger instances (more than 22 nodes) thus remaining negligible compared to the solving time,
which for those same instances greatly exceeds 1000 seconds.</p>
      <p>A comparison of how filtering based on geometric information performs diferently on an
ASP solver and a CLP(FD) solver is presented in Figure 5. We decided to compare the speedup
obtained through the exploitation of geometric reasoning. In Figure 5a, where each point
represents an instance of Euclidean TSP, the speedup obtained in the CLP(FD) solver (x-axis)
is compared with the speedup obtained in the ASP solver (y-axis). On average, the use of
geometric reasoning shows, on a single instance, a greater speedup in performance on the ASP
solver than on the CLP(FD) solver.</p>
      <p>ASP_NOCROSS</p>
      <p>ASP_HULL
ASP_GEOMETRIC</p>
      <p>ASP_BASE CPU Time [s]</p>
      <p>(a)
10−2
10−1
100
101
102
103
100
200
300
400
500
2,000
1,500
10−1
10−2</p>
      <p>Considering solving times those recorded on the CLP(FD) solver still remain lower than those
shown by the ASP solver. In fact, the cactus plot in Figure 5b shows that CLP_BASE without
geometric constraints even succeeds in solving 191 more instances than the encoding
ASP_GEOMETRIC that uses geometric constraints instead. If we further compare CLP_GEOMETRIC
using geometric reasoning with ASP_GEOMETRIC the gap becomes even more marked as the
higher number of instances solved within the time limit increases from 191 to 321.</p>
      <p>Considering the comparison between ASP and CLP(FD) approaches, two aspects must be
10−1
10−2
10−3</p>
      <p>ASP_BASE grounding
ASP_GEOMETRIC grounding</p>
      <p>ASP_BASE solving</p>
      <p>ASP_GEOMETRIC solving</p>
      <p>
        Instances (sorted in ascending order by size)
noticed. Indeed, the CLP(FD) approach is faster, and able to solve more instances. On the other
hand, the implementation of the propagators took several development time, was based on some
non-trivial theorems that helped in reducing the computational complexity of the propagators
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and takes about 1500 lines of code. The ASP approach, instead, is completely listed in
this paper, and is based on declarative considerations, without the need to develop complex
propagation algorithms.
      </p>
      <p>In conclusions, we believe that the geometric reasoning on ASP provided a significant speedup
and can help extending the applicability of ASP.</p>
    </sec>
    <sec id="sec-4">
      <title>5. Related work</title>
      <p>
        ASP was used to solve a Delivery Problem, in which robots have to move items inside a
warehouse [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. The extensive work describes in detail the problem, that can be considered as a
problem of multi-agent path finding, and it includes a routing component within the warehouse,
in which possible routes are identified within a graph, and it also includes a scheduling
component, as the exact timing in which each robot is in each location influences the synchronization
of activities. In particular, the robots should not collide, and this is achieved by declaring conflict
zones, that can be occupied by at most one robot at the same time. The graphs are very large, so
the authors decide to reduce the search space in various ways, possibly excluding the optimal
solution but allowing them to obtain good solutions quickly. The graphs they consider are
planar, meaning that there are no crossings between edges. They successfully employ clingo[dl]
[
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
      </p>
      <p>100
101
102
103
200
400
600
800
Speedup on CLP(FD) solver
(a)
1,500
10−1</p>
      <p>10−1</p>
    </sec>
    <sec id="sec-5">
      <title>6. Conclusion</title>
      <p>
        In this paper we applied reasoning based on geometric constraints to the Euclidean TSP (that
was developed in a previous publication [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] in the context of Constraint Logic Programming), a
widely used case of the famous Travelling Salesperson Problem, within an ASP-based solving
approach. The classical encoding of the TSP in ASP was significantly improved thanks to the
geometric reasoning: without sacrificing the simplicity, declarativeness and succinctness of the
the approach, speedups between 1 and 3 orders of magnitude were easily obtained.
      </p>
      <p>
        In future work, we plan to investigate the efectiveness of the approach on real-life instances,
while so far only randomly-generated instances were used. Another interesting research
direction is the use of machine learning to select only those nocrossing constraints that are most
efective; this approach was already studied in the CLP(FD) context [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] and provided a further
speedup. Moreover, the use of Constraint ASP approaches could provide further improvements
and also the geometric reasoning outlined in this paper could be adapted and applied to other
routing problems on the Euclidean plane, such as the Euclidean Vehicle Routing Problem or the
Euclidean Generalized TSP.
      </p>
      <p>Finally, we plan to study how geometric constraints presented in this paper can be extended
into non-Euclidean spaces such as TSP geographic instances where coordinates are expressed
in terms of latitude and logitude.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <sec id="sec-6-1">
        <title>This work was partially supported by GNCS-INdAM.</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Reinelt</surname>
          </string-name>
          , TSPLIB
          <article-title>- A traveling salesman problem library</article-title>
          ,
          <source>INFORMS Journal on Computing</source>
          <volume>3</volume>
          (
          <year>1991</year>
          )
          <fpage>376</fpage>
          -
          <lpage>384</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bertagnon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gavanelli</surname>
          </string-name>
          ,
          <article-title>Improved filtering for the Euclidean traveling salesperson problem in CLP(FD)</article-title>
          ,
          <source>in: The Thirty-Fourth AAAI Conference on Artificial Intelligence</source>
          ,
          <source>AAAI</source>
          <year>2020</year>
          , The Thirty-Second
          <source>Innovative Applications of Artificial Intelligence Conference</source>
          ,
          <source>IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI</source>
          <year>2020</year>
          , New York, NY, USA, February 7-
          <issue>12</issue>
          ,
          <year>2020</year>
          , AAAI Press,
          <year>2020</year>
          , pp.
          <fpage>1412</fpage>
          -
          <lpage>1419</lpage>
          . URL: https://aaai.org/ojs/index.php/AAAI/article/view/5498.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>T.</given-names>
            <surname>Syrjänen</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Niemelä</surname>
          </string-name>
          ,
          <article-title>The smodels system</article-title>
          , in: T. Eiter,
          <string-name>
            <given-names>W.</given-names>
            <surname>Faber</surname>
          </string-name>
          , M. Truszczynski (Eds.),
          <source>Logic Programming and Nonmonotonic Reasoning</source>
          , 6th International Conference,
          <string-name>
            <surname>LPNMR</surname>
          </string-name>
          <year>2001</year>
          , Vienna, Austria,
          <source>September 17-19</source>
          ,
          <year>2001</year>
          , Proceedings, volume
          <volume>2173</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2001</year>
          , pp.
          <fpage>434</fpage>
          -
          <lpage>438</lpage>
          . URL: https://doi.org/10.1007/3-540-45402-0_
          <fpage>38</fpage>
          . doi:
          <volume>10</volume>
          .1007/3- 540- 45402- 0\_
          <fpage>38</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Lierler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Maratea</surname>
          </string-name>
          ,
          <article-title>Answer set programming based on propositional satisfiability</article-title>
          ,
          <source>J. Autom. Reason</source>
          .
          <volume>36</volume>
          (
          <year>2006</year>
          )
          <fpage>345</fpage>
          -
          <lpage>377</lpage>
          . URL: https://doi.org/10.1007/ s10817-006-9033-2. doi:
          <volume>10</volume>
          .1007/s10817- 006- 9033- 2.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>F.</given-names>
            <surname>Calimeri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Manna</surname>
          </string-name>
          , E. Mastria,
          <string-name>
            <given-names>M. C.</given-names>
            <surname>Morelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Perri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zangari</surname>
          </string-name>
          ,
          <article-title>I-DLV-sr: A stream reasoning system based on I-DLV, Theory Pract</article-title>
          . Log. Program.
          <volume>21</volume>
          (
          <year>2021</year>
          )
          <fpage>610</fpage>
          -
          <lpage>628</lpage>
          . URL: https://doi.org/10.1017/S147106842100034X. doi:
          <volume>10</volume>
          .1017/S147106842100034X.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gebser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kaminski</surname>
          </string-name>
          , B. Kaufmann, T. Schaub,
          <article-title>Multi-shot ASP solving with clingo</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>19</volume>
          (
          <year>2019</year>
          )
          <fpage>27</fpage>
          -
          <lpage>82</lpage>
          . URL: https://doi.org/10.1017/S1471068418000054. doi:
          <volume>10</volume>
          .1017/S1471068418000054.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          ,
          <article-title>The stable model semantics for logic programming</article-title>
          , in: R. A.
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <article-title>A</article-title>
          .
          <string-name>
            <surname>Bowen</surname>
          </string-name>
          (Eds.), ICLP, MIT Press,
          <year>1988</year>
          , pp.
          <fpage>1070</fpage>
          -
          <lpage>1080</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>F.</given-names>
            <surname>Calimeri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Faber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gebser</surname>
          </string-name>
          , G. Ianni,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kaminski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Krennwallner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Maratea</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Ricca</surname>
          </string-name>
          , T. Schaub,
          <article-title>ASP-Core-2 input language format</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>20</volume>
          (
          <year>2020</year>
          ). URL: https://doi.org/10.1017/S1471068419000450. doi:
          <volume>10</volume>
          .1017/ S1471068419000450.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>M. M. Flood</surname>
          </string-name>
          ,
          <article-title>The traveling-salesman problem</article-title>
          ,
          <source>Operations Research</source>
          <volume>4</volume>
          (
          <year>1956</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>F.</given-names>
            <surname>Antonio</surname>
          </string-name>
          , Faster line segment intersection, in: D.
          <string-name>
            <surname>Kirk</surname>
          </string-name>
          (Ed.),
          <string-name>
            <surname>Graphics Gems</surname>
            <given-names>III</given-names>
          </string-name>
          , Academic Press Professional, Inc., San Diego, CA, USA,
          <year>1992</year>
          , pp.
          <fpage>199</fpage>
          -
          <lpage>202</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gebser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Harrison</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kaminski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          , T. Schaub,
          <article-title>Abstract gringo</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>15</volume>
          (
          <year>2015</year>
          )
          <fpage>449</fpage>
          -
          <lpage>463</lpage>
          . URL: https://doi.org/10.1017/S1471068415000150. doi:
          <volume>10</volume>
          .1017/S1471068415000150.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>V. G.</given-names>
            <surname>Deineko</surname>
          </string-name>
          , R. van Dal,
          <string-name>
            <surname>G. Rote,</surname>
          </string-name>
          <article-title>The convex-hull-and-line traveling salesman problem: A solvable case</article-title>
          ,
          <source>Inf. Process. Lett</source>
          .
          <volume>51</volume>
          (
          <year>1994</year>
          )
          <fpage>141</fpage>
          -
          <lpage>148</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Bomanson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gebser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Janhunen</surname>
          </string-name>
          , B. Kaufmann, T. Schaub,
          <article-title>Answer set programming modulo acyclicity</article-title>
          ,
          <source>Fundamenta Informaticae</source>
          <volume>147</volume>
          (
          <year>2016</year>
          )
          <fpage>63</fpage>
          -
          <lpage>91</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>J.</given-names>
            <surname>Schimpf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Shen</surname>
          </string-name>
          ,
          <article-title>Eclipse - from LP to CLP</article-title>
          ,
          <source>Theory and Practice of Logic Programming</source>
          <volume>12</volume>
          (
          <year>2012</year>
          )
          <fpage>127</fpage>
          -
          <lpage>156</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cirasella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Johnson</surname>
          </string-name>
          , L. A.
          <string-name>
            <surname>McGeoch</surname>
            ,
            <given-names>W. Zhang,</given-names>
          </string-name>
          <article-title>The asymmetric traveling salesman problem: Algorithms, instance generators, and tests</article-title>
          , in: A. L.
          <string-name>
            <surname>Buchsbaum</surname>
          </string-name>
          , J. Snoeyink (Eds.), Algorithm Engineering and Experimentation, Third International Workshop, ALENEX 2001, Washington, DC, USA, January 5-
          <issue>6</issue>
          ,
          <year>2001</year>
          ,
          <string-name>
            <given-names>Revised</given-names>
            <surname>Papers</surname>
          </string-name>
          , volume
          <volume>2153</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2001</year>
          , pp.
          <fpage>32</fpage>
          -
          <lpage>59</lpage>
          . URL: https://doi.org/10.1007/3-540-44808-X_
          <article-title>3</article-title>
          . doi:
          <volume>10</volume>
          .1007/3- 540- 44808- X\_
          <volume>3</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>N.</given-names>
            <surname>Beldiceanu</surname>
          </string-name>
          , E. Contejean,
          <source>Introducing global constraints in CHIP, Math. Comput. Model</source>
          .
          <volume>20</volume>
          (
          <year>1994</year>
          )
          <fpage>97</fpage>
          -
          <lpage>123</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Caseau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Laburthe</surname>
          </string-name>
          ,
          <article-title>Solving small TSPs with constraints</article-title>
          , in: L.
          <string-name>
            <surname>Naish</surname>
          </string-name>
          (Ed.),
          <string-name>
            <surname>Logic</surname>
            <given-names>Programming</given-names>
          </string-name>
          ,
          <source>Proceedings of the Fourteenth International Conference on Logic Programming, Leuven, Belgium, July</source>
          <volume>8</volume>
          -
          <issue>11</issue>
          ,
          <year>1997</year>
          , MIT Press,
          <year>1997</year>
          , pp.
          <fpage>316</fpage>
          -
          <lpage>330</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>L. G.</given-names>
            <surname>Kaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. N.</given-names>
            <surname>Hooker</surname>
          </string-name>
          ,
          <article-title>A filter for the circuit constraint</article-title>
          , in: F. Benhamou (Ed.),
          <source>Principles and Practice of Constraint Programming - CP</source>
          <year>2006</year>
          , 12th International Conference, CP 2006,
          <article-title>Nantes</article-title>
          , France,
          <source>September 25-29</source>
          ,
          <year>2006</year>
          , Proceedings, volume
          <volume>4204</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2006</year>
          , pp.
          <fpage>706</fpage>
          -
          <lpage>710</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>D.</given-names>
            <surname>Rajaratnam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Schaub</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Wanko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chen</surname>
          </string-name>
          , S. Liu, T. C.
          <article-title>Son, Solving an industrialscale warehouse delivery problem with answer set programming modulo diference constraints</article-title>
          ,
          <source>Algorithms</source>
          <volume>16</volume>
          (
          <year>2023</year>
          ). URL: https://www.mdpi.com/1999-4893/16/4/216. doi:
          <volume>10</volume>
          .3390/a16040216.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>T.</given-names>
            <surname>Janhunen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kaminski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ostrowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Schellhorn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Wanko</surname>
          </string-name>
          , T. Schaub,
          <article-title>Clingo goes linear constraints over reals and integers</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>17</volume>
          (
          <year>2017</year>
          )
          <fpage>872</fpage>
          -
          <lpage>888</lpage>
          . URL: https://doi.org/10.1017/S1471068417000242. doi:
          <volume>10</volume>
          .1017/S1471068417000242.
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>E.</given-names>
            <surname>Bellodi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bertagnon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gavanelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Zese</surname>
          </string-name>
          ,
          <article-title>Improving the eficiency of Euclidean TSP solving in constraint programming by predicting efective nocrossing constraints</article-title>
          , in: M.
          <string-name>
            <surname>Baldoni</surname>
          </string-name>
          , S. Bandini (Eds.),
          <source>AIxIA 2020 - Advances in Artificial Intelligence - XIXth International Conference of the Italian Association for Artificial Intelligence, Virtual Event, November 25-27</source>
          ,
          <year>2020</year>
          , Revised Selected Papers, volume
          <volume>12414</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2020</year>
          , pp.
          <fpage>318</fpage>
          -
          <lpage>334</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -77091-4_
          <fpage>20</fpage>
          . doi:
          <volume>10</volume>
          .1007/978- 3-
          <fpage>030</fpage>
          - 77091- 4\_
          <fpage>20</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>