• No results found

Weight-Based Distributed Hybrid Algorithm (DBHyb)

5.3 DisHyb Implementations

5.3.2 Weight-Based Distributed Hybrid Algorithm (DBHyb)

In this section, we present an alternative instance of DisHyb, the Distributed Breakout Hybrid algorithm (DBHyb), which combines DisBO-wd as the local search algorithm with SynCBJ as the systematic search algorithm.

We refer to DisBO-wd [8] as SingleDB-wd in the remainder of this chapter since each DisBO-wd search will only have a single variable per agent.

In SingleDB-wd, when a local optima is reached, weights on violated constraints are increased. Variables involved in heavily weighted constraints can be seen as more difficult to assign. In summary, we can obtain the following information from SingleDB-wd:

• Difficult variables: the weights on constraints can be used to learn which variables are difficult to assign. A variable involved in constraints which are heavily weighted is seen as more difficult to assign than a variable involved in few or none heavily weighted constraints. Variables are ordered in descending order of difficulty and this order is used to drive SynCBJ.

• Best variable values: the best solution found (the one with the least constraint violations) in SingleDB-wd, is used for value ordering in SynCBJ.

5.3. DisHyb Implementations 58 Algorithm Description

In order to learn weight information SingleDB-wd was modified by adding the best value bvi store to retain the value participating in the best overall solution found by SingleDB- wd so far. This is determined by each agent adding its current constraint violations to the number of violations passed to it by its predecessor and sends this number to the next agent. The last agent determines if the current solution is the best found so far and so informs agents in the next cycle to retain their current value as the best value before searching for a new value. Consequently, no additional messages are incurred.

DBHyb is shown in Algorithm 3. Specifically, it differs from PenDHyb, in that con- straint weights are used instead of penalties. A standard SingleDB-wd search runs only for a very small number of cycles (see section 5.3.2). If a solution is found, this is returned. Otherwise, each variable determines its highest constraint weight out of the constraints in- volving that variable. Variables are then arranged, in descending order, according to their degree and constraint weight before SynCBJ is run. In addition to this variable ordering, value ordering through the best value is performed in the same way as PenDHyb.

Properties

DBHyb is complete since either SingleDB-wd reports a solution within the small number of cycles (typically SingleDB-wd solves 3% of problems) or SynCBJ runs. Since SynCBJ is complete, completeness of DBHyb is guaranteed. DBHyb is sound since both SingleDB-wd and SynCBJ are sound [8, 102].

Variable and Value Ordering in DBHyb

A number of methods for exploiting the knowledge gained from running SingleDB-wd were evaluated in order to provide variable and value ordering for SynCBJ. Solvable random binary distributed constraint satisfaction problems were used in the experiments with n = 50, d = 10, p1 = 0.15 and p2 = 0.4. These problems are at the boundary where local search performs better than systematic search. Combinations of the following options were used:

Algorithm 3 DBHyb

1: initialise

2: for each constraint ci do

3: set its constraint weight cwi to 1

4: end for

5: for each variable vi do

6: set its best value bvi to its initial instantiation

7: end for

8: repeat

9: for each agent ai responsible for variable vi do

10: if message received stating current value participates in best solution so far then

11: set bvi to current value

12: end if

13: SingleDBwd agent main loop(termination cond)

14: for each constraint ci do

15: if constraint ci is violated then

16: increase cwi 17: else 18: decay cwi 19: end if 20: end for 21: end for

22: until termination cond

23: if solution found by SingleDBwd then

24: return solution

25: else

26: for each agent ai responsible for variable vi do

27: cwvi ← highest weight of a constraint belonging to vi.

28: end for

29: ao ← list of agents sorted by max-degree and their variables’ weight (cwvi).

30: for variable vi do do

31: Prioritise best values (bvi)

32: end for

33: SynCBJ(ao)

34: if solution found by SynCBJ then

35: return solution

36: else

37: return ”unsolvable problem”

38: end if

39: end if

• Variable ordering:

– Weights: uses a combination of max-degree and constraint weights.

– Last weights: as above but it uses the values of SingleDB-wd’s constraint weights at the last cycle.

5.3. DisHyb Implementations 60 – Sticking values: the first variable value to be tried by SynCBJ is SingleDB- wd’s best value for that variable, i.e. the one participating in the best solution found. This is inspired by [32] who used the last value assigned to a variable. – Selected sticking values: uses the sticking value for that variable (i.e. the

best value assigned by SingleDB-wd for that variable) only if that value led to no constraint violations in SingleDB-wd. Otherwise, it uses the first value in the domain as the sticking value.

Table 5.5 presents the median results over 100 runs.

Number of Messages Number of Constraint Checks

SynCBJ 262,178 1,344,941

Weights 41,725 289,065

Sticking values 35,199 239,827

Weights + selected sticking 28,907 212,382

Last weights 47,713 298,876

DBHyb 22,259 173,825

Table 5.5: Comparison of variable and value ordering heuristics (n = 50, d = 10, p1 = 0.15, p2 = 0.4).

All variants of DBHyb outperformed the base line SynCBJ. Last weights is the least efficient approach. Best weights improves on this since it gives SynCBJ more information about difficult variables since these will be the variables which have a high constraint weight even with a low number of overall constraint violations. As with PenDHyb, sticking values proves to be an effective addition. Whilst selected sticking performs quite well in this case, the version of DBHyb outlined above (i.e. best weights + sticking values for all variables) is the best performing version and the one used throughout the rest of this chapter.

Determining Optimal Number of Cycles for SingleDB-wd

The only parameter which needed to be determined in DBHyb was the number of cycles SingleDB-wd should run for optimal performance. This was determined in the same way as for PenDHyb (see section 5.3.1). The values for α, β and γ in the cutoff formula are given in Table 5.6 where the column heading indicates which metric is to be minimised.

Randomly Generated Problems Graph Colouring Problems optimisemessages constr. checks both messages constr. checks both

α -62.129 -67.388 -62.295 -50.288 -31.410 -38.943

β 3.260 1.660 2.920 0.000 0.000 0.000

γ 0.429 0.494 0.421 0.216 0.136 0.166

Meeting Scheduling Problems optimisemessages constr. checks both

α -116.461 -117.758 -98.875

β 19.781 21.281 17.438

γ 0.254 0.131 0.182

Table 5.6: Parameter values for α, β and γ in Equation (5.1).