<!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 />
    <article-meta>
      <title-group>
        <article-title>SUNNY for Algorithm Selection: A Preliminary Study</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Roberto Amadini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabio Biselli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maurizio Gabbrielli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tong Liu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jacopo Mauro</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science and Engineering University of Bologna</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Given a collection of algorithms, the Algorithm Selection (AS) problem consists in identifying which of them is the best one for solving a given problem. In this paper we show how we adapted the algorithm selector SUNNY, originally tailored for constraint solving, to deal with general AS problems. Preliminary investigations based on the AS Library benchmarks already show some promising results: for some scenarios SUNNY is able to outperform AS state-ofthe-art approaches.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Given a collection of algorithms, the Algorithm Selection (AS) problem basically
consists in identifying which of them is the best one for solving a given problem. Initially
proposed by Rice in 1976 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], in the last decade AS has attracted some attention [
        <xref ref-type="bibr" rid="ref10 ref7">7, 10</xref>
        ].
In particular, the original notion of AS has been extended by the definition of Algorithm
Portfolio (AP) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In a nutshell, AP approaches exploit a portfolio fA1; : : : ; Amg of
different algorithms to get a globally better algorithm. They go beyond the original
notion of AS introduced by Rice since APs perform the algorithm selection case-by-case
instead of in advance. When a new, unseen problem p comes, an AP approach tries to
predict which is (or which are) the best constituent algorithm(s) Ai1 ; Ai2 ; : : : ; Aik , with
1 ij m, for solving p and then runs such algorithm(s) on p. Scheduling k &gt; 1
algorithms can reduce the risk of selecting only one algorithm —maybe the wrong one—
and possibly enables the knowledge sharing between the scheduled algorithms.
However, note that the boundary between AS and AP is fuzzy: these two related problems
are often considered as equivalent. For this reason, with a little abuse of notation, in the
following we will only use the AS notation for indicating both AS and AP problems.
      </p>
      <p>
        SUNNY is an algorithm selector tailored for Constraint Programming (CP), where
the algorithms to be selected correspond to different constraint solvers. Originally
conceived for solving Constraint Satisfaction Problems (CSPs) only [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], it has been later on
adapted for dealing with Constraint Optimisation Problems (COPs) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. SUNNY is also
the algorithm that underpins sunny-cp [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], a constraint solver exploiting a portfolio
of different constituent solvers for solving both CSPs and COPs.
      </p>
      <p>
        In this paper we present a preliminary evaluation of SUNNY on different AS
benchmarks taken from the Algorithm Selection library (ASlib) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. We show that SUNNY
can be applied also outside the CP domain, reaching promising performance in different
fields such as Answer-Set Programming (ASP), Quantified Boolean Formula (QBF),
or the Container Pre-marshalling Problem. Conversely, for the Boolean Satisfiability
(SAT) problems of ASlib there is still a performance gap with the best AS approaches.
      </p>
    </sec>
    <sec id="sec-2">
      <title>SUNNY</title>
      <p>
        The SUNNY [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] algorithm was originally introduced for constraint solving. Fixed a
solving timeout and a portfolio A of algorithms, SUNNY exploits instances similarity
to produce a sequential schedule = [(A1; t1); : : : ; (Ah; th)] where algorithm Ai 2 A
has to run for ti seconds and Pih=1 ti = . For any input problem x, SUNNY uses a
kNearest Neighbours (k-NN) algorithm to select from a training set of known instances
the subset N (x; k) of the k instances closer to the feature vector of x according to the
Euclidean distance. Basically, the feature vector of x is a collection F (x) 2 Rd of
numerical attributes that characterise x (e.g., statistics over the variables or the constraints
of x). Starting from the N (x; k) instances SUNNY relies on three heuristics to compute
the schedule : Hsel, for selecting the most promising algorithms fA1; : : : ; Ahg A
to run; Hall, for allocating to each Ai 2 A a certain runtime ti 2 [0; ] for i = 1; : : : ; h;
Hsch, for scheduling the sequential execution of the algorithms according to their
presumed speed. The heuristics Hsel, Hall, and Hsch depends on the application domain.
For CSPs, Hsel selects the smallest sub-portfolio S A that solves the most instances
in N (x; k), by using the runtime for breaking ties. Hall allocates to each Ai 2 S a
time ti proportional to the instances that S can solve in N (x; k), by using a special
backup solver for covering the instances of N (x; k) not solvable by any solver. Finally,
Hsch sorts the solvers by increasing solving time in N (x; k). For COPs the approach is
similar, but different evaluation metrics are used. We conclude the section by showing
an example of how SUNNY works on a given CSP; for more details about SUNNY we
refer the interested reader to [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ].
      </p>
      <p>Example 1 Let x be a CSP, A = fA1; A2; A3; A4g a portfolio, A3 the backup solver,
