Constrained Bandwidth Multicoloration ... - Semantic Scholar

6 downloads 0 Views 64KB Size Report
ing as an ILP and present Saturn results on the same graphs. ... constraints ν б зиг where г ranges over the disallowed colours for vertex а . In bandwidth ... hood is a consistent partial variable assignment: a subset of the variables are assigned.
Constrained Bandwidth Multicoloration Neighbourhoods Steven Prestwich Cork Constraint Computation Centre University College, Cork, Ireland [email protected] No Institute Given

Abstract. A combination of local search and constraint propagation called FCNS has previously been described for pure graph colouring. FCNS is a hybrid of the DSATUR backtracker and the IMPASSE local search algorithm, restricting coloration neighbourhoods by propagation, and dynamically ordering vertices by the Br´elaz heuristic. We extend it to bandwidth colouring and present results on a set of geometric graphs. A related algorithm called Saturn has previously been described for pure 0/1 integer linear programs. We model bandwidth multicolouring as an ILP and present Saturn results on the same graphs. An assessment of performance is postponed until other results are presented at the symposium.

1 Introduction Graph colouring is an NP-hard combinatorial optimization problem with real-world applications such as timetabling, scheduling, frequency assignment, computer register allocation, printed circuit board testing and pattern matching. This paper describes two new algorithms that are different implementations of the same hybrid approach to constraint satisfaction problems, of which colouring is an example. The aim of the hybrid is to combine the scalability of stochastic local search with the space-pruning techniques of Constraint Programming. It has given good results on a variety of problems including pure graph colouring, sometimes outperforming both backtrack and standard local search. In this paper we apply it to generalized colouring. The paper is organized as follows. In Section 2 we describe a version of the algorithm for binary constraint satisfaction problems (binary CSP, or BCSP), model pure colouring and bandwidth colouring as BCSPs, and obtain results for a set of geometric graphs. In Section 3 we describe another version of the algorithm for integer linear programs (ILP), model bandwidth multicolouring as an ILP, and obtain results for the same graphs. Section 4 concludes the paper.

2 Colouring and bandwidth colouring Graph colouring is an optimization problem but it can be solved as a series of CSPs, finding -colourings with decreasing . A CSP has a set of variables and constraints. Each variable  has a domain Dom  of values, often finite. Each constraint specifies

forbidden combinations of variable assignments (alternatively a constraint can specify allowed combinations), and where each constraint involves at most two variables the problem is a BCSP. The problem is to assign a value to each variable such that no constraint is violated. Pure and bandwidth graph colouring can be modeled as BCSPs. 2.1 The model A graph consists of a set of vertices and a set of edges between vertices. We can model each vertex by a variable  and each colour  by a domain value  Dom   . Two vertices connected by an edge are adjacent. In pure graph colouring adjacent vertices are not allowed to take the same colour. This can be expressed as disequality constraints   for each pair of adjacent vertices and . Some of the problems in this sym  posium have lists of allowed colours for vertices, and these can be expressed as unary constraints      where  ranges over the disallowed colours for vertex . In bandwidth colouring two adjacent vertices and cannot be assigned colours that are closer in value than a specified distance  . Again the constraints are binary:     

 , or in a more convenient form for finite domain constraint solvers         where and are adjacent and     . Pure colouring is equivalent to bandwidth colouring with  =1 for all vertex pairs  !  . 2.2 The algorithm Local search is usually applied to CSPs by exploring a space of total variable assignments. In terms of graph colouring, all vertices are assigned colours and conflicts between adjacent vertices are removed by modifying colour assignments. Recolouring a vertex may introduce new conflicts so heuristics are used to guide the selection of vertices and colours. If all conflicts are removed then the problem is solved. An example of this type of local search is Min-Conflicts Hill Climbing [9]. However, it is not particularly successful at graph colouring [6, 9]. A class of local search algorithm that gives good colouring results is IMPASSE [8, 10]. IMPASSE algorithms apply local search to a space of coloration neighbourhoods: a colour assignment to a subset of the vertices. In CSP terms a coloration neighbourhood is a consistent partial variable assignment: a subset of the variables are assigned values, subject to non-violation of the problem constraints. The other variables are left unassigned, and these correspond to the impasse set of vertices. Heuristics are used to select vertices for colouring and uncolouring. A commonly used (though not the most powerful) constraint propagation technique for BCSPs is forward checking. On assigning a value  to a variable  , for each constraint     #"  "  in which #" is currently unassigned, the value " is removed from Dom  #"  ; on backtracking it is restored. In a previous paper [11] we improved IMPASSE-style colouring by adding forward checking. On DIMACS graph colouring instances this algorithm, which we called FCNS, performed very competitively compared to the five algorithms evaluated in [7]. FCNS can also be viewed as a local search version of Mehrotra & Trick’s DSATUR implementation. 1 DSATUR also performs forward checking (though this constraint terminology is not used). FCNS and DSATUR 1

