A new CSP graph-based representation for Ant Colony Optimization

2 downloads 379 Views 695KB Size Report
search methods have been particularly active looking for feasible approaches. One of the ... However, other kind of searching and optimization techniques like ...... Springer Publishing Company, Incorporated, 2008. [6] Yang and Xin-She, ...
2013 IEEE Congress on Evolutionary Computation June 20-23, Cancún, México

A new CSP graph-based representation for Ant Colony Optimization Antonio Gonzalez-Pardo

David Camacho

Computer Science Department Escuela Polit´ecnica Superior Universidad Aut´onoma de Madrid Email: [email protected]

Computer Science Department Escuela Polit´ecnica Superior Universidad Aut´onoma de Madrid Email: [email protected]

Abstract—Constraint Satisfaction Problems (CSP) have been widely studied in several research areas like Artificial Intelligence or Operational Research due their complexity and industrial interest. From previous research areas, heuristic (informed) search methods have been particularly active looking for feasible approaches. One of the critical problems to work with CSP is related to the exponential growth of computational resources needed to solve even the simplest problems. This paper presents a new efficient CSP graph-based representation to solve CSP by using Ant Colony Optimization (ACO) algorithms. This paper presents also a new heuristic (called Oblivion Rate), that have been designed to improve the current state-of-the-art in the application of ACO algorithms on these domains. The presented graph construction provides a strong reduction in both, the number of connections and the number of nodes needed to model the CSP. Also, the new heuristic is used to reduce the number of pheromones in the system (allowing to solve problems with an increasing complexity). This new approach has been tested, as case study, using the classical N-Queens Problem. Experimental results show how the new approach works in both, reducing the complexity of the resulting CSP graph and solving problems with increasing complexity through the utilization of the Oblivion Rate.

I. I NTRODUCTION TO CSP P ROBLEMS Constraint Satisfaction Problems (CSP) belongs to this kind of traditional NP-hard problems with a high impact in both, research and industrial domains. The basic definition of CSPs can be stated from a set of objects (variables) that need to be assigned with a particular value, which must satisfy a set of constraints. Therefore, any CSP problem is composed by a set of variables (X) that can take binary, integer or real values from their domain (D). The values assigned to these objects must satisfy several constraints (C) (a constraint represents some kind of restriction to those values that this variable could take). Therefore, any CSP is represented with a triple (X, D, C) where X = {x1 , x2 , x3 , ...xn } is the set of objects that composes the problem, D = {d1 , d2 , d3 , ...dn } is the set of domains that contains the different values for the objects described in X, and C represents the set of constraints that relates the objects with their values [1]. There is a wide number of complex research and industrial problems that can be modelled using CSP, the main techniques, algorithms and methods obtained from this area has been applied in the last decades to real domains with an increasing level of complexity (i.e. scheduling and planning problems,

978-1-4799-0454-9/13/$31.00 ©2013 IEEE

energy optimization, man-power scheduling, travel and car routing optimization, etc. . . )[1]. From previous domains applications, one of the critical problems to work with CSP is related to the exponential growth of the computational resources needed to solve real problems. To handle and alleviate part of this combinatorial explosion in the searching process, Heuristic (Informed) search has been extensively studied (i.e. BFS, A*, IDA*, Tabu Search, Hill-climbing, Simulated annealing, Local beam, Genetic Algorithms, Swarm algorithms, etc. . . ), some of those algorithms have been specifically designed from the CSP research area. Some representative examples are: chronological backtracking (CBT), Back-jumping, conflict-directed backtracking, learning, or look-ahead techniques (i.e. Forward Checking), these algorithms are usually combined with other techniques like constraint propagation techniques (node consistency, arc consistency, and path consistency) to modify the constraint satisfaction problem ensuring its local consistency conditions (those related to the consistency of subsets of variables and constraints), a popular approach used to maintain the consistency in a CSP is the AC-3 algorithm. Previous searching and consistency algorithms are usually combined with a set of heuristics to improve the system performance. The searching process, these heuristics can be applied to select the next variable to be assigned (minimum width, maximum degree or maximum cardinality amongst others), or to select a value for a given variable (min-conflicts, promise, max-domain-size, weighted-max-domain-size, point-domain-size,. . . ) [1]. However, other kind of searching and optimization techniques like Evolutionary Algorithms (EA) [2], [3] and Swarm Intelligence [4], [5] have been applied to CSP problems. This work is focused on the latter, Swarm Intelligence algorithms allows to generate collective behaviour in self-organizing systems [6], where the interactions between individuals generate collective knowledge of social colonies [7]. Some examples of this type of algorithms are: Ant Colony Optimization (ACO) [8], Particle Swarm Optimization [9], Bee Colony Optimization [10], Bird Flocking [11] or Bacterial Foraging [12]. These algorithms are composed by a population that travels through the solution space to obtain the best