= 1800 seconds the solving timeout, N (x; k) = fx1; :::; x5g the k = 5 neighbours
of x, and the runtimes of solver Ai on problem xj defined as in Table 1. In this case,
the smallest sub-portfolios that solve the most instances (4 to be precise) in N (x; k)
are fA1; A2; A3g, fA1; A2; A4g, and fA2; A3; A4g. The heuristic Hsel selects S =
fA1; A2; A4g because these solvers are faster in solving the instances in N (x; k). Since
A1 and A4 solve 2 instances, A2 solves 1 instance and x1 is not solved by any solver,
the time window [0; ] is partitioned in 2 + 2 + 1 + 1 = 6 slots: 2 assigned to A1
and A4, 1 slot to A2, and 1 to the backup solver A3. Finally, Hsch sorts the solvers
by increasing solving time. The final schedule produced by SUNNY is therefore =
[(A4; 600); (A1; 600); (A3; 300); (A2; 300)].</p>
      <p>x1
x2</p>
      <p>x4
x3
3
x5
278</p>
      <p>To evaluate SUNNY on different scenarios we exploited the Algorithm Selection library
(ASlib). ASlib provides standardised format and data for representing AS scenarios
allowing the comparison of different AS approaches. Each ASlib scenario contains: an
algorithm space A = fA1; : : : ; Amg; a problem space X = fx1; : : : ; xng; a feature
space Fd = fF1; : : : ; Fng where Fj 2 Rd is the feature vector of the problem xj ; a
performance space P = fP1;1; : : : ; Pm;ng where Pi;j 2 R measures the performance
of algorithm Ai on problem xj within a timeout of seconds. ASlib contains 13
heterogeneous scenarios1 as summarised in Table 2. The scenarios differ in the number
of algorithms m, problems n, features d, and in the time limits . For every scenario,
the runtime is used as performance measure: if algorithm A solves problem x in t &lt;
seconds the runtime RunTime(A; x) of A on x is t. Otherwise, RunTime(A; x) = .
Each scenario of the ASlib is evaluated with a 10-fold cross validation: X is partitioned
in 10 subsets X1; : : : ; X10 called folds, treating in turn a fold Xi as the test set and the
union Sj6=i Xj of the other folds as the training set.</p>
      <p>
        Adapting SUNNY to ASlib scenarios was rather straightforward. Fixed a training
set Xtr X and a corresponding feature space Ftr, we normalised the feature vectors
by removing all the constant features of Ftr and scaling them in the range [ 1; 1].
Then, for each unknown problem x 2= Xtr, SUNNY computes the neighbourhood
N (x; k) Xtr and the resulting schedule = [(a1; t1); : : : ; (ah; th)] exactly as
explained in Section 2. Following the methodology of [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], we set k = pjXtrj and the
backup solver as the algorithm of A having the lower average RunTime in Xtr.
      </p>
      <p>
        Table 3 shows for each scenario the Fraction of Solved Instances (FSI) of SUNNY.
