Constraint Directed Variable Neighbourhood Search Alastair Andrew University of Strathclyde, 16 Richmond Street, Glasgow, G1 1XH UK alastair.andrew@cis.strath.ac.uk Abstract Local search depends on making small perturbations to can- didate solutions to arrive at new and potentially better can- didates. There are different schemes for managing the per- turbations and the selection of candidates, but in this work we focus on the neighbourhood defined by particular pertur- bations. Previous work has observed that the problem of lo- cal search becoming trapped in local optima is only experi- enced with respect to a particular neighbourhood. The Vari- able Neighbourhood Search strategy attempts to avoid these optima by linearly switching between neighbourhoods. We propose a new method where the selection of the neighbour- hoods is dynamic and based upon the violations of the prob- lem constraints, Constraint Directed Variable Neighbourhood Search. We compare this approach with Variable Neighbour- hood Search and demonstrate that the same search progress is achieved whilst exploring only a fraction of the states. Introduction All problems in the real world are subject to some form of constraints on their possible solutions. If there were no con- straints then potentially any solution would be valid. This is not the case though as actual scheduling, timetabling, and rostering problems are heavily constrained. The laws of physics are surprisingly inflexible and any attempt to sched- ule two processes to occur simultaneously on the same re- source is destined to fail. Other constraints may not be im- possible to violate but it may be undesirable; few employees would appreciate being rostered to work for 24 consecutive hours! It should be clear that to produce any useful applica- tions for these domains then they must be able to work with the underlying constraints of the problem structure. One approach which has successfully been applied to many of these problems is local search. Local search is concep- tually a very simple algorithm. To find the optimal solution for a problem take an existing solution and try to make some small changes to it. If these changes improve the quality of the solution then accept that solution and try to optimise Copyright c 2007, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. it further. Local search has been shown to give good qual- ity solutions within acceptable time limits where other tech- niques such as Constraint Programming or Linear Program- ming struggle. The weakness of local search is its propensity to become trapped at local optima. These are states where the search has explored all the surrounding solutions and found none better than the current state, however the current state is not the global optima. Good local search algorithms need the ability to escape from, or avoid becoming trapped at, these local optima. Various different techniques have been adopted, most research has gone into meta-heuristics such as Simulated Annealing and Tabu Search. These strategies al- ter the acceptance function of the algorithm so that it can ac- cept solutions which are not necessarily better than the cur- rent state in the hope that extra exploration will ultimately lead to improved solutions. Another approach put forward by (Mladenovic & Hansen 1997) is Variable Neighbourhood Search (VNS). They ob- served that when the search becomes trapped at a local op- tima, this is only because none of the states explored using its neighbourhood offer an improvement. By exploring a dif- ferent neighbourhood then different surrounding states will be reachable and the search may avoid becoming trapped. The canonical VNS explores its alternative neighbourhoods in a linear fashion, the order of which is specified by the al- gorithm designer. Typically though the neighbourhoods are chosen in order of ascending size. An interesting development by (Viana, de Sousa, & Matos 2005) provides a different approach, Constraint Oriented Neighbourhoods. Viana et al note that when searching of- ten small changes can make the solution infeasible and place it into a state that requires several moves to return to feasi- bility. They attempt to avoid this by computing chains of potential neighbourhood moves which can return a solution quickly to feasibility. This notion of linking the selection of the neighbourhood to the violations of the problem con- straints is expanded upon within our work. The approach we propose is that by keeping track of the vi- olations of problem constraints then appropriate neighbour-