689

solution. When anybody wants to apply any of the previous techniques (EA or Swarm) to CSP problems, he/she must deal with the representation and modelling of the CSP problem in the optimal way for the selected algorithm [13], [14]. II. I NTRODUCTION TO ACO A LGORITHMS In this work, the classical Ant Colony Optimization (ACO) algorithm [8] has been applied to CSP problems. Traditionally, ACO [15] is used to find the shortest path between two nodes in a graph, G=(V,E), where V is the set of nodes that composes the graph and the edges, E, represent the connections between nodes. The goal of the ants is to travel from the source node (nest) to the destination node (food) using the shortest path. Communication amongst ants is called stigmergy [16] and allows an indirect communication through the environment where ants deposit pheromones that will guide other ants. In ACO algorithms when any ant has finished its path, the ant goes back to the nest depositing pheromones on the followed path. The quantity of pheromones deposited in the edges will depend on the quality of the solution found. This means that better solutions (better paths) will be represented with higher pheromone values. Pheromones guide ants during their execution, this means that the pheromone value will influence the decision of the ants. Initially, when there are not any pheromones, ants select randomly the destination node using an uniform distribution. But when the system contains some pheromones, those nodes with higher pheromone values will have more chances of being selected. This characteristic and the representation of the solution as pheromones, generate the self-organization behaviour [8]. The following equation (Eq. 1) represents the probability of moving from node i to node j (assuming that both nodes are connected).

pij =

  P 

0

α β τij ηij u∈N k i

α ηβ τiu iu

if j ∈ Nik

(1)

if j ∈ / Nik

Where Nik is the set of feasible nodes connected to node i, with respect to the ant k. τij represents the pheromone value of travelling from node i to node j and ηij represents the heuristic value of moving from node i to node j. Finally α and β are two parameters that control the influence of the pheromones and the heuristic function exerts in the ants behaviour. On the one hand, if β ≫ α, ants will be guided basically by the heuristic function. On the other hand, if β ≪ α, the ants will follow the first found paths and thus the algorithm will show a rapid convergence to suboptimal paths. In order to allow the exploration of new solutions, pheromones suffer from evaporation. This means that each iteration, pheromones evaporate according to a specific evaporation rate. This evaporation can be understood as a decreasing rate in the pheromone values and it is computed as follows: τij (t) = (1 − ρ)τij (t − 1). Where the parameter ρ defines the evaporation rate, and τij (t) represents the

pheromone value between node i and node j in a given moment t. The evaporation rate defined as ρ ∈ [0, 1] allows worst solutions (those with low pheromone value) are not selected due to their low pheromone values. III. A NT C OLONY O PTIMIZATION APPLIED TO C ONSTRAINT S ATISFACTION P ROBLEMS The possible utilization of ACO algorithms to solve CSPs has been studied in the last years [17]. Usually, the authors model the CSP as a graph where the ACO is executed. Although several approaches [17], [18], [19] have been successfully applied to CSP obtaining promising results, authors identify an important pitfall in the way the CSP is modelled as a graph. The CSP (defined as (X, D, C)) is usually modelled using a graph G = (V, E): V =  {hXi , vi |Xi ∈ X and v ∈ D(Xi )} E = (hXi , vi , hXj , wi) ∈ V 2 |Xi 6= Xj

(2)

Where the nodes, V , represent the variable/value pairs (< variable, value >) and E represents the edges connecting those nodes whose variable X are different. The problem with this representation is the size of the resulting graph. On the one hand, if the problem has N variables and each of them can take M different values, the resulting graph will contain N ∗ M nodes. On the other hand, the graph is almost full-connected (so each node will be connected to the rest of nodes), for this reason the number of edges is (N ∗ M ) ∗ (M ∗ (N − 1)) = N 2 ∗ M 2 − N ∗ M 2 ∼ = N 2 ∗ M 2. This characteristic makes that problems composed by many variables or by variables that could be assigned with many different values, become really difficult to model due to the size of the resulting graph. Another limitation with this approach is that continuous problems cannot be represented (this is a hot topic research problem in CSP), and only those problems with a finite set of values for the variables are allowed. Some examples of discrete problems are Binary Constraint Satisfaction Problems (i.e. SAT problems), or integer CSP problems with finite domains (i.e. the well-known N-Queens Problem). Solnon applies ACO algorithms to solve N-Queens problems in [19]. In this case each queen is defined by the row and the column of the square where the queen is placed in the board. The values for both variables goes from 1 to N . Therefore, the number of nodes in each graph is N ∗ (2 ∗ N ) = 2 ∗ N 2 . In this case the graph is not full connected because nodes representing the same variable are not connected between each other. With this construction, the total number of edges in the graph is (2∗N 2 )∗((2∗N 2 )−N ) ∼ = 4 ∗ N 4. A different approach is the one used by Khan et. al. [18] to solve N-Queens problems using ACO algorithms. Given a problem composed by N queens, authors create a graph composed by N layers and each layer contains N 2 nodes. Using this representation the graph contains a layer for each