http://mat.gsia.cmu.edu/COLOR/color.html

both use the Br´elaz dynamic variable ordering heuristic, which orders vertices dynamically by maximum saturation (number of distinct colours assigned to adjacent vertices), breaking ties by choosing a vertex of greatest forward degree (the degree of a vertex is the number of its adjacent vertices, and its forward degree is the number of its uncoloured adjacent vertices). There are several differences between FCNS and DSATUR. Firstly, a new technique is required to maintain variable domains when unassigning arbitrarily chosen variables. Secondly, unlike DSATUR, FCNS does not initially construct a clique and freeze its colours. Thirdly, they use different backtracking strategies. DSATUR performs depthfirst search (chronological backtracking) and is therefore complete: it is guaranteed to find an optimal solution. FCNS uses a novel form of backtracking that is incomplete: like a local search algorithm it is not guaranteed to find solutions, but often outperforms complete search. The form of backtracking used by FCNS is a randomized form of Dynamic Backtracking [4], which is able to unassign a previously assigned variable without unassigning those assigned since. Dynamic Backtracking’s choice of backtrack variable is carefully controlled to preserve completeness, but in Incomplete Dynamic Backtracking we discard completeness and select backtrack variables randomly (or heuristically but breaking ties randomly). At each dead-end backtrack variables are  unassigned, where is a user-defined noise parameter. By sacrificing completeness we gain local search-like scalability. In fact FCNS is an IMPASSE-like local search algorithm that (on pure colouring problems) explores the same space as DSATUR: the set of partial variable assignments that are consistent under forward checking, in other words the FC-consistent subspace of coloration neighbourhoods. A similar space is explored for multicolouring in Section 3 and we call these spaces constrained [bandwidth] [multi]coloration neighbourhoods. Please refer to [11] for details on heuristics and the maintenance of variable domains. As evidence that FCNS performs well on geometric graphs, Figure 1 compares FCNS with several other algorithms on the DIMACS geometric graph instances: Squeaky Wheel Optimization (SWO), Iterative Greedy (IG), Distributed IMPASSE (d-IMP), Parallel IMPASSE (p-IMP), TABU Search and DSATUR. The results are taken from [7, 11, 13], “—” indicates a small fraction of a second, and non-integer indicates averaging over multiple runs. FCNS emerges as the best algorithm on these instances, finding improved solutions or the same solutions in shorter times. We therefore hope that FCNS will perform well on the geometric graphs in this symposium.



2.3 Results Figures 2 and 3 give results for FCNS on the geometric graphs GEOM, treated as pure and bandwidth colouring problems respectively. These are actually bandwidth multicolouring problems but we ignore the multicolouring information (see Section 3 for multicolouring results), and by setting the bandwidth to 1 we obtain pure colouring problems. The tables show the best colouring found over several experiments, the CPU time in seconds 2 the number of backtracks bt, and the value of the FCNS noise



2

The benchmarking program dfmax(r500.5.b) took 35.21 seconds (user time) on our machine, which is a 733 MHz Pentium III using Linux.

SWO graph R125.1 R125.5 R250.1 R250.5 DSJR500.1 DSJR500.5 R1000.1 R1000.5

5 36 8 65 12 124 20 239



0.1 1.5 0.3 7.9 1.1 36.9 4.3 309

     

IG 5 36.9 8 68.4 12 130 20.6 253

d-IMP

1.1 1 3.8 4.5 11.3 14 46.9 55.3

5 36 8 65 12 123 20 241

p-IMP

— — — 44.1 — 94.1 4.4 507

5 37 8 66 12 128 20 246

64.6 33 22 39.9 26.6 90.5 49.9 216

TABU DSATUR FCNS

5 0.2 5 0.0 5 0.1 36 0.4 36 63.4 36 0.06 8 0.1 8 0.0 8 0.1 66 31.7 66 2.9 65 0.33 12 0.3 12 0.2 12 0.4 126 212 130 17.6 122 1.99 20 0.9 20 1.6 20 1.81 248 1849 246 75.8 235 8.61

Fig. 1. Results for DIMACS geometric graphs

parameter used to obtain the result. must be manually tuned to problems or classes of problem; many local search algorithms require at least one parameter to be tuned. As pure colouring problems these graphs seem easy for FCNS, though it is of course possible that the optimal solutions have not been found. On most graphs a solution was found immediately and further search found no better solutions. As bandwidth problems the graphs are more challenging, and because of FCNS’s good performance on pure colouring problems we are optimistic that these results are competitive.

