<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">A Decision Support System for Food Recycling based on Constraint Logic Programming and Ontological Reasoning</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Federico</forename><surname>Chesani</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Dipartimento di Informatica Scienza e Ingegneria</orgName>
								<orgName type="institution">University of Bologna</orgName>
								<address>
									<addrLine>Viale Risorgimento 2</addrLine>
									<postCode>40136</postCode>
									<settlement>Bologna</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Giuseppe</forename><surname>Cota</surname></persName>
							<affiliation key="aff1">
								<orgName type="department">Dipartimento di Ingegneria</orgName>
								<orgName type="institution">University of Ferrara</orgName>
								<address>
									<addrLine>Via ; Saragat 1</addrLine>
									<postCode>I-44122</postCode>
									<settlement>Ferrara</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Evelina</forename><surname>Lamma</surname></persName>
							<affiliation key="aff1">
								<orgName type="department">Dipartimento di Ingegneria</orgName>
								<orgName type="institution">University of Ferrara</orgName>
								<address>
									<addrLine>Via ; Saragat 1</addrLine>
									<postCode>I-44122</postCode>
									<settlement>Ferrara</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Paola</forename><surname>Mello</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Dipartimento di Informatica Scienza e Ingegneria</orgName>
								<orgName type="institution">University of Bologna</orgName>
								<address>
									<addrLine>Viale Risorgimento 2</addrLine>
									<postCode>40136</postCode>
									<settlement>Bologna</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Fabrizio</forename><surname>Riguzzi</surname></persName>
							<affiliation key="aff2">
								<orgName type="department">Dipartimento di Matematica e Informatica</orgName>
								<orgName type="institution">University of Ferrara</orgName>
								<address>
									<addrLine>Via ; Saragat 1</addrLine>
									<postCode>I-44122</postCode>
									<settlement>Ferrara</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">A Decision Support System for Food Recycling based on Constraint Logic Programming and Ontological Reasoning</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">46E563D6E50178CB3C77662565F54BE3</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-25T07:35+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In 2011, FAO estimated that about one third of the total production of edible food for human consumption, gets lost or wasted, globally. In industrialized countries, more than 40% of the food losses occur at retail and consumer levels. A considerable part of the wasted food can be reused. The SORT project aims at "recycling" food in excess by converting it into animal feed or fuel for biogas/biomass power plants. During this process of reconditioning it is necessary to make choices in order to minimize the costs and maximize the earnings. However, due to the extremely complex nature of the process, it is not possible for a human being to make these choices at runtime and in an optimal manner. In these cases, Decision Support Systems (DSS) can be of help.</p><p>In this paper we propose a DSS based on the Constraint Logic Programming (CLP) paradigm and ontology reasoning for finding the optimal solution. The information about feed processing and feed categories were extracted from Regulation (EU) 2017/1017 and stored into an ontology. Finally, we provide an evaluation of our system on several synthetic datasets with different search settings.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>In 2011, FAO (Food and Agriculture Organization of the United Nations) estimated that about one third of the total production of food for human consumption, 1.3 billion tonnes per year, gets lost or wasted worldwide <ref type="bibr" target="#b2">[3]</ref>.</p><p>Food waste has strong impact on deforestation, ecosystem degradation and on natural and human resource consumption, including water, land, energy, labour and capital. Moreover it produces greenhouse gas emissions, contributing to global warming and climate change.</p><p>Food loss refers to losses of edible food mass throughout the early stages of the supply chain. Food losses take place during the stages of production, harvesting, treatment, storage and processing. Food losses occurring at the end of the food chain (retail distribution and final consumption) are called food waste, which depend on the behaviour of retailers and consumers. For instance, at retail level, large quantities of food are wasted due to appearance standards (e.g. dented but unbroken cans, fruit with imperfections, etc.).</p><p>In industrialized countries, more than 40% of the food losses are food waste. In particular, the quantity of food wasted at consumer level in industrialised countries amounts to 222 million tonnes, roughly equivalent to the food production available in sub-Saharan Africa (230 million tonnes) <ref type="bibr" target="#b2">[3]</ref>. The European Commission estimated that in 2012 about 88 million tonnes of food loss and waste were produced, with a related cost of 143 billion euros <ref type="bibr" target="#b8">[9]</ref>.</p><p>A considerable part of the food waste (currently destined for landfill) can be reused. The SORT project<ref type="foot" target="#foot_0">4</ref> aims at "recycling" food items in excess or no longer consumable by humans. The main goals of the SORT project are:</p><p>-Recovering the packaging for subsequent recycling.</p><p>-Reconditioning the to-be-wasted food into a sellable product that can be used as feed material for animals or as fuel for biogas/biomass power plants.</p><p>The process envisioned by SORT is complex and involves several parties and actors (retail companies, vehicles, machinery for food processing, warehouses, animal feed factories, biogas/biomass power plants, etc.). In order to maximize the earnings and minimize the costs, several decisions must be made during the process, which must take into account several variables and purposes (food items used for reconditioning, maximizing profit, the cost of using machinery for processing, storage costs, etc.). Given the extremely complex nature of the SORT process, a Decision Support Systems (DSS) can be used to aid the process manager to make choices.</p><p>In this paper we present a DSS for the SORT process developed using the Constraint Logic Programming (CLP) paradigm for finding the optimal solution. The knowledge about feed processes and categories was extracted from Regulation (EU) 2017/1017 and stored into an OWL ontology. Information represented in a logical formalism, such as OWL, enables the CLP engine to perform reasoning for finding the best solution.</p><p>The paper is organized as follows. Section 2 illustrates the processing of food articles inside a SORT plant. Section 3 provides some background knowledge of the technologies used for this DSS. In particular, it recalls the main concepts of description logics and Constraint Logic Programming. Section 4 presents the SORT Ontology, used to represent the feed materials and processes. Section 5 illustrates the CLP(FD) model of the DSS. Section 6 shows experimental results on synthetic datasets. Section 7 concludes the paper.</p><p>The food articles to be reused are gathered at large retailers and collection centers, packaged and sent to the so-called SORT plants. Every box of food articles has an RFID chip for identification and tracking. The customers of a SORT plant are feed factories and biogas/biomass power plants, which can make different orders of feed materials.</p><p>Figure <ref type="figure" target="#fig_0">1</ref> shows the process chain of a SORT plant. When the boxes reach the SORT plant, they are opened and their contents are poured into an hopper. Then the Sorter machinery sorts the food articles into other boxes in order to create, if possible, homogeneous boxes, i.e. boxes that contain similar food articles. It is worth noting that, during this phase, the Sorter is not managed by the DSS. The boxes are then stored in an automated warehouse. This phase of the process chain is called input sorting.</p><p>In the warehouse we can have both homogeneous content boxes and heterogeneous content boxes. The presence of boxes with heterogeneous content certainly represents a complication, but also an interesting and stimulating challenge from a computational point of view.</p><p>If the articles contained in a box are selected by the DSS to satisfy an order, that box will be opened and its content will be poured into Sorter's hopper again and each article will be sent to one of the N regular output destinations or sent back, according to the guidelines specified by the DSS. At the end of each output destination there is a box that gathers all the sorted articles. This phase of the process chain is called output sorting. Finally, the selected articles are sent to machinery for unpacking and food processing or sent back to the warehouse.</p><p>Example 1. Consider the case where the SORT plant received two orders, o 1 and o 2 , that request two different types of feed materials and consider the situation depicted in Fig. <ref type="figure" target="#fig_0">1</ref>. Moreover, let us suppose that both o 1 and o 2 must be satisfied. The DSS then assigns the first output destination (out 1) to o 1 and the second output destination (out 2) to o 2 and, at the same time, assigns some of the food articles contained in the boxes with identifiers 5 and 17 to o 1 and some of the articles contained in boxes 17 and 131 to o 2 . Boxes 5, 17 and 131 are then opened and their content is poured into the hopper. The Sorter then sends the articles chosen to satisfy o 1 to out 1 and the articles chosen to satisfy o 2 to out 2.</p><p>It should be noted that in the SORT plant, there is only one sorting line (for the time being). That means that the Sorter machinery depicted in Figure <ref type="figure" target="#fig_0">1</ref> on the left side of the warehouse (input sorting phase) is the same Sorter machinery on the right of the warehouse (output sorting phase). Consequently, during the output sorting phase, the Sorter will not be able to perform the input sorting step, i.e. it cannot process the boxes coming from large retailers and collection centers.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Use cases of the DSS</head><p>The envisaged user of the DSS is the manager of the SORT plant. Its job is to choose, day by day, which orders must be satisfied and which articles must be used to satisfy them in order to maximize the earnings, according to the available articles in the warehouse and to the received orders. These decisions are made with the help of the DSS.</p><p>One of the components of the DSS is a web-based application (still under development) which allows the user to perform the necessary operations to achieve the optimal solutions. We planned four use cases of the DSS:</p><p>1. Manual selection of orders and boxes The user selects which orders must be satisfied that day and which boxes must be used. The DSS assigns each user-selected order to an output destination and uses only the food articles contained in the selected boxes to satisfy them. 2. Manual selection of orders The user selects only the orders that must be satisfied that day. The DSS assigns each selected order to an output destination and uses the articles available in the warehouse to satisfy them. 3. Manual selection of boxes The user selects the boxes and the DSS, according to the optimization criterion, calculates which orders must be satisfied by using only the food articles contained in the selected boxes. 4. Automatic selection The DSS automatically selects the orders to satisfy, i.e. it automatically assigns an output destination to each chosen order, and chooses which articles must be used to satisfy them, according to the optimization criterion.</p><p>3 Background</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Description Logics</head><p>An ontology describes the concepts of the domain of interest and their relations with a formalism that allows information to be processable by machines. The Web Ontology Language (OWL) is a family of knowledge representation languages, based on description logics, for authoring ontologies or knowledge bases. OWL 2 <ref type="bibr" target="#b10">[11]</ref> is the last version of this language and is a W3C recommendation since 2012. We used this logical formalism to represent the knowledge about feed processes and categories. Description Logics (DLs) are fragments of FOL languages used for modeling knowledge bases (KBs) that exhibit nice computational properties such as decidability and/or low complexity <ref type="bibr" target="#b0">[1]</ref>.</p><p>There are many different DL languages that differ in the constructs that are allowed for defining concepts (sets of individuals of the domain) and roles (sets of pairs of individuals). Below we illustrate the ALC DL, which is one of the most common fragments and it is the basis for many other DLs.</p><p>Let us consider a set of atomic concepts C, a set of atomic roles R and a set of individuals I. </p><formula xml:id="formula_0">In ALC a concept C is either C 1 ∈ C, ⊥, , (C 2 C 3 ), (C 2 C 3 ),</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Constraint Logic Programming</head><p>A Constraint Satisfaction Problem (CSP) is defined by a set of variables X = {X 1 , . . . , X n } and a set of constraints C = {C 1 , . . . , C m } <ref type="bibr" target="#b7">[8]</ref>. Each variable X i has a domain D i of possible values. A constraint defines a restriction over the possible combinations of values of a subset of variables. A solution of a CSP is an assignment of values to all variables that satisfies all the imposed constraints. Constraint solving means finding a solution to a given CSP.</p><p>Constraint Programming (CP) is a programming paradigm where the relations among the variables are expressed in the form of constraints. In CP, the user states the constraints and a general purpose constraint solver tries to solve them. Constraint Logic Programming (CLP) is a paradigm of programming languages that merges two declarative paradigms: Logic Programming (LP) and CP.</p><p>A CLP language is defined by the class (sort) of allowable variable domains and constraints. A CLP language over a constraint class X is denoted as CLP(X) <ref type="bibr" target="#b3">[4]</ref>. For instance, CLP(R) is a CLP language in which variables can range on the reals <ref type="bibr" target="#b4">[5]</ref>, whereas in CLP(FD) variables range on finite domains.</p><p>In CLP(X) the constraints of class X can be added to the body of the usual logic programming clauses. During Selective Linear Definite (SLD) resolution, the constraint are not resolved, but they are added to a special data structure, called the constraint store. The store is then processed by an external solver, called constraint solver. The constraint solver checks whether the conjunction of constraints is satisfiable and, in case, modifies the store in order to obtain a simplified state of the variables. The act of modifying the constraint store is known under the term of propagation.</p><p>Besides variables and constraints, the user can also define an objective function: a function that the solver tries to maximize or minimize without violating any constraint. If an objective function is defined, like in our case, then the problem becomes an optimization problem.</p><p>We modelled our problem in Constraint Logic Programming on finite domains (CLP(FD)). Finite domain constraints are usually intended to be arithmetic constraints over finite integer domain variables. Therefore a CLP(FD) language needs a constraint system that is able to handle (i.e. store and propagate) this type of constraints.</p><p>There exist several implementations of logic programming and CLP(FD). For this project we decided to adopt ECL i PS e [7]<ref type="foot" target="#foot_1">5</ref> , which features a library for finite domains called gfd. This library interfaces ECL i PS e with Gecode's constraint solver <ref type="bibr" target="#b9">[10]</ref>. To find the optimal solution we use ECL i PS e 's branch-and-bound approach.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Knowledge Representation of Feed Materials</head><p>Communion Regulation (EU) 2017/1017 is the legislative text in the European Union regarding the production of animal feed. It contains the list of all processes and the list of all categories of feed materials. The list of the processes that feed materials may undergo is illustrated in Part B of the regulatory text, whereas the catalogue of feed materials is given in Part C.</p><p>As already mentioned in Section 3.1, we used the logical formalism OWL 2, based on DLs, to represent the knowledge about feed processes and categories. In particular, we used this regulation to generate an OWL 2 KB, called SORT Ontology, which can be used by the DSS to check the compatibility between an order and a food article.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">SORT Ontology</head><p>Given the large number of processes and categories, we developed a simple program written in Java that parses the XML version of the aforementioned European regulation, and automatically outputs the SORT Ontology.</p><p>The tool allows the SORT system to be easily updated to future regulatory and legal developments. Moreover the ontology supports several languages <ref type="foot" target="#foot_2">6</ref> .</p><p>Figure <ref type="figure">2</ref> shows an excerpt from the SORT Ontology in OWL 2 RDF/XML.</p><p>Representing the knowledge about feed materials and processes by means of an ontology allows to exploit a reasoner to check if an article can be used to &lt; owl : Class rdf : about = " #1 " &gt; &lt; rdfs : subClassOf rdf : resource = " # Feed " / &gt; &lt; rdfs : label xml : lang = " en " &gt; Cereal grains and products derived thereof &lt;/ rdfs : label &gt; &lt; rdfs : label xml : lang = " it " &gt; Cereali e prodotti derivati &lt;/ rdfs : label &gt; ... &lt;/ owl : Class &gt; &lt; owl : Class rdf : about = " #1.1.1 " &gt; &lt; rdfs : subClassOf rdf : resource = " #1 " / &gt; &lt; rdfs : comment xml : lang = " en " &gt; Grains of Hordeum vulgare L . &lt; / rdfs : comment &gt; &lt; rdfs : comment xml : lang = " it " &gt; Grani di Hordeum vulgare L . &lt;/ rdfs : comment &gt; &lt; rdfs : label xml : lang = " en " &gt; Barley &lt;/ rdfs : label &gt; &lt; rdfs : label xml : lang = " it " &gt; Orzo &lt;/ rdfs : label &gt; ... &lt;/ owl : Class &gt; Fig. <ref type="figure">2</ref>. Excerpt from the SORT Ontology in OWL 2 RDF/XML. Here we can see that subcategory 1.1.1 (Barley) is a subclass of category 1 (Cereal grains and products derived thereof). Moreover for each feed category and subcategory there are labels and comments in different languages.</p><p>satisfy an order (see Compatible function in Eq. 1 Section 5). Moreover, it allows to obtain new information about food articles by exploiting other ontologies (see the Open Food Facts project (https://world.openfoodfacts.org/).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">CLP Model</head><p>In this section we illustrate the CLP model of the DSS and the Prolog implementation of some constraints.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Variables</head><p>The variables of our model are the list of orders O = {o 1 , . . . , o K } and the list of food articles A = {a 1 , . . . , a M }, where K and M are the number of orders and articles, respectively. As we mentioned in Section 2, the sorting line, during the output sorting phase, can have N regular outputs (plus a special output for articles that should go back to the warehouse), therefore the domain of an order variable is ∀i ∈ {1, . . . , K} o i ∈ {0, . . . , N } where 0 means that the order will not be satisfied. Each article, instead, can be used to satisfy one and only one order. Therefore the domain of an article variable contains the order indices plus the values -1 and 0: ∀j ∈ {1, . . . , M } a j ∈ {−1, . . . , K} where 0 means "stay", i.e. the article is not associated with any order and stays in the warehouse without moving, whereas -1 represents "go back", i.e. the article goes through the Sorter but it will be sent back to the warehouse. For instance, a j = i with i &gt; 0 means that the j-th food article will be used to satisfy the i-th order. a j = 0 means that the j-th food article will not be used, whereas a j = −1 means that the box which contains a j will be opened, some of its articles will be used to satisfy some orders, but the j-th article will not be used and it should go back in the warehouse.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Constraints</head><p>We can split the constraints of our model into three categories: article constraints, order constraints and constraints for symmetry breaking.</p><p>Article Constraints Here we illustrate the constraints relating food articles to the boxes that contain them. In particular, these constraints are used to maintain the consistency of the warehouse.</p><p>The first article constraint simply states that articles can't be associated with incompatible orders</p><formula xml:id="formula_1">∀j ∈ {1, . . . , M } ∀i ∈ {1, . . . , K} ¬Compatible(a j , o i ) ⇒ a j = o i<label>(1)</label></formula><p>where Compatible(a j , o i ) is a function which checks if article belongs to a feed category compatible with the feed category requested by an order. To check the compatibility between an order and a food article a DL reasoner and the SORT Ontology described in Section 4 can be exploited. In order to save time, these compatibility checks can be performed before running the CLP engine. For instance, we could build a dictionary where each order is associated with a list of compatible articles and then search the best solution.</p><p>In the SORT environment, each order consists of a requested quantity of only one feed material and each article belongs to only one feed category. For this scenario, our DSS does not perform any reasoning task, at least for now. Function Compatible checks if feed category of the order matches with the feed category of the article. However, in the future, for more complex scenarios, ontological reasoning might be necessary.</p><p>The following constraint is fundamental to preserve the consistency of the boxes contained in the warehouse. In fact, once a box is opened, all of its contents are poured into the hopper before the Sorter and therefore all the items contained in that box must be sorted by the Sorter (one of the possible destinations could be back to stock). It is not possible to have situations in which an article present in a box goes through the Sorter while the other articles contained in the same box remain in storage.</p><formula xml:id="formula_2">∀j ∈ {1, . . . , M } a j &gt; 0 ⇒ (∀k ∈ {1, . . . , M } Box (a j ) = Box (a k ) ⇒ a k = 0) (2)</formula><p>where Box (a j ) is a function which returns the identifier of the box which contains the article associated with the variable a j .</p><p>The following constraint, instead, states that if an article is associated with an order, then that order must have a destination greater than 0 ∀j ∈ {1, . . . , M } (a j = i, i &gt; 0) ⇒ o i &gt; 0</p><p>(3)</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Order Constraints</head><p>The following constraint states that is not possible for two distinct order to share the same destination if they will be both satisfied</p><formula xml:id="formula_3">∀i ∈ {1, . . . , K} o i &gt; 0 ⇒ ∀k ∈ {1, . . . , K} o i = o k (4)</formula><p>This constraint was implemented by imposing an atmost/3 constraint to the order variables for each possible destination where NDest is the number of possible destinations N , i.e. the possible outputs of the sorter, and OrderDestinations is the list of the order variables.</p><p>If the i-th order must be satisfied (o i &gt; 0), then enough food product must be available</p><formula xml:id="formula_4">∀i ∈ {1, . . . , K} o i &gt; 0 ⇒ aj =i Quantity(a j ) ≥ Quantity(o i )<label>(5)</label></formula><p>where Quantity(•) is a function which returns the quantity of food product contained (requested) in an article (by an order). If there is not enough food product to satisfy an order, then the order is unsatisfiable and for sure its destination will be "stay" ∀i ∈ {1, . . . , K} Compatible(aj ,oi)</p><formula xml:id="formula_5">Quantity(a j ) &lt; Quantity(o i ) ⇒ o i = 0 (6)</formula><p>The following constraint fixes an upper limit of food product that must be used to satisfy an order. It states that the sum of the quantities of food product contained in the articles used to satisfy an order must not exceed the quantity requested by an order plus a surplus quantity of food.</p><formula xml:id="formula_6">∀i ∈ {1, . . . , K} o i &gt; 0 ⇒ aj =i Quantity(a j ) ≤ Quantity(o i ) + Surplus<label>(7)</label></formula><p>In our model we fixed the surplus quantity to 5 kg.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Symmetry Breaking Constraints</head><p>In order to improve the search, we prune the search space by imposing the following "symmetry breaking" constraints which remove equivalent or symmetric solutions.</p><p>Example 2 (Equivalent solutions). Consider the case where we have three order variables: o 1 , o 2 and o 3 and the number of regular outputs of the Sorter is N . Suppose there exists a feasible solution</p><formula xml:id="formula_7">{o 1 = 1, o 2 = 0, o 3 = 0}</formula><p>Since we can associate an order with any output of the Sorter, other solutions could be</p><formula xml:id="formula_8">{o 1 = 2, o 2 = 0, o 3 = 0} . . . {o 1 = N, o 2 = 0, o 3 = 0}</formula><p>We have N equivalent solutions.</p><p>To prune the search space and avoid situations like the one described in Example 2, we impose that the maximum destination value that an order variable can have is the number of orders that are going to be satisfied (i.e. the number of order variables greater than 0)</p><formula xml:id="formula_9">oi&gt;0 1 = S = max i o i (<label>8</label></formula><formula xml:id="formula_10">)</formula><p>Example 3 (Symmetric solutions). Consider the case where we have three order variables: o 1 , o 2 and o 3 and the number of regular outputs of the Sorter is N and constraint 8 has been added in the model. Suppose there exists a feasible solution</p><formula xml:id="formula_11">{o 1 = 1, o 2 = 2, o 3 = 0}</formula><p>A solution symmetric w.r.t. the one above is</p><formula xml:id="formula_12">{o 1 = 2, o 2 = 1, o 3 = 0}</formula><p>Symmetries like the one described in Example 3 can be broken by imposing a total order to the order variables</p><formula xml:id="formula_13">∀i, j ∈ 1, . . . , K i &lt; j, o i &gt; 0, o j &gt; 0 ⇒ o i &lt; o j<label>(9)</label></formula><p>This constraint can be simply imposed by exploiting the global constraint precede/3</p><p>numlist (1 , NDest , DestinationList ) , precede ( DestinationList , OrderDestinations ) .</p><p>where NDest is the number of possible destinations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">Objective function</head><p>The aim of the DSS user is maximize the earnings and minimize the costs. In particular the user wants to maximize the incomes obtained by satisfying the orders, while minimizing the storage costs, the penalties that must be paid if the orders are not delivered on time and the processing cost, i.e. the cost for using machinery for sorting, unpacking and food processing. So far, to compute the processing cost, only the sorting cost is taken into account.</p><p>In order to obtain an optimal solution, we define in our model the following objective function that should be maximized</p><formula xml:id="formula_14">Profit = oi&gt;0 Income(o i ) − UnusedArticlesCost − LatePenalty − SortingPenalty<label>(10)</label></formula><p>where the function Income(o i ) returns the income obtainable by satisfying the i-th order. UnusedArticlesCost is the cost of keeping the unused articles one more day in the storage and it is defined as</p><formula xml:id="formula_15">UnusedArticlesCost = aj ≤0 StorageCost(a j )<label>(11)</label></formula><p>where StorageCost(a j ) is a function which returns the daily storage cost of the j-th article.</p><p>LatePenalty is the cost of not satisfying not even today those order whose deadlines were missed and it is defined as</p><formula xml:id="formula_16">LatePenalty = oi∈LateOrders LateOrderPenalty(o i ) • DaysLate(o i ) (<label>12</label></formula><formula xml:id="formula_17">)</formula><p>where LateOrders is the set of orders with expired deadline, LateOrderPenalty(o i ) is a function which returns the penalty for being one day late to satisfy the i-th order and DaysLate(o i ) returns the number of delay days. SortingPenalty is a penalty for all those articles that must "go back" and therefore should go through the sorter machine once again. So far, this is the only cost taken into account. It is defined as</p><formula xml:id="formula_18">aj =−1 ArticleSortingPenalty(a j )<label>(13)</label></formula><p>where ArticleSortingPenalty(a j ) returns the penalty of sorting once more the j-th article.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.4">Search</head><p>To find the optimal solution we use the predicate bb_min/3, which performs a branch-and-bound algorithm. We separated the search for article and order variables, in order to allow the use of different heuristics for the two lists of variables. In the two predicates gfd_search:search/6, SelectOrderVars and SelectArticleVars are the variable selection methods for orders and articles respectively; ChoiceOrderVars and ChoiceArticleVars are the choice methods; MethodOrderVars and MethodArticleVars are the search methods. Among the available options of bb_min we have Timeout, that is the timeout of the optimization process (its default value is 0, i.e. infinite time), Delta, which is the minimal absolute improvement of Cost required for each step (default value is 10000), and Strategy, which is the optimization strategy used to find the best solution.</p><p>In order to improve the performances of the search, we developed a custom variable selection method, called select_income. Considering that the system sorts the list of orders in descending order by profit, if this heuristics is chosen for order variables, the order with the least value greater than zero is selected, which corresponds to the order with the greatest income. If this heuristics is chosen for article variables, the article that can be used for the most profitable order is selected. first gt zero/2 unifies Elem with the first value in the domain greater than 0, if there is not such values it unifies Elem with 0.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Experiments</head><p>A prototypical plant is under development in the SORT project. In the meanwhile, since real data about orders and article is still not available, to test the system we generated synthetic random datasets with 30 orders whose incomes vary from 10,000 to 500,000 and an increasing number of articles. The size of the datasets is expressed in number of articles. The quantity of food product of each article randomly varies from 500 g to 5 kg. Whereas the quantity of requested feed material for each order varies from 50 kg to 100 kg.</p><p>We performed two types of experiments. In the first a complete search in the space of solutions is performed, by taking into account different configurations and strategies. In the second we set a timeout of 15 seconds and the obtained solutions are compared with the optimal solutions found with complete search. For all the experiments we set the sorting penalty to 0 and in the predicate bb_min/3 we set the option delta to 10,000.</p><p>In these tests we evaluated our system by combining several heuristics and strategies for search and optimization. However, due space limitations it was impossible to show the results for each heuristics combination. Table <ref type="table" target="#tab_1">1</ref> shows some of the heuristics combinations used in our tests whose results are reported in this paper<ref type="foot" target="#foot_3">7</ref> . All the tests were performed on the HPC System Marconi<ref type="foot" target="#foot_4">8</ref> equipped with Intel Xeon E5-2697 v4 (Broadwell) @ 2.30 GHz, using 1 core for each test.</p><p>Test 1: complete search We consider a number of articles from 100 to 400 in steps of 100 and, for each number of articles, we generated 5 datasets.</p><p>Table <ref type="table" target="#tab_2">2</ref> reports the average CPU time in seconds for finding the optimal solution for 5 different random datasets with the combinations of heuristics illustrated in Table <ref type="table" target="#tab_1">1</ref>. We set a timeout of 1 hour, so the cells with "-" indicate that the timeout occurred at least in one dataset. The results showed that the adopted heuristics affect the computational time. In particular, among all the heuristics combinations used for Test 1 only Comb. 1 and 2 were able to scale up to 500 articles and both combinations use the custom variable selection method select_income for the article variables.</p><p>Test 2: search with timeout It might be infeasible for the user to wait too long for the best solution. Sometimes a solution which is suboptimal but obtained quickly is the best thing for rapid decision making. To evaluate the behaviour of our system in these scenarios, for each dataset we run the CLP engine twice. In the first execution the optimal solution is found by performing a complete search by using Comb. 1 (Table <ref type="table" target="#tab_1">1</ref>) and a timeout of 24 hours. In the second one, instead, we set a timeout of 15 seconds and we bounded the backtracking search steps to 1000. Then the (suboptimal) solutions obtained in the second run are compared with the optimal solutions found with complete search in the first run.</p><p>We consider a number of articles from 500 to 1000 in steps of 100 and, for each number of articles, we generated 5 datasets.</p><p>The suboptimal solutions are evaluated using the Mean Absolute Percentage Error (MAPE) as metrics. The MAPE between the optimal solution obtained with a complete search (S optimal i ) and the solution obtained with a search with timeout (S timeout where N is the number of datasets in which the complete optimization search did not reach the timeout. Table <ref type="table" target="#tab_3">3</ref> shows that with datasets containing more than 600 articles the complete optimization search becomes infeasible, whereas with an approximate approach for each dataset we obtained at least a suboptimal solution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Conclusions</head><p>In this paper we presented a DSS which exploits the Constraint Logic Programming paradigm and supports ontology reasoning for finding the optimal solution, given the availability of articles in the warehouse of the SORT plant.</p><p>The experiments showed that CLP is a valid approach for modelling and solving complex problems such as the SORT process.</p><p>In the future, we plan to integrate a DL reasoner in our DSS in order to tackle more complex scenarios (e.g. scenarios where orders can request mixtures of feed materials), complete the development of its web interface and test our DSS with real data on a prototype of the SORT plant. So far, in our model, every article has the same storage cost, however there are different type of warehouses (refrigerated, room temperature, etc.); in the future we plan to use different storage costs depending on the warehouse in which the article was stored. Moreover we will take into account costs for using machinery for unpacking and food processing. We would also like to extend our model by taking into account not only articles already in stock, but also those currently being transported to the SORT plant.</p><p>In our approach we used ECL i PS e for representing the constraints and Gecode to solve them, it could be interesting to encode our problem with MiniZinc <ref type="bibr" target="#b5">[6]</ref> and compare the two approaches. A completely different approach could be to exploit (Mixed) Integer Programming methods: encode the problem as a linear problem and solve it with a linear optimiser, such as Gurobi <ref type="bibr" target="#b1">[2]</ref>. We reserve the implementations of these different approaches as future work.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. SORT chain. Every box in the warehouse has RFID chip with a unique identifier.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>¬C, ∃R.C or ∀R.C, where C 2 and C 3 are concepts and R ∈ R. A TBox T is a finite set of concept inclusion axioms C D, where C and D are concepts. An ABox A is a finite set of concept membership axioms a : C, role membership axioms (a, b) : R, equality axioms a = b and inequality axioms a = b, where C ∈ C, R ∈ R and a, b ∈ I. A ALC KB K = (T , A) consists of a TBox T and an ABox A. It is usually assigned a semantics in terms of interpretations I = (∆ I , • I ), where ∆ I is a non-empty domain and • I is the interpretation function, which assigns an element in ∆ I to each a ∈ I, a subset of ∆ I to each concept and a subset of ∆ I × ∆ I to each role.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head></head><label></label><figDesc>: Timeout , delta : Delta , strategy : Strategy } )</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head></head><label></label><figDesc>select_income ( Var , Elem ) : -get_domain_as_list ( Var , Domain ) , first_gt_zero ( Domain , Elem ) .</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>Table 1 .</head><label>1</label><figDesc>Subset of the possible combinations of heuristics and strategies for search and optimization.</figDesc><table><row><cell>Order</cell><cell>Order</cell><cell>Opt.</cell></row><row><cell>Select</cell><cell>Choice</cell><cell>strategy</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_2"><head>Table 2 .</head><label>2</label><figDesc>Average CPU time (in seconds) for the search of the optimal solution with different configurations (Test 1) for each dataset size. "-" means that the execution timed out (1 h) in one dataset at least.</figDesc><table><row><cell>Heuristics 100</cell><cell>200</cell><cell>300</cell><cell>400</cell></row><row><cell>Comb. 1 0.154</cell><cell>0.38</cell><cell cols="2">1.024 1.726</cell></row><row><cell cols="4">Comb. 2 0.146 0.372 1.046 1.862</cell></row><row><cell cols="3">Comb. 3 0.126 0.328 0.980</cell><cell>-</cell></row><row><cell cols="3">Comb. 4 0.132 0.416 0.994</cell><cell>-</cell></row><row><cell>Comb. 5 0.160</cell><cell>-</cell><cell>-</cell><cell>-</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_3"><head>Table 3 .</head><label>3</label><figDesc>MAPE between the optimal solutions and the suboptimal solutions obtained with limited search by adopting different configurations for each dataset size (Test 2). "-" means that the complete optimization search timed out (24 h) at least in one of the 5 datasets and it was impossible to perform comparisons.</figDesc><table><row><cell cols="2">Heuristics 500</cell><cell>600</cell><cell>700</cell><cell>800</cell><cell>900</cell><cell>1000</cell></row><row><cell>Comb. 1</cell><cell>0.59</cell><cell>0</cell><cell>-</cell><cell>-</cell><cell>-</cell><cell>-</cell></row><row><cell>Comb. 2</cell><cell>0.59</cell><cell>0</cell><cell>-</cell><cell>-</cell><cell>-</cell><cell>-</cell></row><row><cell>Comb. 3</cell><cell>1.03</cell><cell>0.76</cell><cell>-</cell><cell>-</cell><cell>-</cell><cell>-</cell></row><row><cell>Comb. 4</cell><cell>1.03</cell><cell>0.76</cell><cell>-</cell><cell>-</cell><cell>-</cell><cell>-</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_0">The SORT project is promoted by the Italian Ministry of Education, Universities and Research. Code: SCN 00367, Ministerial Act n. 2427 http://attiministeriali. miur.it/anno-2015/ottobre/dd-28102015-(1).aspx.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_1">http://eclipseclp.org</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_2">Currently supported: Italian, English, Spanish, French and German.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_3">The results for other combinations are shown here: https://goo.gl/J4DWiu.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="8" xml:id="foot_4">http://www.hpc.cineca.it/hardware/marconi</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Acknowledgement This work was supported by the SORT project, promoted by the Italian Ministry of Education, Universities and Research. Code: SCN 00367, Ministerial Act n. 2427.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<author>
			<persName><forename type="first">F</forename><surname>Baader</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Horrocks</surname></persName>
		</author>
		<author>
			<persName><forename type="first">U</forename><surname>Sattler</surname></persName>
		</author>
		<title level="m">Description Logics</title>
				<meeting><address><addrLine>Amsterdam</addrLine></address></meeting>
		<imprint>
			<publisher>Elsevier</publisher>
			<date type="published" when="2008">2008</date>
			<biblScope unit="volume">3</biblScope>
			<biblScope unit="page" from="135" to="179" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<author>
			<persName><forename type="first">L</forename><surname>Gurobi Optimization</surname></persName>
		</author>
		<ptr target="http://www.gurobi.com" />
		<title level="m">Gurobi optimizer reference manual</title>
				<imprint>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<author>
			<persName><forename type="first">J</forename><surname>Gustavsson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Cederberg</surname></persName>
		</author>
		<author>
			<persName><forename type="first">U</forename><surname>Sonesson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Van Otterdijk</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Meybeck</surname></persName>
		</author>
		<ptr target="http://www.fao.org/docrep/014/mb060e/mb060e00.pdf" />
		<title level="m">Global food losses and food waste: extent, causes and prevention</title>
				<imprint>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Constraint logic programming</title>
		<author>
			<persName><forename type="first">J</forename><surname>Jaffar</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">L</forename><surname>Lassez</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages</title>
				<meeting>the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages</meeting>
		<imprint>
			<publisher>ACM Press</publisher>
			<date type="published" when="1987">1987</date>
			<biblScope unit="page" from="111" to="119" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">The clp (r) language and system</title>
		<author>
			<persName><forename type="first">J</forename><surname>Jaffar</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Michaylov</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">J</forename><surname>Stuckey</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">H</forename><surname>Yap</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM T. Prog. Lang. Sys</title>
		<imprint>
			<biblScope unit="volume">14</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="339" to="395" />
			<date type="published" when="1992">1992</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Minizinc: Towards a standard cp modelling language</title>
		<author>
			<persName><forename type="first">N</forename><surname>Nethercote</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">J</forename><surname>Stuckey</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Becket</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Brand</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">J</forename><surname>Duck</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Tack</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Principles and Practice of Constraint Programming</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2007">2007</date>
			<biblScope unit="page" from="529" to="543" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<title level="m" type="main">A Gentle Guide to Constraint Logic Programming via ECL i PS e</title>
		<author>
			<persName><forename type="first">A</forename><surname>Niederliński</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2015">2015</date>
		</imprint>
		<respStmt>
			<orgName>Jacek Skalmierski Computer Studio</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">J</forename><surname>Russell</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Norvig</surname></persName>
		</author>
		<title level="m">Artificial intelligence: a modern approach</title>
				<imprint>
			<publisher>Pearson</publisher>
			<date type="published" when="2016">2016</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<monogr>
		<title level="m" type="main">Estimates of european food waste levels</title>
		<author>
			<persName><forename type="first">Å</forename><surname>Stenmarck</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Jensen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Quested</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Moates</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2016">2016</date>
		</imprint>
		<respStmt>
			<orgName>IVL Swedish Environmental Research Institute</orgName>
		</respStmt>
	</monogr>
	<note type="report_type">Tech. rep</note>
</biblStruct>

<biblStruct xml:id="b9">
	<monogr>
		<author>
			<persName><forename type="first">G</forename><surname>Team</surname></persName>
		</author>
		<ptr target="http://www.gecode.org" />
		<title level="m">Gecode: Generic constraint development environment</title>
				<imprint>
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<monogr>
		<ptr target="http://www.w3.org/TR/2012/REC-owl2-overview-20121211/" />
		<title level="m">W3C: OWL 2 Web Ontology Language</title>
				<imprint>
			<date type="published" when="2012">12. 2012</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