690

queen, and each layer is composed by all the squares of the chess board. Then, each node of a layer i is connected to all the nodes of layer i + 1 with a directional edge going from layer i to layer i + 1, except the last layer that are not connected to any other node. Therefore, resulting graph for N queens contains N ∗ N 2 nodes and (N 2 ∗ N 2 ) ∗ (N − 1) ∼ = N 5 edges. Using this approach ants start in layer 1 and travel from layer i to layer i + 1 until they reach the level N . The action of visiting a node in layer i by any ant is similar to place the i-th queen in the square represented by the visited node. In both approaches, the ants behaviour is very simple: they travel through the network and the action of visiting a node assigns values to the variables. Despite this behaviour and the promising results that both approaches have revealed, the size of the resulting graph grows drastically when the number of queens increases. This increase can be observed in Table I.

a value for a variable at a time? This decision affects the ants behaviour making step 1 more complex. In this work, if a node contains n variables, ants will visit the node n different times because in each visit, only one value is assigned. Another consequence produced by the graph reduction is the increment in the number of pheromones contained in the graph. The pheromones are placed in the edges of the graph, because the validity of a value in a node depends on the given values to the rest of variables of the other nodes. For this reason, the edge connecting N odei with N odej stores all the pheromones related to the variables and values for these nodes. For example, suppose that N odei and N odej contains a variable named var defined as: vari ∈ {val1 , val2 , val3 } varj ∈ {val1 , val2 , val3 }

IV. T HE P ROPOSED CSP G RAPH -BASED R EPRESENTATION In this section the proposed CSP graph-based representation is described. This representation is focused on the reduction of the graph size resulting from converting the CSP into a graph. In this new approach the resulting graph is smaller because nodes represent a set of variables. The easiest way to do this consists of grouping together different variables. For example, using the N-Queens problems, instead of having different nodes for the x and y coordinates that define the queens position, the resulting graph can be composed by N nodes and each node will contain both variables. Regarding CSP restrictions, these are represented by the edges, i.e. two nodes are connected if there is, at least, a restriction involving the variables contained in each node. In order to reduce the number of edges in the graph, more than one restriction can be represented with the same edge (i.e. the resulting graph does not contain parallel edges). This situation is produced when the problem contains two, or more restrictions that involve the same nodes. Therefore, edges do not represent a simple problem constraint but a set of constraints involving both nodes. This graph simplification affects the behaviour of the ants that besides the selection of the next node to visit (that it is determined randomly), they are in charge of selecting the value for the variable contained in the current node. Ants behaviour is a little more complex and it is composed by the following steps: 1) Select, randomly, an unassigned variable contained in the current node. 2) Select a value for the variable taking into account the number of satisfied constraints. 3) Create the assignment. 4) Select, randomly, the next node to visit. 5) Move to the selected node and repeat the process. Depending on how the problem is modelled ants behaviour can vary. For example, imagine that each node in the graph contains more than one variable: Will ants assign a value for all the variables contained in the node? or ants will only assign

And the problem has the following restriction: vari 6= varj The validity of a specific value for the variable of vari depends on the value given to varj . But the value itself in a pheromone is not really useful. For this reason, pheromones are composed by the source variable, the destination variable, the source value, the destination value and the pheromone value. Using the proposed representation, a new problem arises. The total number of different pheromones in an edge is proportional to the size of the variable domains of the nodes. That is, if |D(vars )| denotes the different values that the source variable can take, and |D(vard )| represents different values for the destination variable, the edge connecting source and destination node could store, at maximum, |D(vars )| ∗ |D(vard )| different pheromones. In the case where the problem modelled has variables with large domains, the number of pheromones1 in the graph could collapse the system. To reduce the number of pheromones stored in the graph a new heuristic, called Oblivion rate, is included in the system. This heuristic removes from the network a subset of pheromones. The definition of this heuristic affects directly to the system performance. For this reason, the requirements that this heuristic must satisfy are the following: 1) The oblivion function must reduce the number of pheromones contained in the graph in order to avoid the system overload. 2) The number of pheromones must decrease gradually to allow the convergence of the system to the solution. 3) There must be always pheromones in the graph, because if in any step the system removes all the pheromones, 1 The number of pheromones is the number of different pheromones placed in an edge or in the graph.