As the name underlines, the FSI of an AS approach is the ratio between the number of
instances it solves and all the instances of the scenario. SUNNY is compared against the
state-of-the-art AS approaches reported in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (viz., ISAC, SNNAP, aspeed, claspfolio,
claspfolio-pre, zilla, and LLAMA) and two additional baselines: the Single Best Solver
(SBS ), i.e., the algorithm in A with highest FSI, and the Virtual Best Solver (VBS ),
i.e., the oracle approach that for every x 2 X always select the algorithm A 2 A for
1 We considered the 1.0.1 version of ASlib. For more details, we refer the reader to [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
which RunTime(A; x) is minimal. We can see that SUNNY is the best approach for
the QBF scenario, and that for all the non-SAT scenarios it is rather close to the best
performance. Conversely, for the SAT benchmarks its performance is quite poor.
      </p>
      <p>The FSI metric is commonly used for comparing different AS approaches due to
its simplicity and significance. However, it does not take into account the time needed
to solve a problem. To capture also the timing aspects of the resolution, the Penalised
Average Runtime (PAR) measure is often used. PARk represents the average time taken
to solve the problems by giving a penalisation of k seconds for the instances not
solved within the timeout .</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusions</title>
      <p>In this work we presented an evaluation of SUNNY algorithm on different Algorithm
Selection (AS) scenarios coming from the Algorithm Selection library (ASlib). Despite
SUNNY is tailored for constraint solving, its adaptation to AS appears to be promising
also in other fields such as Answer-Set Programming (ASP), Quantified Boolean
Formula (QBF), or the Container Pre-marshalling Problem. Conversely, for the Boolean
Satisfiability (SAT) problems there is still a performance gap with the best approaches.</p>
      <p>We would like to remark that in this evaluation we used the default SUNNY
approach without leveraging its settings to fit the different scenarios. As a future work
we would like to try to improve the performance of SUNNY by using well-known
techniques like pre-solving, parameters tuning, and feature selection. It would be interesting
to consider also different scenarios, like optimisation and planning problems. Indeed,
the ASlib currently contains a limited number of scenarios for which the only metric
is the runtime. It would be nice also to perform a deeper study to better understand
the SUNNY performance (and in particular why SUNNY is not so good for the SAT
benchmarks).</p>
      <p>
        We strongly encourage the submission of new scenarios and new algorithm selectors
to the ASlib in order to foster the study and the comparison of new and better AS
approaches. For instance, since SUNNY turns out to be the best approach for QBF, it
would be interesting to consider a comparison with the multi-engine solver AQME [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>
        We are currently implementing SUNNY as an automated algorithm selector for
ASlib scenarios, with the aim of enrolling it to the next ICON Challenge on Algorithm
Selection. Moreover, we are also interested in studying how SUNNY can be optimally
parallelised to run its algorithms simultaneously on multiple cores. A preliminary
investigation on the SUNNY parallelisation for CSPs and COPs is presented in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>R.</given-names>
            <surname>Amadini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gabbrielli</surname>
          </string-name>
          , and
          <string-name>
            <surname>J. Mauro.</surname>
          </string-name>
          <article-title>SUNNY: a Lazy Portfolio Approach for Constraint Solving</article-title>
          .
          <source>TPLP</source>
          ,
          <volume>14</volume>
          (
          <issue>4-5</issue>
          ):
          <fpage>509</fpage>
          -
          <lpage>524</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>R.</given-names>
            <surname>Amadini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gabbrielli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Mauro</surname>
          </string-name>
          .
          <article-title>A Multicore Tool for Constraint Solving</article-title>
          .
          <source>In IJCAI</source>
          ,
          <year>2015</year>
          . Pre-print available at: http://arxiv.org/abs/1502.03986.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>R.</given-names>
            <surname>Amadini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gabbrielli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Mauro</surname>
          </string-name>
          .
          <article-title>Portfolio approaches for constraint optimization problems</article-title>
          .
          <source>AMAI</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>18</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>R.</given-names>
            <surname>Amadini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gabbrielli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Mauro</surname>
          </string-name>
          .
          <article-title>SUNNY-CP: a Sequential CP Portfolio Solver</article-title>
          .
          <source>In SAC</source>
          ,
          <year>2015</year>
          . Available at http://www.cs.unibo.it/˜amadini/sac_2015.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Algorithm</given-names>
            <surname>Selection</surname>
          </string-name>
          Library - coseal. https://code.google.com/p/coseal/ wiki/AlgorithmSelectionLibrary.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C. P.</given-names>
            <surname>Gomes</surname>
          </string-name>
          and
          <string-name>
            <given-names>B.</given-names>
            <surname>Selman</surname>
          </string-name>
          .
          <article-title>Algorithm portfolios</article-title>
          . Artif. Intell.,
          <volume>126</volume>
          (
          <issue>1-2</issue>
          ):
          <fpage>43</fpage>
          -
          <lpage>62</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>L.</given-names>
            <surname>Kotthoff</surname>
          </string-name>
          .
          <article-title>Algorithm selection for combinatorial search problems: A survey</article-title>
          .
          <source>AI Magazine</source>
          ,
          <volume>35</volume>
          (
          <issue>3</issue>
          ):
          <fpage>48</fpage>
          -
          <lpage>60</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>L.</given-names>
            <surname>Pulina</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Tacchella</surname>
          </string-name>
          .
          <article-title>A self-adaptive multi-engine solver for quantified boolean formulas</article-title>
          .
          <source>Constraints</source>
          ,
          <volume>14</volume>
          (
          <issue>1</issue>
          ):
          <fpage>80</fpage>
          -
          <lpage>116</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Rice</surname>
          </string-name>
          .
          <source>The Algorithm Selection Problem. Advances in Computers</source>
          ,
          <volume>15</volume>
          :
          <fpage>65</fpage>
          -
          <lpage>118</lpage>
          ,
          <year>1976</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>K</surname>
          </string-name>
          . A.
          <string-name>
            <surname>Smith-Miles</surname>
          </string-name>
          .
          <article-title>Towards insightful algorithm selection for optimisation using metalearning concepts</article-title>
          .
          <source>In IJCNN</source>
          , pages
          <fpage>4118</fpage>
          -
          <lpage>4124</lpage>
          . IEEE,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>