<?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">Solving hypertree structured CSP : Sequential and parallel approaches</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Mohammed</forename><surname>Lalou</surname></persName>
							<email>mohammed.lalou@gmail.com</email>
							<affiliation key="aff0">
								<orgName type="institution">University of Bejaia</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Zineb</forename><surname>Habbas</surname></persName>
							<affiliation key="aff1">
								<orgName type="laboratory">LITA</orgName>
								<orgName type="institution">University of Metz</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Kamal</forename><surname>Amroun</surname></persName>
							<email>k−amroun25@yahoo.fr</email>
							<affiliation key="aff2">
								<orgName type="institution">University of Bejaia</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">Solving hypertree structured CSP : Sequential and parallel approaches</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">4C20C50ECA014AA2FA541FE59902B2CC</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T03:56+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>Solving CSP is in general N P-Complete. However, there are various subsets of CSPs that can be solved in polynomial time. Some of them can be identified by analyzing their structure. Unfortunately the proposed methods for exploiting these structural proprieties are not efficient in practice. So exploiting these structural properties for solving CSP∫ is a crucial challenge. In this paper, we propose efficient algorithms which exploit these structural proprieties, for both sequential and parallel resolutions. Some experiments done on academic benchmarks show the efficiciency of our approach.</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>A CSP consists of a set V of variables, the domains D of these variables and a set C of constraints over these variables. The objective is to assign values in D to the variables in such a way that all constraints are satisfied. CSP∫ are known to be N P-Complete. Considerable efforts have been made to identify tractable classes. One approach is based on exploiting structural properties of the constraints network. If the CSP is tree structured then it can be solved in polynomial time. Many techniques have been developed to transform a CSP into a tree or an equivalent hypertree structured CSP, we can cite <ref type="bibr" target="#b3">[4,</ref><ref type="bibr" target="#b5">6,</ref><ref type="bibr" target="#b0">1]</ref>. The Generalized Hypertree Decomposition method is the most general method. However the algorithm proposed to solve the hypertree structured CSP is not efficient in practice. In this work, we propose to improve this algorithm. Mainly we propose two algorithms: an improved sequential algorithm and a parallel algorithm. The sequential algorithm is based on the hashing technique, while the parallel algorithm explores the pipeline technique and the parallel tree contraction algorithm between the nodes to achieve the semi-join operation. In order to validate our proposition we first compare the sequential algorithm proposed in this paper with the basic algorithm proposed in <ref type="bibr" target="#b4">[5]</ref> . Based on some experiments done on benchmarks from the literature, we observed a promising gain in terms of cpu time with our sequential approach. More particularly, good results are observed when large size relations are considered. To validate our parallel algorithm, we have proposed a simulation model using logical time assumptions. The experimental results outline the practical efficiency of this algorithm and its performances in term of space memory. This paper is organized as follows : section 2 gives preliminaries of constraint satisfaction problems and well known CSP decomposition methods by developing more particulary the (generalized) hypertree decomposition method which is the most general one. In section 3, we present our sequential algorithm called S HBR (for Sequential Hash Based Resolution) which solves the hypertree structured CSP and we give some experiments of our proposition with respect to the algorithm proposed in <ref type="bibr" target="#b4">[5]</ref>. In section 4, we present our parallel algorithm and in section 5, we give some experimental results of this algorithm. Finally, in section 6, we give our conclusion and some perspectives to this work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminary notions</head><p>The notion of Constraint Satisfaction Problem CSP was introduced by <ref type="bibr" target="#b6">[7]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 1. Constraint Satisfaction Problem:</head><p>A constraint satisfaction problem is defined as a 3-tuple P = X, D, C where :</p><formula xml:id="formula_0">X = {x 1 , x 2 , ..., x n } is a set of n variables. D = {d 1 , d 2 , ..., d n } is a set of finite domains; a variable x i takes its values in its domain d i . C = {C 1 , C 2 , ..., C m } is a set of m constraints. Each constraint C i is a pair (S(C i ), R(C i )) where S(C i ) ⊆ X, is a subset of variables, called scope of C i and R(C i ) ⊂ x k ∈S(C) i ) d k is the constraint relation,</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>which specifies the allowed values combinations.</head><p>A solution of a CSP is an assignment of values to variables which satisfies all constraints.</p><p>Definition 2. Hypergraph: The constraint hypergraph <ref type="bibr" target="#b1">[2]</ref> of a CSP P =&lt; X, D, C &gt; is given by H =&lt; V, E &gt; where E is a set of hyperedges corresponding to the scopes of the constraints in C, V is the set of variables of P.</p><p>In this paper, hyperedges(H) is the set of the hyperedges of the hypergraph H. If h is a hyperedge, then var(h) is the set of variables of h. Definition 3. A join tree for a hypergraph H is a tree T whose nodes are the hyperedges of H, such that, when a vertex v of H occurs in two hyperedges e1 and e2 then v occurs in each node of the unique path connecting e1 and e2 in the tree T. Definition 4. Hypertree: A hypertree for a hypergraph H is a triple &lt; T, χ, λ &gt; where T = (N, E) is a rooted tree, and χ and λ are labelling functions which associate each vertex p ∈ N with two sets χ(p) ⊆ var(H) and λ(p) ⊆ hyperedges(H). If T = (N , E ) is a subtree of T, we define χ(T ) = v∈N χ(v). We denote the set of vertices N of T by vertices(T) and the root of T by root(T). T p denotes the subtree of T rooted at the node p. Proposition 1. A CSP whose structure is acyclic can be solved in polynomial time <ref type="bibr" target="#b5">[6]</ref>.</p><p>The goal of all structural decomposition methods is to transform a CSP into an equivalent acyclic CSP which can be solved in polynomial time. A decomposition method D associates to each hypergraph H a parameter D-width called the width of H. The method D ensures that for a fixed k, each CSP instance with D-width ≤ k is tractable and then can be solved in polynomial time. Among these methods, the generalized hypertree decomposition (GHD) dominates all the other structural decomposition methods. In the next paragraph, we present the (generalized) hypertree decomposition method. Definition 5. A generalized hypertree decomposition <ref type="bibr" target="#b9">[10]</ref> of a hypergraph H =&lt; V, E &gt;, is a hypertree HD =&lt; T, χ, λ &gt; which satisfies the following conditions :</p><p>1. For each edge h ∈ E, there exists p ∈ vertices(T ) such that var(h) ⊆ χ(p). We say that p covers h.</p><p>2. For each variable v ∈ V , the set {p ∈ vertices(T )|v ∈ χ(p)} induces a connected subtree of T.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">For each vertex p ∈ vertices(T ), χ(p) ⊆ var(λ(p)).</head><p>A hypertree decomposition of a hypergraph H =&lt; V, E &gt;, is a generalized hypertree decomposition HD =&lt; T, χ, λ &gt; which additionally satisfies the following special condition :</p><formula xml:id="formula_1">For each vertex p ∈ vertices(T ), var(λ(p)) χ(T p ) ⊆ χ(p).</formula><p>The width of a (generalized) hypertree decomposition &lt; T, χ, λ &gt; is max p∈vertices(T ) |λ(p)|. The (generalized) hypertree width (g)hw(H) of a hypergraph H is the minimum width over all its (generalized) hypertree decompositions.</p><p>A hyperedge h of a hypergraph H = V, E is strongly covered in HD = T , χ, λ if there exists p ∈ vertices(T ) such that the vertices in h are contained in χ(p) and h ∈ λ(p). A (generalized) hypertree decomposition HD = T , χ, λ of H = V, E is called complete if every hyperedge h of H is strongly covered in HD.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">A sequential algorithm 3.1 The basic algorithm</head><p>The sequential resolution of a CSP represented by its hypertree decomposition is given by the following algorithm <ref type="bibr" target="#b4">[5]</ref> (see algorithm 1), called in this paper B A algorithm (for Basic algorithm).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithm 1 B A algorithm</head><p>1: Input : HD = T , χ, λ 2: step1: complete the hypertree decomposition HD 3: step2: Solve each λ-term using multi-join operation. 4: step3: Solve the resulting CSP using semi-join operation. 5: Output: A solution of the given problem.</p><p>The second step consists in Solving each sub-problem represented as the λ-term in each node of the hypertree. As a result, we have a new hypertree whose the λ-terms are replaced by a unique constraint relation R p corresponding to the projection on the variables in χ(p) of the join of the constraint relations in λ(p). More formally Rp = ( t∈λ(p) t) <ref type="bibr">[χ(p)</ref>]. This operation is expensive. The third step consists in semi-join operation which is an other expensive operation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">The S HBR algorithm</head><p>Some notations : ϑ i represents the intersection variables of the constraint C i with the set of all variables in the union of C j where j &lt; i in a given order. HT i is the hash table associated to R i .</p><p>The S HBR for Sequential Hash Based Resolution algorithm, is formally presented by Algorithm 2. It proceeds in two steps : The SP HBR for Sub Problem Hash Based Resolution algorithm (lines 3 to 6 ) is the optimization of the join operation. The A HBR for (Acyclic Hash Based Resolution) algorithm (line7) is an optimization of the classical Acyclic solving algorithm <ref type="bibr" target="#b2">[3]</ref>.</p><p>We now give more details about SP HBR and A HBR algorithms. a) SP HBR algorithm: The result of the SP HBR execution is a join-tree whose every node n contains only one table R n composed of the tuples satisfying all sub-problems constraints. Nodes of this join-tree are represented as follows: R n = χ(p), Hrel(p) where χ(p) is the set of variables of the node p, and Hrel(p) is the constraint relation generated by the join operation. Additionally, for the leaves nodes, Hrel(p)'s tuples are hashed on intersection variables with the parent node of p. This algorithm decomposes each node of the join tree into connected components. Then it applies the join operation algorithm for each component using the hash join Algorithm 2 Sequential hash Based Resolution(S HBR)</p><p>1: Input: a hypertree &lt; T , χ, λ &gt; of a hypergraph &lt; H = V, E &gt; where T is a tree, χ associates to each t of T a set of nodes χ(t) ⊂ V , and λ, a set of arcs λ(t) ⊂ E 2: Output : A solution. Apply the SP HBR algorithm on the node n. 6: end for 7: Step2: Apply A HBR algorithm on T .</p><p>principle. For doing that, we establish an order among relations in the same component. Then, we hash each relation R i of the constraint C i , except the first one, on intersection variables with the relations of the constraints that are before C i in this order. The join operation is applied using the Join procedure. These procedures cannot be described in this paper for restricted space reason. We illustrate SP HBR by the following example.</p><p>Example 1. We consider a node p of a hypertree HD labelled as follows:</p><formula xml:id="formula_2">λ(p) = {C 1 , C 2 , C 3 , C 4 , C 5 , C 6 }, with: S(C 1 ) = {a, b, c}, S(C 2 ) = {i, j}, S(C 3 ) = {a, d}, S(C 4 ) = {d, b, f }, S(C 5 ) = {f, g}, S(C 6 ) = {i, k}.</formula><p>There are two connected components</p><formula xml:id="formula_3">R 1 = {C 1 , C 3 , C 4 , C 5 } and R 2 = {C 2 , C 6 }.</formula><p>According to the order of the constraints in each component, we have:</p><formula xml:id="formula_4">ϑ 3 = S(C 3 ) ∩ S(C 1 ) = {a}, ϑ 4 = S(C 4 ) ∩ {S(C 1 ) ∪ S(C 3 )} = {b, d}, ϑ 5 = S(C 5 ) ∩ {S(C 1 ) ∪ S(C 3 ) ∪ S(C 4 )} = {f }, ϑ 6 = S(C 6 ) ∩ S(C 2 ) = {i}.(if C</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>is a hyperedge, then S(C) denotes the scope of C).</head><p>Therefore, for the first component, the R 3 's tuples will be hashed on the set of intersection variables ϑ 3 = {a}, those of R 4 and R 5 on, respectively, ϑ 4 = {b, d} and ϑ 5 = {f }. For the second component, the tuples of R 6 will be hashed on ϑ 6 = {i}. After computing a cartesian product of the components, the resulting tuples t are hashed according to the intersection variables with the parent node of p, if p is a leaf. So, t will be ready for the semi-join operation in A-HBR algorithm. We do not add t to its related partition P unless if P = φ. Thus, we will have one and only one tuple in each partition by eliminating the duplicated tuples. This elimination has no impact on the resolution because, for the A-HBR algorithm, each parent node is filtered on its sons <ref type="foot" target="#foot_1">1</ref> . Moreover, we are interested to get only one solution for the CSP.</p><p>b) The A HBR algorithm: The A HBR algorithms tests the consistency of a constraint acyclic network and generates a solution if it exists. This algorithm takes the hypertree resulting from the SP HBR algorithm as its input. The A HBR algorithm (see. Algorithm 3 ) proceeds in two steps: the CONTRACT step and the S SEARCH step. The first step contracts the deep-rooted hypertree HT . A semi-join operation is associated to each contraction operation. The result is a directional from root toward leaves arc consistent hypertree HT (line 3). The second step is the solution search operation, which develops the solution from the HT 's root to leaf nodes (line 4).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithm 3 Acyclic Hash Based Resolution algorithm (A HBR)</head><p>1: Input: A hypertree HT = T , χ, λ 2: Output : Determine a directional arc consistent and generate a solution. The CONTRACT algorithm strengths the directional arc consistency of the input hypertree. Given a hypertree, a contraction operation is realized between each leaf node and its parent. For each contraction operation we hash each tuple t of a parent node (p) relation on intersection variables with its sons leaves nodes a i . We denote h i the hashed values. If a i 's hash tables partitions related to h i are not empty , we hash t on intersection variables of p with its parent node and save it. Otherwise, we eliminate t. The leaves nodes a i are marked and considered as pruned. We make the same with the obtained hypertree, and so on, until all the nodes, excepted the root, will be marked. The final result of the contraction operation of a parent node p with its sons leaves nodes, is a node p = χ(p ), Hrel(p ) , whose relation is arc consistent with those of the son nodes relations, and hashed on the intersection variables of p with its parent node. If the hashed relation Hrel(p ) is empty, the problem has no solution. The S SEARCH algorithm is a classical Backtrack free algorithm applied to the directional arc consistent hypertree resulting from the CONTRACT algorithm execution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Complexity of S HBR</head><p>The complexity of the SP HBR algorithm is</p><formula xml:id="formula_5">h−1 i=1 (r * P i ) (<label>1</label></formula><formula xml:id="formula_6">)</formula><p>Where r is the the maximum relation size, h is the hypertree width, P is the maximum number of tuples in the partition of hashing on the variables of ϑ (ϑ represents the intersection variables of C i with all variables in C j where j &lt; i ). For the A HBR algorithm, its complexity is O(nP<ref type="foot" target="#foot_2">2</ref> ). Where n is the number of constraints in the obtained CSP. But in our case, we have only one tuple by partition, so the complexity of A HBR algorithm is only O(n).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Experiments</head><p>We have implemented the S HBR algorithm and the basic algorithm <ref type="bibr" target="#b4">[5]</ref> (noted here B A). We have tested the two solvers on a set of CSP benchmarks. This benchmarks collection is represented using the new XCSP 2.1 format proposed by The organizational committee of the 3 th international competition of the CSPs solvers </p><formula xml:id="formula_7">f (t) = n i=1 ((x i + 1) * 10 ln(f (t))+1 )<label>(2)</label></formula><p>We observe that S-HBR clearly improves the B A algorithm in terms of CPU time for all the instances. The S HBR algorithm gets more better results for the instances which have large relations, because it browses only a sub-part of the relation rather than the totality one as in B A.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">The parallel Algorithm</head><p>In this section, we introduce a parallel version of our previous sequential algorithm S HBR. We called it P HT R for Parallel Hypertree Resolution algorithm and it is described by the algorithm 4. This algorithm uses both pipeline technique and the parallel tree contraction technique. The pipeline avoids the storage of intermediate results so it reduces the memory space explosion. The parallel tree contraction is the most well known adapted approach for the semi-join operation. However the known parallel The P HT R(algorithm 4) procedure proceeds in two steps. The first one concerns the parallel resolution of sub-problems using the P SBR algorithm (line 4). The second step is the resolution of the whole problem. It is performed using the P Solving algorithm (line 6). P SBR (n) // Apply the P SBR algorithm on the node n. 5: end for 6: P Solving(T') // Apply P Solving algorithm on T (T is the obtained hypertree in the step 3).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">The P SBR algorithm</head><p>The P SBR for Parallel Sub Problem Resolution algorithm uses the hash technique. The P SBR algorithm proceeds as the SP HBR algorithm.</p><p>After establishing an order on the constraints, it builds a pipeline line composed of join operators whose the first relation is the probe relation and the remaining ones are build relations. The join operation is performed according to the hash pipelined join principle. Thus, each build relation is hashed on its intersection variables (ϑ i ) with the union of the previous relations.</p><p>The parallelism in this algorithm is provided by the Pipeline. At each level of the pipeline corresponds a join operation with two operands. The first one is R 1 (the probe relation) for the first operator, R tmp [i − 1] for the i th operator. The second one is the build relation R i for the i th operator. We make a join operation between each tuple of the first operand and all the tuples of the second operand. The obtained tuples from the i th operator are saved in the temporary relation of (R tmp [i + 1]) of the following operator.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">P Solving algorithm</head><p>P Solving algorithm is the parallel version of A HBR algorithm. It consists in two operations, P CON T RACT (for Parallel CONTRACT), and P S SEARCH (for Parallel SEARCH ). The first operation concerns the parallelization of the CONTRACT operation, while the second one corresponds to the parallel version of the S SEARCH operation.</p><p>Algorithm 5 P Solving algorithm 1: Input: A join tree T .</p><p>2: Output : The solution for the problem.</p><p>3: T = P CON T RACT (T ). 4: P S SEARCH(T ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2.1">P CON T RACT algorithm</head><p>The P CON T RACT operation strengths the directional arc consistency in the input hypertree. It is based on two operations, P RAKE (for Parallel RAKE), and P COM P RESS (for Parallel COMPRESS ), where RAKE and COM P RESS are the basic operations of a parallel tree contraction <ref type="bibr" target="#b8">[9]</ref>. We explain these two operations. P RAKE operation: is based on the fact that the existence of only one resource is the reason of the sequential execution. This resource is the parent node relation. This resource must be manipulated simultaneously by all processors. Therefore, it must be shared between them. Thus, this technique consists in partitioning the parent relation between all processors which compute the semi-join operation of this last relation with its son nodes relations. These partitions are manipulated periodically between processors. P COM P RESS operation : is a pipelined execution of COMPRESS operation. It is applied on a sequence of nodes or a chain. Let {n 1 , n 2 , ..., n j } be a chain of a tree T where n i+1 is the n i 's only son, the application of P COM P RESS to this chain results in a new tree contracted T in which the node n 1 is transformed thus:</p><formula xml:id="formula_8">• χ T (n 1 ) = χ T (n 1 ) • Hrel T (n 1 ) = Π χ(n 1 ) (Hrel T (n 2 ) Hrel T (n 3 ) • • • Hrel T (n j )).</formula><p>It makes a pipeline of join operations between the chain's nodes, and at each time when it takes a tuple from the probe relation, it joins it with all tuples of the corresponding partition in the hash table of the build relation. Then it communicates it to the probe relation of the next operator. After the execution of the last operator, it projects the tuples results on the variable set χ of each node of the chain, it hashes it on the intersection variables of each node with its parent node, and puts the tuple result in the corresponding node relation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2.2">P S SEARCH algorithm</head><p>P S SEARCH algorithm is the parallel version of S SEARCH algorithm. It works in the same way, except that, each time, after taking a tuple from a parent node, the research of corresponding tuples in the son nodes is made in parallel.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Complexity of P HT R</head><p>For a binary hypertree, the complexity of the P SBR algorithm is</p><formula xml:id="formula_9">O(r * P h−1 )<label>(3)</label></formula><p>using O(h) operations in a PRAM of type EREW. r is the the maximum relation size, h is the hypertree width, P is the maximum number of tuples in the partition of hashing on the variables of ϑ (ϑ represents the intersection variables of C i with all variables in C j where j &lt; i ). For the P Solving algorithm, its complexity is O(log n 2 ) using O(n) operations. n is the hypertree size (number of nodes).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Experiments of parallel algorithm</head><p>We have developed a simulation model for P SBR and P Solving algorithms based on logical time assumptions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Simulation model</head><p>Our system is composed of simple modules described as classical sequential programs, which are collected and executed in a parallel way by the simulator. A module is the set of operations performed by a processor we called a process. For the internal working of a process, we split operations that can be performed in three main types : Reading a tuple, Searching in hash tables including the tuples join operation and Writing a result tuple. These operations are executed sequentially between them and in parallel with those of the other processes. Each process explores the maximum of potential parallelism if its environment (its input variables) do not conflict during the other process execution. For a pipeline execution, if the processes are not adjacent, there is no conflict. Otherwise, we use the semaphore mechanism to synchronize them.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Simulation process</head><p>Each operation or each event is performed in an interval of time and the simulator must therefore keep a logical time counter. The asked question is : When we increment this counter, and what is the relation between this counter and the events execution time (physical counter)? We make a stepby-step simulation so that for each step (logical time unit) all operations which can be performed at the same time start as follows :</p><p>1. The simulator executes all processes and it increments the logical time counter at each iteration.</p><p>2. For all processes that are not in conflict, the simulator increments the physical time counter.</p><p>3. After a logical time step, the simulator updates all the shared variables.</p><p>4. It restarts a new step by considering the new variable states.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">Experimental protocol</head><p>We developed a simulation of P HT R algorithm in order to check: first, if it gives good temporal and spatial complexities and second, if the new approach of parallel tree contraction proposed in this paper can be considered as an interesting alternative of the one considered in <ref type="bibr" target="#b8">[9]</ref>. In order to compare our results, we simulate PT AC algorithm. In this section, experimentations are divided in three categories :</p><p>1. Simulation of P SBR algorithm in order to estimate its interest in term of space memory, since the sub-problems resolution is the source of a bad spatial complexity in general.</p><p>2. Simulation of P RAKE in order to evaluate its performances.</p><p>3. Simulation of P Solving algorithm in order to estimate its temporal optimization, and to measure the contribution of the new parallel tree contraction technique P Rake by leading a comparison with the one proposed in (PT AC algorithm).</p><p>The simulation has been accomplished on a PC under Linux 6.0.52 version with CPU Intel Pentium IV 2.4 GHz and 512 Mb of RAM. We use a set of benchmarks CSP which exist in the literature. We take the average of the data obtained after several executions. In our results, |V |, |E| et |r| represent respectively the variables number, the constraints number and the maximum relations cardinality. N d , N f and HT W are respectively, the nodes number, the leaf nodes number and the hypertree width. N p represents the processors number and N bS represents the number of pipeline stages.</p><p>In order to be hardware independent, measure units are Tuple for space and Operation (Reading, Searching Writing) for time.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.4">P SBR algorithm simulation</head><p>The table 2 presents the space memory required for a pipeline (R P SBR) and no pipeline (R join) execution of the join operations for different CSP instances (consistent and inconsistent).  N N W &gt; 2 denotes the number of nodes in the hypertree with width more than 2. We observed that the gain in space memory is very important in instances for which the pipeline executions number (NNW&gt;2) is important (haystacks-07 ). We also observed that the gain depends on the number of nodes in hypertree (mug-100-25-4 ). It is also proportional to the number of tuples by relation. As the two factors that influence on CSP problems complexity are the constraints relations size, and the structural decomposition width, and in order to estimate the contribution of P SBR, we evaluate in figure <ref type="figure" target="#fig_3">1</ref>, in (a) and (b), the P SBR algorithm behavior w.r.t respectively the constraints relations size and the stages number in pipeline for two classes of CSP problems: aim-100-6 and full-Insertion.</p><p>N.B: P SBR algorithm forms a pipeline in each node of the hypertree. So, the stages number in the pipeline is the number of constraints in the node minus one. Figure <ref type="figure" target="#fig_3">1</ref> shows that more the relations size important more the memory space gain is considerable. A similar interpretation is illustrated for the stages number in pipeline.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.5">P RAKE algorithm simulation</head><p>P RAKE tries to optimize the CPU time of the whole problem. We present here a simulation of this operation by computing its efficiency Ef f = T s N P * T p where N P is the processors number and T s (reps. T p ) the time of sequential (reps. parallel) resolution of the sub-hypertree.   <ref type="table" target="#tab_5">3</ref> presents the obtained results for some sub-hypertrees of different CSP instances. We observed a good efficiency of P RAKE operation from 1 to ten processors. This algorithms allows a load balancing by sharing tuples to be filtered between all processors.</p><p>N.B: The number of processors used to contract a sub-hypertree is equal to the number of semi-join operations which is equal to the stages number in pipeline. The P RAKE algorithm speedup is presented in Figure <ref type="figure" target="#fig_4">2</ref>. It is obvious that it is close to theoretical speedup (linear).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.6">P Solving algorithm simulation</head><p>Before comparing P Solving with A HBR, it seems natural to compare P CON T RACT algorithm with an algorithm applying the tree contraction. N c represents the number of contraction operations performed and T the computational time. We have considered 1000 operations as a measure unit. Table <ref type="table" target="#tab_6">4</ref> gives the CPU time of both A HBR algorithm and P T AC algorithm (CONTRACT operation) and the one of P Solving (P CON T RACT operation). It results that P CON T RACT generates a gain in temporal complexity inversely proportional to the number of contractions. More the number of the leaf nodes contracted is big more the number of contraction is less and more the gain in time is important (myc-3-4, Renault and hole-6 ), and vice versa, which is the case for hayst06 and mug25-4. We can also remark for the problem hole-6, the CPU time gain (29 instead of 1201) is considerable. This is due to the fact the hypertree is contracted on only one step, instead of taking 81 steps.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusion</head><p>In this paper, we have presented sequential and parallel algorithms to solve CSPs by exploiting their structural properties. The algorithms exploit the hash technique. For the sequential algorithm, we have done some experiments on benchmarks from the literature and the results we have obtained are promising. Good results are observed when the number of tuples of relations is important. The parallel algorithm is based on the notion of pipeline and parallel tree contraction which is a parallel version of the well known tree contraction. We performed simulations on some benchmarks and the results are very good. Future works include the execution of our parallel algorithm on a parallel machine.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>3 : Step1: 4 :</head><label>34</label><figDesc>for each node n of T do 5:</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>3 :</head><label>3</label><figDesc>HT = CONTRACT (HT ) 4: S SEARCH (HT ),</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Algorithm 4 P</head><label>4</label><figDesc>HT R (Parallel HyperT ree Resolution) algorithm 1: Input: a hypertree T , χ, λ of a hypergraph H = (V(H), E(H)) 2: Output : The solution of the problem 3: for each node n of T in parallel do 4:</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: spatial performances of P SBR according to (a) relations size (b) stages number in pipeline</figDesc><graphic coords="13,312.71,150.28,125.53,104.96" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: P RAKE algorithm speedup</figDesc><graphic coords="14,221.35,151.23,115.85,96.75" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>2 [8]. The solvers inputs are CSPs instances and the corresponding hypertrees in GML format. For this, we have exploited a GML Parser proposed by Raitner and Himsol 3 and another one, proposed by Roussel 4 , for XCSP file. The experiments are made on Linux using an Intel Pentium IV, with 2.4 GHz of CPU and 600 Mb of RAM. In our results, |V |, |E| and |R| represent respectively the variables number, the constraints number and maximum number of tuples by relation associated to a given CSP. N</figDesc><table /><note>d and HT W are respectively the nodes number of the hypertree and the hypertree width. S-HBR(sec) illustrate the S-HBR computational time in seconds, and B A(sec) the time of the B A algorithm. The table 1 summarizes our experiments. The hash function used in this paper is</note></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></figDesc><table><row><cell></cell><cell></cell><cell>CSP</cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell></row><row><cell>Name</cell><cell>|V|</cell><cell>|E|</cell><cell>N d</cell><cell>HT W</cell><cell>|R|</cell><cell cols="2">B A (sec.) S HBR (sec.)</cell></row><row><cell>3-insertions-3-3</cell><cell>56</cell><cell>110</cell><cell>86</cell><cell>7</cell><cell>3</cell><cell>&gt;1000</cell><cell>127</cell></row><row><cell>domino-100-100</cell><cell>100</cell><cell>100</cell><cell>50</cell><cell>2</cell><cell>100</cell><cell>27</cell><cell>7</cell></row><row><cell>domino-100-200</cell><cell>100</cell><cell>100</cell><cell>50</cell><cell>2</cell><cell>200</cell><cell>103</cell><cell>28</cell></row><row><cell>domino-100-300</cell><cell>100</cell><cell>100</cell><cell>50</cell><cell>2</cell><cell>300</cell><cell>241</cell><cell>61</cell></row><row><cell>series-7</cell><cell>13</cell><cell>42</cell><cell>39</cell><cell>4</cell><cell>42</cell><cell>&gt;1000</cell><cell>106</cell></row><row><cell>hanoi-7</cell><cell>126</cell><cell>125</cell><cell>125</cell><cell>1</cell><cell>6558</cell><cell>71</cell><cell>9</cell></row><row><cell>haystacks-06</cell><cell>36</cell><cell>95</cell><cell>88</cell><cell>3</cell><cell>8</cell><cell>9</cell><cell>4</cell></row><row><cell>haystacks-07</cell><cell>49</cell><cell>153</cell><cell>144</cell><cell>4</cell><cell>9</cell><cell>514</cell><cell>66</cell></row><row><cell>langford-2-4</cell><cell>8</cell><cell>32</cell><cell>31</cell><cell>4</cell><cell>8</cell><cell>11</cell><cell>3</cell></row><row><cell>Renault</cell><cell>101</cell><cell>134</cell><cell>81</cell><cell>2</cell><cell>48721</cell><cell>780</cell><cell>20</cell></row><row><cell>bf-1355-e-63</cell><cell>532</cell><cell>339</cell><cell>223</cell><cell>6</cell><cell>3124</cell><cell>96</cell><cell>11</cell></row><row><cell>bf-1355-g-63</cell><cell>532</cell><cell>339</cell><cell>223</cell><cell>6</cell><cell>7775</cell><cell>561</cell><cell>36</cell></row><row><cell>bf-2670-b</cell><cell cols="3">1244 1354 733</cell><cell>8</cell><cell>31</cell><cell>&gt;1000</cell><cell>77</cell></row><row><cell>bf-2670-c</cell><cell cols="3">1244 1354 641</cell><cell>13</cell><cell>31</cell><cell>&gt;1000</cell><cell>125</cell></row></table><note>Experimental results of S-HBR algorithm tree contraction considers at each iteration, for each parent node with only one son node leaf. To increase the parallelism degree in this operation, we developed a new alternative of this technique, based on partitioning the parent node relation (the critical resource) between all processors, which allows an asynchronous updating.</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_3"><head>Table 2 :</head><label>2</label><figDesc>P SBR algorithm simulation of CSP instances</figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_5"><head>Table 3 :</head><label>3</label><figDesc>P RAKE algorithm efficiencyTable</figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_6"><head>Table 4 :</head><label>4</label><figDesc>P-Solving algorithm simulation</figDesc><table><row><cell></cell><cell></cell><cell></cell><cell>CSP</cell><cell></cell><cell></cell><cell></cell><cell>A − HBR</cell><cell></cell><cell>PTAC</cell><cell cols="2">P − Solving</cell></row><row><cell>Name</cell><cell>|V |</cell><cell>|E|</cell><cell>N d</cell><cell>HT W</cell><cell>|R|</cell><cell>N f</cell><cell>T</cell><cell>N c</cell><cell>T</cell><cell>N c</cell><cell>T</cell></row><row><cell>hayst06</cell><cell>36</cell><cell>95</cell><cell>88</cell><cell>3</cell><cell>8</cell><cell>23</cell><cell>16736</cell><cell>13</cell><cell>253</cell><cell>10</cell><cell>158</cell></row><row><cell>dom200</cell><cell cols="2">100 100</cell><cell>50</cell><cell>2</cell><cell>200</cell><cell>1</cell><cell>3632</cell><cell>48</cell><cell>3632</cell><cell>48</cell><cell>3632</cell></row><row><cell>hanoi-6</cell><cell>62</cell><cell>61</cell><cell>59</cell><cell>1</cell><cell>2148</cell><cell>2</cell><cell>260</cell><cell>37</cell><cell>169</cell><cell>37</cell><cell>169</cell></row><row><cell cols="4">mug25-4 100 166 133</cell><cell>3</cell><cell>31</cell><cell>26</cell><cell>119</cell><cell>12</cell><cell>47</cell><cell>9</cell><cell>38</cell></row><row><cell>myc-3-4</cell><cell>11</cell><cell>20</cell><cell>15</cell><cell>4</cell><cell>12</cell><cell>4</cell><cell>267</cell><cell>6</cell><cell>164</cell><cell>3</cell><cell>42</cell></row><row><cell>myc-4-4</cell><cell>23</cell><cell>71</cell><cell>48</cell><cell>6</cell><cell>6</cell><cell>12</cell><cell>124</cell><cell>8</cell><cell>315</cell><cell>4</cell><cell>299</cell></row><row><cell>Renault</cell><cell cols="2">101 134</cell><cell>81</cell><cell>2</cell><cell>48721</cell><cell>12</cell><cell>7758</cell><cell>26</cell><cell>38167</cell><cell>9</cell><cell>1456</cell></row><row><cell>series-6</cell><cell>11</cell><cell>30</cell><cell>27</cell><cell>3</cell><cell>30</cell><cell>5</cell><cell>622</cell><cell>8</cell><cell>256</cell><cell>4</cell><cell>155</cell></row><row><cell>hole-6</cell><cell>42</cell><cell cols="2">133 132</cell><cell>2</cell><cell>8</cell><cell>127</cell><cell>1970</cell><cell>85</cell><cell>1201</cell><cell>1</cell><cell>29</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0">Proceedings of the 16th International RCRA workshop (RCRA 2009): Experimental Evaluation of Algorithms for Solving Problems with Combinatorial Explosion Reggio Emilia, Italy, 12 December 2009</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_1">It is sufficient to have only one tuple by partition in the son node relations.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_2">http://www.cril.univ-artois.fr/ lecoutre/research/benchmarks/benchmarks.html</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_3">http://www.cs.rpi.edu/ puninj/XGMML/GML-XGMML/gml-parser.html</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_4">http://www.cril.univ-artois.fr/ roussel/CSP-XML-parser/</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">A unified theory of structural tractability for constraint satisfaction problems</title>
		<author>
			<persName><forename type="first">M</forename><surname>Gyssens</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Cohen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Jeavons</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Comp. and Sys. Sci</title>
		<imprint>
			<biblScope unit="volume">74</biblScope>
			<biblScope unit="page" from="721" to="743" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<title level="m" type="main">Constraint Processing</title>
		<author>
			<persName><forename type="first">R</forename><surname>Dechter</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2003">2003</date>
			<publisher>Morgan Kaufmann</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Constraint Networks</title>
		<author>
			<persName><forename type="first">R</forename><surname>Dechter</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Encyclopedia of Artificial Intelligence</title>
				<imprint>
			<date type="published" when="1992">1992</date>
			<biblScope unit="page" from="276" to="285" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Tree clustering for constraint networks</title>
		<author>
			<persName><forename type="first">R</forename><surname>Dechter</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Pearl</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Art. Int</title>
		<imprint>
			<biblScope unit="volume">38</biblScope>
			<biblScope unit="page" from="353" to="366" />
			<date type="published" when="1989">1989</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">A comparison of structural csp decomposition methods</title>
		<author>
			<persName><forename type="first">G</forename><surname>Gottlob</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Leone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Scarcello</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Art. Int</title>
		<imprint>
			<biblScope unit="volume">124</biblScope>
			<biblScope unit="page" from="243" to="282" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Decomposing constraint satisfaction problems using database techniques</title>
		<author>
			<persName><forename type="first">M</forename><surname>Gyssens</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">G</forename><surname>Jeavons</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">A</forename><surname>Cohen</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Art. Int</title>
		<imprint>
			<biblScope unit="volume">66</biblScope>
			<biblScope unit="page" from="57" to="89" />
			<date type="published" when="1994">1994</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Networks of constraints: Fundamental properties and applications to pictures processing</title>
		<author>
			<persName><forename type="first">U</forename><surname>Montanari</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Inf. Sci</title>
		<imprint>
			<biblScope unit="volume">7</biblScope>
			<biblScope unit="page" from="95" to="132" />
			<date type="published" when="1974">1974</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<ptr target="http://www.cril.univ-artois.fr/CPAI08" />
		<title level="m">XML Representation of Constraint Networks Format XCSP 2</title>
				<imprint>
			<biblScope unit="volume">1</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Randomized Parallel Algorithms for Backtrack Search and Branch-and-Bound Computation</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">M</forename><surname>Karp</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Zhang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Journal of the Association for Computing Machinery</title>
		<imprint>
			<biblScope unit="volume">40</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="765" to="789" />
			<date type="published" when="1993">1993</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Hypertree Decompositions: A survey</title>
		<author>
			<persName><forename type="first">G</forename><surname>Gottlob</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Leone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Scarcello</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of MFCS &apos;</title>
				<meeting>MFCS &apos;</meeting>
		<imprint>
			<date type="published" when="2001">2001</date>
			<biblScope unit="volume">01</biblScope>
		</imprint>
	</monogr>
</biblStruct>

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