691

1

the ”history” of the execution is lost, and it would be similar to launch the execution from the beginning. 4) In order to converge to good solutions, the system must remember the better pheromones, those with higher pheromone value.

OblivionRate(step) = 1 −

1 step0.25

(3)

The second function used in this work uses an adaptive exponent value that depends on the congestion of the system taking into account the total number of possible pheromones in the system to compute the percentage of pheromones that are going to be removed. The main problem with this approach is that is not reusable (it cannot be extended to other CSP problems) because this new dynamic exponent is domain-dependent and requires knowledge about the problem modelled. For this work, the modelled problem as case-study (N-Queens problem) uses a specific dynamic function (see Eq. 9), the description of this particular Oblivion Rate is given in the next section.

0.8 Oblivion Percentage

To look for a good oblivion rate function, some approaches have been analysed. The first one is a constant function that removes a fixed number of pheromones in each iteration. This function does not seem to be useful because it needs the definition of a threshold. On the one hand, if this threshold is very high, system would not converge because initial partial solutions would be removed and no pheromones would be deposited in the graph. On the other hand if the threshold is smooth, the system will not remove enough pheromones and the system would be collapsed due to the number of pheromones. Due to previous reasons, it is reasonable to use an adaptive function for determining, during the execution, the number of pheromones that the system will remember. In this work two different functions have been analysed. The first one, is a negative exponential function that depends on the execution step of the algorithm. Using this function when the system is finishing the execution, the majority of the pheromones would be forgotten. The exponent of this function has been experimentally fixed. 1 Figure 1 shows the function f (step) = 1− step x with different values for the exponent x. The huge increment in the early steps when the exponent value is 1, 0.75 and 0.5 suggests that those values are not adequate because the system will converge to partial solutions. In the initial phase of the execution, the pheromone values are low (it is difficult to find the optimal solution, or solutions close to the optimal ones, in the initial steps of the algorithm) if a huge number of pheromones are removed, the system will prematurely converge to partial solutions. On the other hand, when the exponent is 0.15, or 0.25 the grow in the Oblivion rate is much slower but in the case of 0.15, the oblivion rate reaches the limit of 50% pheromones removed that seems not to be enough. For all these reasons, the adaptive function for the Oblivion rate with an exponential function is:

0.9

0.7 0.6 0.5 0.4 1 0.75 0.5 0.25 0.15

0.3 0.2 0.1 0 0

10

20

30

40

50 Step

60

70

80

90

100

Fig. 1. Behaviour of the Oblivion rate when it is defined a negative exponential function using the number of steps and a fixed exponent in the denominator.

V. C ASE S TUDY: N-Q UEENS P ROBLEM For this work, the application domain is the well known N-Queens Problem. This problem consist on placing n chess queens on an nxn chessboard in such a way queens do not attack each other (i.e. queens can not be placed in the same row, column or diagonal). A. Adapting the N-Queens Problem to the proposed representation Using the approach described in this paper, ant colony algorithm works on a graph composed by n nodes that represent n queens. Each node contains two attributes x and y that defines the position of the queen in the chessboard (this attributes can take integer values from 0 to n − 1). Two nodes are connected if there are one, or more, restrictions that involve some of the variables contained in both nodes. In the case of N-Queens problem, nodes are affected by four restrictions: one restriction involves that two queens can not be located in the same row, another restriction limits the column and the other two restrictions reflect the diagonals. The goal of any ant is moving through the network applying values to the different variables. Once the ants are in a node, they randomly select an unassigned variable and then they select a value for this variable using the Eq 1. In order to select a value for a given variable, ants checks how many restrictions are satisfied in the case of selecting the given value regarding to its partial assignment. Then, values that violate any restriction are ignored. Finally, ants make a proportional selection taking into account the number of satisfied constraint in such a way that values that satisfy more constraints have more probabilities for being selected. B. Description of the oblivion function designed for N-Queens problem This work uses an exponential function with a dynamic exponent that takes into account the system congestion, computed as the current number of pheromones in the system divided by the total number of pheromones of the problem.

692

Restrictions only involve two nodes (or queens), for that reason the maximum number of pheromones on an edge is equal to the number of different combinations of both queens in allowed positions on the chessboard. The problem is that the location of the first queen limits the number of possible positions where the second queen can be placed. This characteristic is represented in Figure 2(a) where there are 12 possible squares (green squares) allowed to place the other queen in Figure 2(b) there are only 9 available squares.