graph GEOM20 GEOM20a GEOM20b GEOM30 GEOM30a GEOM30b GEOM40 GEOM40a GEOM40b GEOM50 GEOM50a GEOM50b GEOM60 GEOM60a GEOM60b GEOM70 GEOM70a GEOM70b

 

5 5 3 6 6 5 6 7 7 6 9 8 6 10 9 8 11 10

— — — — — — — — — — — — — — — — — —

bt 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

graph GEOM80 GEOM80a GEOM80b GEOM90 GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b

 

8 12 12 8 12 15 9 13 15 9 14 15 11 16 16

— — — — — — — — — — — — — — —

Fig. 2. Results for pure colouring

bt 0 0 0 0 0 0 26 48 0 0 4 92 0 0 0

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

graph GEOM20 GEOM20a GEOM20b GEOM30 GEOM30a GEOM30b GEOM40 GEOM40a GEOM40b GEOM50 GEOM50a GEOM50b GEOM60 GEOM60a GEOM60b GEOM70 GEOM70a GEOM70b

21 20 13 28 27 26 28 37 33 28 50 35 33 50 43 38 62 48



0.0 0.0 0.02 0.01 0.01 0.08 0.01 0.16 0.02 0.01 2.3 0.62 0.04 13 2.9 0.07 3.1 8.3

bt 15 715 3259 65 1334 9630 444 13346 1658 1137 161937 45927 1701 858579 188340 5355 162111 309195



3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2

graph GEOM80 GEOM80a GEOM80b GEOM90 GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b

41 63 61 46 64 72 50 70 73 50 74 79 60 84 87



6.1 16 0.45 0.29 9.4 4.06 4.4 12 11 13 1.6 21 1.5 25 6.5

bt 438928 869080 19774 18374 410535 158346 208096 574304 322929 608578 704268 825160 74622 1167875 202524



3 4 2 4 3 3 2 4 3 2 4 4 3 5 3

Fig. 3. Results for bandwidth colouring

3 Bandwidth multicolouring Multicolouring is not a BCSP, at least under a natural model in which vertices correspond to variables and colours to domain values. To apply FCNS-style hybrid local search to multicolouring we use another implementation called Saturn [12], designed for pure 0/1 ILPs. As before, the optimization problem is treated as a series of -multicolouring problems with decreasing . 3.1 The model



Bandwidth multicolouring can be modeled as an ILP  in a straightforward way. Given a problem with vertices   , a set of colours  ,  colours assigned to each vertex  , a distance    between any two vertices  and  (including the case  ), and a specified subset   of the colours from which each vertex  may be coloured. For each possible assignment of a colour  to a vertex   create a binary variable   . The constraints are as follows. No two vertices must be assigned colours closer than their specified distance:



      where   " ,    "  ,   "

  , and   " or    " or both. Each vertex must take its specified number of colours from its set of permitted colours:





 !#"%$

  



 

where

where

 

  . Finally, no vertex may be assigned a disallowed colour:

 

and 



   

      .

3.2 The algorithm The algorithm is based on a SAT (Boolean satisfiability) backtracking algorithm called the Davis-Logemann-Loveland (DLL) procedure [3] which uses a form of constraint propagation called unit propagation (modern DLL implementations add further techniques). We implemented a SAT algorithm based on DLL with non-systematic backtracking. It performs local search in a space of partial variable assignments that are consistent under unit propagation, and bears the same relation to DLL as FCNS does to DSATUR. DLL has been extended to ILPs by generalizing the unit propagation rule to linear constraints [1]. We did the same for our SAT hybrid and call the resulting algorithm Saturn — please refer to [12] for details. 3.3 Results Figure 4 gives results for the GEOM graphs. Interpreted as multicolouring bandwidth problems these graphs require many more colours and the ILP models become rather large: up to tens of thousands of variables and millions of constraints. On the larger problems this caused the machine to slow down dramatically, presumably because of page swapping, and Saturn was manually terminated (indicated by an entry “?”). Again we hope to compare these results with others at the symposium. However, this approach to bandwidth multicolouring seems impractical for large problems, and a specialized hybrid algorithm should be implemented. This is likely to greatly outperform Saturn, which is a general-purpose ILP solver, and would require far less memory because it would not explicitly represent constraints. Specialized algorithms often outperform general-purpose algorithms. For example to find a 38-colouring for GEOM70, Saturn takes 2–3 orders of magnitude more backtracks than FCNS, at a third the number of backtracks per second.

