g-Hecs: A Heterogeneous Constraint Solving System on ... - FJCP 2005

JavaSpaces service is used in current implementation. • Master solver. – Realizes parallel ... constraint solvers are used. – Cream: A Java class library for CP.
610KB taille 9 téléchargements 284 vues
g-Hecs: A Heterogeneous Constraint Solving System on the Grid Naoyuki TAMURA Mutsunori BANBARA Mukeyuki KAWATANI

Kobe University Kobe University Kobe University

2nd Franco-Japanese Workshop on Constraint Programming, France, 2005

Outline • g-Hecs has beed designed to support: – Various Grid middlewares – Various search algorithms – Various parallelization algorithms • Space-Solver architecture • Parallelization algorithms – Domain Splitting – Cooperative Local Search – Problem Splitting • Performance evaluation – N-Queens problem (with using domain splitting) • Calc/Cream: A Constraint Spreadsheet No. 1

Backgrounds • Requirements to solve combinatorial problems efficiently are getting larger. – Scheduling problems – Resource planning • Grid technologies are becoming available. • It will be an effective approach to develop a constraint solving system working on Grid environments.

No. 2

Backgrounds (cont.) • However, there are several Grid middlewares. – Globus Toolkit – N1 Grid Engine (Sun Microsystems) – Xgrid (Apple Computer) • If we choose one of them, we lose middlewareportability immediately. • Useful parallelization or search algorithms are different depending on the individual CSPs.

No. 3

Main Features of g-Hecs The g-Hecs system is designed to support: • Various Grid middlewares – General communication method • Various constraint solvers – Complete search: Branch-and-Bound – Local search: Simulated Annealing and Tabu. • Various parallelization algorithms – Domain Splitting – Cooperative Local Search – Problem Splitting No. 4

Supporting Various Grid Middlewares • We adopt a Space-Solver architecture to support general communication method. • The Space-Solver architecture consists of – Spaces – Solvers ∗ Master solvers ∗ Slave solvers

No. 5

Space-Solver Architecture • Space – Used as a collaborative space among solvers. – JavaSpaces service is used in current implementation. • Master solver – Realizes parallel constraint solving by using a parallelization algorithm such as Domain Splitting, Cooperative Local Search, and Problem Splitting. • Slave solver – Solves a CSP by itself by using a search algorithm such as Branch-and-Bound, SA, Tabu, and etc. No. 6

Behavior of Master Solvers and Slave Solvers

No. 7

Behavior of Master Solvers and Slave Solvers

No. 8

Behavior of Master Solvers and Slave Solvers

No. 9

Behavior of Master Solvers and Slave Solvers

No. 10

Behavior of Master Solvers and Slave Solvers

No. 11

Behavior of Master Solvers and Slave Solvers

No. 12

Behavior of Master Solvers and Slave Solvers

No. 13

Behavior of Master Solvers and Slave Solvers

No. 14

Behavior of Master Solvers and Slave Solvers

No. 15

Behavior of Master Solvers and Slave Solvers

No. 16

Behavior of Master Solvers and Slave Solvers

No. 17

Behavior of Master Solvers and Slave Solvers

No. 18

Behavior of Master Solvers and Slave Solvers

No. 19

Behavior of Master Solvers and Slave Solvers

No. 20

Behavior of Master Solvers and Slave Solvers

No. 21

Behavior of Master Solvers and Slave Solvers

No. 22

Supporting Various Constraint Solvers • Two constraint solvers are used.

– Cream: A Java class library for CP http://bach.istc.kobe-u.ac.jp/cream/ – clp(FD): A constraint logic programming system • Cream has the following local search algorithms. – Simulated Annealing – Tabu Search – Iterative Branch-and-Bound

No. 23

Supporting Various Constraint Solvers (cont.) • CPDL (Constraint Problem Description Language) is used as a universal description language for CSPs. • Problems and solutions are described in CPDL syntax and stored in a collaborative space. • It is not difficult to add a new constraint solver to the g-Hecs system.