(a) Example #1

(b) Example #2

(c) Representation the different levels

of

Fig. 2. Examples #1 and #2 represent how the number of pheromones between two queens depends on the position of the first queen. Red squares represent invalid positions for the second queen, while green squares are allowed squares. Figure 2(c) shows the different levels in a 5x5 chessboard.

location of the first one, the mathematical expectation is used to compute the total number of pheromones per level. The function p(i, n) is the probability of placing a queen in the level i given a chessboard of size n. This probability is defined in Eq. 6.Where the fraction is used when n is even or when n is odd and i < ⌈ n2 ⌉. Eq. 5 returns the maximum number of pheromones between two nodes. In order to get the maximum number of pheromones in the system, the function called M P (n) showed is the number of in Eq. 7 is used. In this equation, n∗(n−1) 2 edges in this system applied to N-Queens problem. Finally, the system congestion (SG) in a step (t) for a chessboard of size n is showed in Eq. 8. In this function the term N P (t) refers to the number of pheromones contained in the graph in the step t. This congestion is used in the adaptive oblivion rate function defined in Eq. 9, where t is the step and n is the size of the board. Using this function, the higher number of pheromones created in the system, the higher number of pheromones are going to be forgotten. This procedure remove those pheromones with lowest pheromone values. C. Comparison of Graph Sizes

Table I summarizes a comparison between the size of the graph of the presented model and the size of the graph described in [19] and [18]. This table only takes into account the number of nodes and the number of edges of the resulting graph where the ACO is executed. As can be seen, using the proposed representation, the size of the resulting graph is considerably reduced. This reduction affects to the ants behaviour (because now ants have the task of deciding what value will assign to each variable) and the number of pheromones in the graph, because the combinatorial explosion in the number of nodes (when considering nodes F (l, n) = (n − 1)2 − (n − 1 + 2 ∗ l) (4) as < variable, value >) is translated to a combinatorial ⌈n 2 ⌉−1 explosion in the number of pheromones. X 2 F (i, n) ∗ p(i, n) (5) P (n) = n + i=0 VI. E XPERIMENTAL RESULTS  1 if n is odd and i = ⌈ n2 ⌉ In this section, some experimental results are given. These p(i, n) = 2∗(n−2i)+2(n−2−2i) (6) otherwise n2 experiments have been designed to validate the proposed n ∗ (n − 1) M P (n) = ∗ P (n) (7) model and also to answer some questions related to the 2 behaviour of the Oblivion Rate against the traditional N P (t) SG(t, n) = (8) evaporation rate. M P (n) A. Could the standard Evaporation Process work as the 1 OblivionRate(t, n) = 1 − SG(t,n) (9) Oblivion Rate? t The equation that defines the number of possible positions The main goal of the Oblivion rate is to reduce the for the second queen once the first queen is placed, is shown number of pheromones contained in the graph. Although the in Eq. 4. In this equation, l is the level where the first goal of the evaporation process is to reduce the pheromone queen is located, and n is the size of the chessboard. Eq. values in order to difficult worst paths to be selected, the 5 is based on previous equations to define the maximum number of pheromones in the graph does not decrease. That number of combinations (pheromones) between two queens in is, the execution of an ACO with a high evaporation rate a chessboard of size n. The first term of Eq. 5 (n2 ) represents generates pheromones with very low pheromone values, but the possible number of destinations for the first queen. As the pheromones still remain in the system and they can finally the possible destination for the second queen depends on the saturate it. In order to compute the number of possible positions for a queen given the position of the first one (i.e. to compute the maximum number of pheromones for two queens), the concept of level in the chessboard have been defined. In this work a level contains all the position that if the first queen is placed in any of them, there is the same number of allowed positions for the second queen. Figure 2(c) shows all the levels contained in a 5x5 chessboard. It is important to know that the number of levels in a chessboard of size n is ⌈ n2 ⌉.

693

# Queens

Khan et. al 2009 # Nodes # Edges

Solnon 2002 # Nodes # Edges

Proposed Approach # Nodes # Edges # Edges*

8

512

28672

128

15360

8

56

10

1000

90000

200

38000

10

90

45

50

125000

3.0625 × 108

5000

2.475 × 107

50

2450

1225

75

421875

2.34 × 109

11250

1.25 × 108

75

5550

2775

100

106

109

20000

3.98 × 108

100

9900

4950

150

3375000

7.54 × 1010

45000

2.018 × 109

150

22350

11175

200

8000000

3.18 × 1011

80000