4 Conclusion At the time of writing there are no other computational results with which to compare ours, so we cannot comment on the efficiency of our hybrid approach. The results are preliminary and we expect better results with longer runs and more careful parameter tuning. However, the CSP implementation has given good results on geometric graph colouring [11] so the colouring and bandwidth colouring version should be competitive. The ILP implementation has given good results on problems including scheduling and block design [12] and query optimization [14], and it will be interesting to compare it with others on bandwidth multicolouring. But the ILP approach seems impractical for graphs with hundreds of vertices because of the large models required. We intend to implement a specialized multicolouring algorithm to avoid this problem.

graph GEOM20 GEOM20a GEOM20b GEOM30 GEOM30a GEOM30b GEOM40 GEOM40a GEOM40b GEOM50 GEOM50a GEOM50b GEOM60 GEOM60a GEOM60b GEOM70 GEOM70a GEOM70b

159 175 44 168 235 79 189 260 80 257 395 89 279 ? 128 310 ? 133



56 145 25 178 64 14.3 135 23.8 94 96 299 94 514 ? 1012 1019 ? 766

bt 1576236 3322633 865707 2926024 832252 394339 2717915 342639 1463890 1260711 2261513 900942 5873187 ? 8167922 8874805 ? 5467056



130 150 150 350 200 30 30 30 40 70 70 200 200 ? 200 200 ? 200





graph bt GEOM80 ? ? ? ? GEOM80a ? ? ? ? GEOM80b 152 1380 8186298 200 GEOM90 ? ? ? ? GEOM90a ? ? ? ? GEOM90b ? ? ? ? GEOM100 ? ? ? ? GEOM100a ? ? ? ? GEOM100b ? ? ? ? GEOM110 ? ? ? ? GEOM110a ? ? ? ? GEOM110b ? ? ? ? GEOM120 ? ? ? ? GEOM120a ? ? ? ? GEOM120b ? ? ? ?

Fig. 4. Results for bandwidth multicolouring

Acknowledgments The Cork Constraint Computation Centre is supported by Science Foundation Ireland.

References 1. P. Barth. A Davis-Putnam Based Enumeration Algorithm for Linear Pseudo-Boolean Optimization. Research Report mpi-i-95-2-003, Max-Plank Institut fur Informatik, Saarbrucken 1995. 2. D. Br´elaz, New Methods to Color the Vertices of a Graph. Communications of the ACM vol. 22 no. 4, 1979, pp. 251–256. 3. M. Davis, G. Logemann, D. Loveland. A Machine Program for Theorem Proving. Communications of the ACM vol. 5, 1962, pp. 394–397. 4. M. L. Ginsberg, Dynamic backtracking, Journal of Artificial Intelligence Research vol. 1, 1993, pp. 25–46. 5. D. S. Johnson, M. A. Trick (eds.), Cliques, Coloring and Satisfiability: Second DIMACS Implementation Challenge, DIMACS Series in Discrete Mathematics and Theoretical Computer Science vol. 26, American Mathematical Society 1996. 6. A. K. J´onsson, M. L. Ginsberg. Experimenting with New Systematic and Nonsystematic Search Techniques. AAAI Spring Symposium on AI and NP-Hard Problems, Stanford, California, AAAI Press, 1993. 7. D. E. Joslin and D. P. Clements, Squeaky Wheel Optimization, Journal of Artificial Intelligence Research vol. 10, 1999, pp. 353–373. 8. G. Lewandowski and A. Condon, Experiments With Parallel Graph Coloring Heuristics and Applications of Graph Coloring. [5] pp. 309–334.

9. S. Minton, M. D. Johnston, A. B. Philips, P. Laird. Minimizing Conflicts: A Heuristic Repair Method for Constraint Satisfaction and Scheduling Problems. Artificial Intelligence vol. 58 nos. 1–3, 1992, pp. 160–205. 10. C. Morgenstern, Distributed Coloration Neighborhood Search. [5] pp. 335–357. 11. S. D. Prestwich. Coloration Neighbourhood Search With Forward Checking. Annals of Mathematics and Artificial Intelligence vol. 34 no. 4, Kluwer Academic Publishers 2002, pp. 327– 340. 12. S. D. Prestwich. Randomised Backtracking for Linear Pseudo-Boolean Constraint Problems. Fourth International Workshop on Integration of AI and OR techniques in Constraint Programming for Combinatorial Optimisation Problems, le Croisic, France, 2002, pp. 7–20. 13. S. D. Prestwich. Local Search and Backtracking vs Non-Systematic Backtracking. AAAI 2001 Fall Symposium on Using Uncertainty within Computation, Technical Report FS-01-04, AAAI Press, pp. 109–115. 14. S. D. Prestwich, S. Bressan. A SAT Approach to Query Optimization in Mediator Systems. Fifth International Symposium on the Theory and Applications of Satisfiability Testing, University of Cincinnatti, 2002, pp. 252–259.