Click here to load reader

Analysis of the Asynchronous Backtracking

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

Analysis of the Asynchronous Backtracking Algorithm Drew WickeAbstract The purpose of the paper is to explore the asynchronous backtracking algorithm, a distributed constraint satisfaction algorithm, through the graph coloring problem. I study the parallelism of the algorithm by comparing the number of messages sent and the runtime to the number of vertices. Also, I discuss and analyze various means of prioritizing vertices in a directed constraint cyclic graph.Introduction The asynchronous

Text of Analysis of the Asynchronous Backtracking

Analysis of the Asynchronous Backtracking Algorithm Drew Wicke

Abstract The purpose of the paper is to explore the asynchronous backtracking algorithm, a distributed constraint satisfaction algorithm, through the graph coloring problem. I study the parallelism of the algorithm by comparing the number of messages sent and the runtime to the number of vertices. Also, I discuss and analyze various means of prioritizing vertices in a directed constraint cyclic graph.

Introduction The asynchronous backtracking algorithm or ABT is used to solve distributed constraint satisfaction problems, DCSP. The algorithm and the problem domain were originally studied by Dr. Yokoo and colleagues and published in [1, 2]. The main motivation for the creation and numerous extensions of the algorithm is the ability to solve constraint problems that would be difficult or less intuitive to solve using a centralized algorithm [4]. One area that greatly benefited from this algorithm is multiagent systems. Many problems that arise in multiagent systems can be reduced to a distributed constraint satisfaction problem and this approach has lead to several successful multiagent applications [3]. The rest of the paper is laid out as follows. First, I describe what constraint satisfaction is and give example problems. I then give an overview of the ABT algorithm and present the modifications I chose to implement. I provide the details of the graph coloring experiments and show their results. Then I discuss the difficulty and the motivation for solving directed

constraint satisfaction problems. Finally, I conclude with a brief look at a current advance in solving distributed constraint satisfaction problems and describe my future work. Constraint Satisfaction Problem A constraint satisfaction problem is a problem in which the goal is to satisfy the constraints of the problem given a domain of values to choose from. This can be restated more mathematically as a problem that consists of n variables finite, discrete domains , whose values are taken from

, respectively, and a set of constraints on their values. A is a predicate that is

constraint is defined by a predicate. The constraint defined on the Cartesian product

. The predicate can be any type of formula or

relation. Solving a CSP is equivalent to finding an assignment of values for all variables such that all constraints are satisfied [3]. Similarly, distributed constraint satisfaction as defined by Yokoo is a CSP in which the variables and constraints are distributed among automated agents [2]. I assume the agents use the following communication model: Agents communicate by sending messages. An agent can send messages to other agents if and only if the agent knows the addresses of the agents. The delay in delivering a message is finite, though random. For the transmission between any pair of agents, messages are received in the order in which they were sent. [2] This pertains to how the underlying message passing system works. In my implementation of the ABT algorithm Yokoos communication scheme conforms to the message passing interface specifications that I used [9].

Now that we know what a CSP is I can provide some examples. The most widely studied instance of a constraint satisfaction problem is the graph coloring problem [8]. The goal of this problem is to assign a value to each variable such that it does not equal the value of connected vertices. This is the problem used to explore ABT in this paper. Another classic CSP problem is the n-queens problem. The problem is: given a chess board with n-queens place them so that they are not in conflict as per the rules of chess. Both of these problems can be solved using the asynchronous backtracking algorithm. Asynchronous Backtracking Algorithm The asynchronous backtracking algorithm or ABT is the asynchronous version of the backtracking algorithm. Before the actual algorithm starts the constraint graph is created and each vertex is given a priority. The connections and priority are then given to each of the processes. Essentially, ABT works by each agent first randomly picking a value for its variable from its domain. Each agent then communicates its value to agents with lower priority via the OK message type. Every agent except the highest priority agent receives the values of the higher priority agents and adds the value to its agent view. The agent view is a list that contains what the agent knows about the other agents value. Since the goal is to satisfy all of the constraints, if a value that it receives does not satisfy a constraint and the agent cannot find a value in its domain to satisfy the constraint the agent sends a NOGOOD. That is, the agent sends its entire agent view to the least priority agent in the agent view and it removes that agents value from its agent view. However, if the agent does find a value that satisfies the constraints it will then send an OK message with its new value to its neighboring lower priority agents. When an agent receives a NOGOOD it first checks if it matches its agent view. If the values match then it adds