6.38 × 109

200

39800

19900

9.9 ×

28

TABLE I T HIS TABLE COMPARES THE MODEL PROPOSED IN THIS PAPER WITH THE APPROACHES OF S OLNON [19] AND K HAN [18]. A S CAN BE SEEN THERE IS AN IMPORTANT REDUCTION IN BOTH , THE NUMBER OF NODES IN THE RESULTING GRAPH AND THE NUMBER OF EDGES OF THE GRAPH . U SING THE PROPOSED APPROACH APPLIED TO N-Q UEENS PROBLEM , EACH NODE IS CONNECTED TO THE REST OF NODES ( I . E . n ∗ (n − 1) EDGES ). A S IN THE N-Q UEENS PROBLEM , RESTRICTIONS ARE THE SAME FROM NODE i TO NODE j AND FROM NODE j TO NODE i, THE RESULTING GRAPH IS A n∗(n−1) EDGES . BI - DIRECTIONAL GRAPH WITH 2

In order to prove this fact, Figure 3(a) shows the number of pheromones created in the system configured with a high evaporation rate. As can be seen in this figure, the number of pheromones is not reduced. This fact emphasizes the need of using the Oblivion Rate in order to avoid the system congestion. B. Is the oblivion function useful? As it was said in Section IV, the reduction in the resulting graph affects to the number of pheromones that can be contained in the system. And, depending on the problem, if the number of pheromones created is very large, the system would be overloaded and the performance of the system would get worse. In our case study, the N-Queens problem, there are three factors that affects to the number of pheromones: 1) The number of queens of the problem. 2) The number of ants in the system. The number of ants in an ACO algorithm represents the number of ”parallel” searches in the search space. If the number of ant increases, the number of searches increases, and thus, the number of pheromones deposited on the graph also increases. 3) The number of iterations that the system is executed. When the number of iterations increases, ants expend more time searching for different solutions and then, more pheromones are deposited on the system. As can be seen in Figure 3(c) and Figure 3(d), previous parameters influence in the number of pheromones. Also can be seen that the number of pheromones is very high: 4 × 104 in the case of Figure 3(c) and 7 × 104 in the case of Figure 3(d). These pheromones congest the system and the executions turns very slow. For this reason, the Oblivion Rate is needed to remove pheromones in the system and alleviate the system congestion. C. What type of Oblivion Rate works better? In this work, two different types of Oblivion Rate functions have been analysed. The first one is an exponential negative

function with a fixed exponent (Eq. 3), the second function is based on the congestion of the system taking into account the number of pheromones (Eq. 9). Figure 3(b) shows the number of pheromones deposited in the graph when the Oblivion Rate is defined by Eq. 3, when the Oblivion Rate uses Eq. 9, and when the system does not use the Oblivion Rate. In these experiments 100 ants try to solve a 25-Queens problem during 200 iterations. Each experiment is repeated 10 times, and Figure 3(b) shows the mean number of pheromones. This figure shows how the Oblivion Rate reduces the number of pheromones in the system. Using the Oblivion Rate with the fixed exponent (Eq. 3) provides the highest reduction of pheromones. The problem with the Oblivion Rate that uses the congestion of the system is the total number of pheromones. This number is so big that the exponent is always close to 0. For example, in the case of 25 queens the total number of pheromones is 810009200, the maximum number of pheromones deposited in the system is 127481, thus the system congestion is 1.5738 × 10−4 and the number of pheromones removed is very low, but the computer is congested. D. Does this approach work? Despite the advantages of the Oblivion Rate presented so far, the main question is whether this approach is able to solve the different problems or not. Table II shows a summary of several experiments carried out in this work and the maximum number of queens placed in each experiment. All these experiments used the Oblivion rate with fixed exponent (Eq. 3). This table shows how the proposed approach allows to obtain suboptimal solutions close to the complete ones. There are some parameters that are not shown in this table and which are meaningful for the execution of the algorithm. The values for these parameters are the same in all the executions: • Evaporation rate: 5%. • α: 1 and β:1.5.

694

5

2.5

5

x 10

2.5

x 10

Evaporation 5% Evaporation 90% 2

Num. Pheromones

2

Num. Pheromones

Dynamic Exponent Fixed Exponent Without Oblivion Rate

1.5

1

1.5

1

0.5

0.5

0 0

20

40

60

80

100

120

140

160

180

0 0

200

20

40

60

80

100

120

140

160

180

200

Step

Step

(a)

(b) 4

4

4

7

x 10

3.5

6

3

5

Num. Pheromones

Num. Pheromones

25 Queens 50 Queens

2.5 2 1.5