No. 24

Supporting Various Parallelization Algorithms • The following parallelization algorithms are supported in g-Hecs. – Domain Splitting – Cooperative Local – Problem Splitting

No. 25

Domain Splitting • Domain Splitting generates subproblems by splitting domains of variables into multiple subdomains. • Search a solution for each subproblem by using a slave solver. • Merge these solutions to a total solution. • Well-known and widely used

No. 26

Cooperative Local Search • In cooperative local search, multiple local search solvers run in parallel. • The solvers are made to cooperate by sharing information.

No. 27

Cooperative Local Search (cont.) 1. A master solver sends a problem with a timeout to slave local search solvers. 2. Each slave solver searches a solution independently and send its current best solution back to the master solver. 3. The master solver selects the best one of them and sends it to the slave solvers. 4. If timeout is not exceeded, go to step 2 with using the selected best solution as an initial solution for the next search. 5. Otherwise, the best solution found in the loop is returned as the final answer. No. 28

Problem Splitting • Problem Splitting splits a CSP into disjoint subproblems by adding extra constraints. C =⇒ C ∧ C1 and C ∧ C2 • Let C be a given CSP. • C1 and C2 are extra constraints satisfying: C1 ∧ C2 = f alse, C1 ∨ C2 = true • C can be divided into two disjoint subproblems C ∧ C1 and C ∧ C2 . • This division can be recursively repeated to generate more than two subproblems. No. 29

Problem Splitting (cont.) • In g-Hecs, CSPs including a serialized constraint can be divided into subproblems by using the Problem Splitting method. • A serialized([x1 , . . . xn ], [d1 . . . , dn ]) constraint means the intervals [xi , xi + di ) are not overlapped each other. (xi + di ≤ xj ) ∨ (xj + dj ≤ xi ) for any i 6= j

No. 30

Problem Splitting (cont.) A CSP including a serialized([x, y], [a, b]) can be split into C ∧ (x ≤ y) and C ∧ (y < x).

Original problem: C = serialized([x, y], [a, b]) ⇓ Subproblem 1: C ∧ (x ≤ y) Subproblem 2: C ∧ (y < x) No. 31

Combination of Problem Splitting and local search solvers The Problem Splitting method can be combined with local search solvers for optimization problems. • Split the CSP C into C1 , C2 ,. . . ,Cn . • Search optimal solution Si for each subproblem Ci by using a local search solver. • The best solution of the above solutions (S1 ...Sn ) is returned as the optimal solution of C.

No. 32

Other Features of g-Hecs • Communication errors and system down can be detected during the computation. • Solvers can be dynamically added and removed during the computation. • Spreadsheet can be used as a front-end to increase the usability.

No. 33

Benchmark Results: N-Queens • We compared the speed of finding all solutions of N-Queens problem to evaluate the domain splitting method. • 10 parallel solvers in total on 10 computers with domain splitting method (divided into 64 subproblems) • A single solver on a single computer • We use Mac mini, 1GB memory

No. 34

Benchmark Results: N-Queens (cont.) N 11 12 13 14 15

single solver (no-split) 27.1 143.5 873.0 5378.6 36929.6

10 solvers (64 splits) 5.8 16.7 88.5 559.9 3805.7

speedup ratio 4.67 8.59 9.86 9.61 9.70 time: sec.

• Communication overhead ranges from 0.02% (N = 15) to 14% (N = 11).

No. 35

Benchmark Results: 14-Queens (cont.) split 64 128 256 512

total time 559.9 497.3 484.2 534.5

split time 0.030 0.125 0.446 0.716

speedup ratio 1.00 1.13 1.16 1.05 time: sec.

• The best number of split depends on the scale of N of N -Queens and on the selection of variables for domain splitting.

No. 36

Download The newest package including all source code is available from: http://g-hecs.cs.scitec.kobe-u.ac.jp/ .

No. 37