the NOGOOD to its list of NOGOOD messages otherwise the NOGOOD is ignored. These messages are treated as new constraints on the agents value. However, if an agent receives a NOGOOD that is the empty set then the algorithm terminates with no solution. However, if there are no messages being sent from any agent then the solution must have been found such that all of the constraints have been satisfied. The pseudo code from Yokoos algorithm from [2] is in the appendix. It provides a more functional view of the operations of the algorithm. Analysis The ABT algorithm is NP-complete since the CSP problem is also NP-complete [2]. This means that the ABT algorithm is exponential in the number of variables n[2]. This can be seen by that fact that in the worst case the algorithm must try all possible combinations in order to terminate. Another way to view the runtime is to look at the stage in which the algorithm takes the longest which is checking its constraints against its value. The researchers in [3] found that this area takes the longest so they tried fixing it by only calling it when necessary. Also, The worst-case space complexity of the algorithm is determined by the number of recorded nogoods [2]. Implementation This paper explores a slightly modified version of Yokoos original algorithm created in [3]. I do not add new neighbors to an agent and I also change my agent view when I receive a valid nogood that has new values. The code is in C and uses the Open MPI library for the message passing. It was created to solve the graph coloring problem. So, the constraints are such that if x has a directed constraint going out to y then the value of x cannot equal ys value. For the directed version each process picks two random vertices to connect to and its priority is assigned based on its process id. In the undirected implementation the root or process

zero created connections like the directed version, but it then made the connection bidirectional to create an undirected graph. From there, each process then chooses a random value from its domain and sends it to the lower priority agents. The algorithm continues like the pseudo code until either it terminates due to an agent producing the empty set or no messages are sent from any of the process. Experiments and Results The algorithm was run on a cluster and was created to solve the graph coloring problem with three colors for each vertex. I measure the runtime, number of OK messages sent and the number of NOGOOD messages sent. The reason for some of the discrepancies in the runtime may be due to network latency. First, I tested the ABT on 75 random directed graphs for 3, 4, 5 and 6 variables with a domain of three values. The figure below shows the relation between the number of variables and the number of ok messages sent. It can be seen that the median of the values is increasing very quickly as the number of variables increases.

Directed Graph Number of Variables vs. OK Messages35 30

# of OK Messages

25 20 15 10 5 0 0 1 2 3 4 5 6 7 Three Four Five Six

Number of Variables

I also produced a graph for the number of NOGOOD messages sent for the directed version. It is easy that when there are few variables the number of NOGOODs sent is small. It is also dependant on the original choice for the value of the variable.

Directed Graph Number of Variables vs. NOGOOD Messages12 # of NOGOOD Messages 10 8 6 4 2 0 0 1 2 3 4 5 6 7 Three Four Five Six

Number of Variables

The table below shows the average time to complete the algorithm in micro seconds for four, five and six variables. As is clear the more variables on average the length of time it takes to complete increases. # of variables Time in micro seconds 4 5 6 13046.63 13687.07 16739.75

Next, I experimented with the algorithm on undirected graphs. As described in the implementation section I created 75 random undirected graphs and measured the same data only for three, four and five variables. The first graph shows the relationship between the number of OK messages and the number of variables. For the undirected graphs with three and four variables there were no NOGOODs sent. However, for five variables there was a very small percentage of the graphs sampled that had very large numbers of OK messages and NOGOOD

messages sent. This may be due to an unsolvable graph that had a worst case configuration of connections. Finally, I show the average runtimes for each of the variable sizes.

Undirected Graph Number of Variables vs. OK Messages30 # of OK Messages 25 20 15 10 5 0 0 1 2 3 4 5 6 Three Four

Five

Number of Variables

# of variables Time in micro seconds

3 4 5 10784.39 14513.92 14965.53

I b

Search related