x 10

25 Ants 50 Ants 100 Ants

4

3

2 1 1

0.5 0 0

10

20

30

40

50

60

70

80

90

0 0

100

10

20

30

40

50

60

70

80

90

100

Iteration

Iterations

(c)

(d)

Fig. 3. Figure 3(a) shows the evolution in the number of pheromones using different evaporation rates. Figure 3(b) shows the performance of different Oblivion Rate functions. The influence that the number of queens and the number of ants exert on the number of pheromones in the system are shown in Figure 3(c) and Figure 3(d). Figure 3(c) shows the number of pheromones with a population of 25 ants when they are executed during 100 iterations. The problem represented in Figure 3(d) is composed by 25 queens with an increasing number of ants.



Pheromone update rate: 0.1.

VII. C ONCLUSIONS AND D ISCUSSION Constraint Satisfaction Problems provides an interesting complex framework to test and prove new heuristic-based solving methods approaches like Swarm Intelligence. The interest is related to the complexity of CSP problems (NP-complete), and the possible applications to real and industrial problems. One of the most known Swarm Intelligence algorithm is Ant Colony Optimization proposed by Marco Dorigo [8]. In order to apply ACO algorithm to CSPs, the problem must be modelled as a graph where the ACO takes place. The current procedure to do that is by creating a full-connected graph containing as many nodes as pairs < variable, value > contained in the problem. This approach has several disadvantages: 1) Depending on the problem (number of variables and domain cardinalities), there could be a huge number nodes. 2) The number of edges in the graph is also very high. 3) This representation can not deal with problems that contain continuous variables.

In order to solve this problem a new CSP graph-based representation is proposed. The goal of this new approach is the reduction on the resulting graph complexity by reducing the number of nodes and connections. The idea is to create nodes that group different variables and create edges between nodes only if there is, at least, one restriction involving any of the variables contained in the nodes. As a case study, this paper tested this approach trying to solve the well-known N-Queens problem. The goal of this problem is to place in an N xN chessboard N queens in such a way that the queens do not attack each other. The reduction of the graph is shown in Table I, where the proposed approach is compared with other two approaches [18], [19]. As it can be seen, there is an important reduction in both, the number of edges and the number of nodes in the graph. The main problem with the proposed approach is related to the number of pheromones created in the system. The reduction on the number of nodes generates an increase in the number of pheromones deposited on the edges. If the variable domains of the problem have a lot of values, the combinatorial explosion of the number of pheromones can

695

Queens

Rep.

Ants 25

25

20

50 100 25

50

15

50 100

Iterations

Result

Max Queens

100 200 100 200 100 200

22.85 ± 0.79 23.45 ± 0.58 23.25 ± 0.62 23.85 ± 0.79 23.45 ± 0.74 24.05 ± 0.66

24 25 24 25 25 25

200 300 200 300 200 400

45.73 ± 0.85 46.26 ± 1.06 47 ± 1.09 46.13 ± 1.08 46.53 ± 1.02 47.8 ± 0.75

47 48 49 48 48 49 73 73

75

10

200

300 500

71.5 ± 0.8 71.3 ± 0.9

100

4

300

800

96.75 ± 0.83

98

150

2

400

900

146.5 ± 0.5

147

200

1

500

1000

194

194

kind of algorithms (i.e. Genetic Algorithms, Tabu search or hill-climbing search) as a seed to look for the global/optimum solution?. As future work, the application of this graph construction method must be applied to more complex CSP problems like scheduling. ACKNOWLEDGEMENT This work has been supported by the Spanish Ministry of Science and Innovation under grant TIN2010-19872 (ABANT). R EFERENCES

TABLE II S UMMARY OF THE EXPERIMENTAL RESULTS . T HIS TABLE PROVIDES INFORMATION ABOUT THE NUMBER OF QUEENS , THE ITERATIONS , THE NUMBER OF ANTS AND THE NUMBER OF REPETITIONS FOR EACH EXPERIMENT. T HE COLUMN ”R ESULT ” SHOWS THE MEAN NUMBER OF QUEENS LOCATED IN THE CHESSBOARD AND THE STANDARD DEVIATION . F INALLY, THE LAST COLUMN SHOWS THE MAXIMUM NUMBER OF QUEENS CORRECTLY PLACED IN EACH SET OF EXPERIMENTS .

saturate the system by increasing the execution time. There are, also, two parameters that influence in the number of pheromones: the number of iterations that the system is running, and the number of ants that compose the colony. Finally, in the case of the N-Queens Problem, the number of queens (i.e. the size of the problem) also influences the number of pheromones. Figures 3(d) and 3(c) show the influence of these factors. In order to reduce the number of pheromones a new heuristic is introduced in the algorithm. This heuristic is called Oblivion Rate and its goal is to remove from the system those pheromones with worst values. Two different functions for the Oblivion Rate have been evaluated and both of them provides an important reduction in the number of pheromones (see Figure 3(b)). The better reduction is obtained when the Oblivion Rate uses a negative exponential function with a fixed exponent (see Eq. 3). Finally, the system have been applied to [25, 50, 75, 100, 150, 200] N-Queens problem. The results obtained from the proposed model are closer to the complete (global) solution of the problem (see Table II). Therefore, although the proposed CSP model and the related ACO implementation shows promising results, two main questions arise from the results presented in this work. On the one hand, this new heuristic named Oblivion Rate allows to find the global/optimum solution?, how it could affects to classical ACO algorithms in other problems?. On the other hand, and maybe more interesting, these local solutions (closer to global/optimum solutions) could be given as ”starting search points” to other

[1] E. Tsang, Foundations of Constraint Satisfaction. Academic Press, 1995. [2] D. B. Fogel, Evolutionary computation: toward a new philosophy of machine intelligence. IEEE Press, 1995. [3] A. E. Eiben and J. E. Smith, Introduction to Evolutionary Computing. Springer-Verlag, 2009. [4] A. Engelbrecht, Computational Intelligence: An Introduction, 2nd ed. Wiley Publishing, 2007. [5] C. Blum and D. Merkle, Swarm Intelligence: Introduction and Applications, 1st ed. Springer Publishing Company, Incorporated, 2008. [6] Yang and Xin-She, “Engineering optimizations via nature-inspired virtual bee algorithms,” 2005, pp. 317–323. [7] D. Karaboga, “An idea based on honey bee swarm for numerical optimization,” Techn Rep TR06 Erciyes Univ Press Erciyes, vol. 129, no. 2, p. 2865, 2005. [8] M. Dorigo, “Optimization, learning and natural algorithms (in Italian),” Ph.D. dissertation, Dipartimento di Elettronica, Politecnico di Milano, Milan, Italy, 1992. [9] J. Kennedy and R. Eberhart, “Particle swarm optimization,” vol. 4, pp. 1942–1948, 1995. [10] D. Karaboga and B. Basturk, “A powerful and efficient algorithm for numerical function optimization: artificial bee colony (abc) algorithm,” J. of Global Optimization, vol. 39, pp. 459–471, 2007. [Online]. Available: http://dl.acm.org/citation.cfm?id=1295970.1296021 [11] C. W. Reynolds, “Flocks, herds and schools: A distributed behavioral model,” SIGGRAPH Comput. Graph., vol. 21, pp. 25–34, 1987. [12] S. Das, A. Biswas, S. Dasgupta, and A. Abraham, “Bacterial foraging optimization algorithm: theoretical foundations, analysis, and applications,” Foundations of Computational Intelligence, vol. 203, p. 2355, 2009. [13] J. L. Bernier, C. I. Herr´aiz, J. J. M. Guerv´os, S. Olmeda, and A. Prieto, “Solving master mind using gas and simulated annealing: A case of dynamic constraint optimization,” in PPSN, 1996, pp. 554–563. [14] B. G. W. Craenen and A. E. Eiben, “Hybrid evolutionary algorithms for constraint satisfaction problems: memetic overkill?” in Congress on Evolutionary Computation, 2005, pp. 1922–1928. [15] M. Dorigo and G. D. Caro, “The ant colony optimization meta-heuristic,” in in New Ideas in Optimization. McGraw-Hill, 1999, pp. 11–32. [16] P. P. Grasse, “La reconstruction du nid et les coordinations interindividuelles chez bellicositermes natalensis et cubitermes sp. la theorie de la stigmergie: essai d’interpretation du comportement des termites constructeurs.” Insectes Sociaux, vol. 6, pp. 41–81, 1959. [17] S. Hoseini Semnani and K. Zamanifar, “The power of ants in solving distributed constraint satisfaction problems,” Appl. Soft Comput., vol. 12, no. 2, pp. 640–651, Feb. 2012. [Online]. Available: http://dx.doi.org/10.1016/j.asoc.2011.10.022 [18] S. Khan, M. Bilal, M. Sharif, M. Sajid, and R. Baig, “Solution of n-queen problem using aco,” in IEEE 13th International Multitopic Conference, INMIC. 2009, 2009. [19] C. Solnon, “Ants can solve constraint satisfaction problems,” IEEE Transactions on Evolutionary Computation, vol. 6, pp. 347–357, 2002.

696