3.5 Solution To the Constraint Model
3.5.3 Solution Extraction
As described in the previous chapter, a plan for a planning problemP, is defined as a triplet:
§3.5 Solution To the Constraint Model 69
where ActIns is a set of action instances where for each a ∈ ActIns : inplan(a) = true, StartTimeIntvis the set of start times, i.e. ∀a ∈ ActIns : start(a) ∈ StartTimeIntv, and DistConsis a set of start time differences where ∀a,a0 ∈ ActIns,a 6= a0 : dist(a,a0) ∈
DistCons. We can extract a flexible plan from the solution as the following:
• Select each actionasuch thatinplan(a) = trueandais not a dummy action, put it in ActIns.
• Select each action a such that inplan(a) = true and a is not a dummy action, put
[lb(start(a)),ub(start(a))]inStartTimeIntv
• Create a set of distance constraints,dist(a,a0), where
dist(a,a0) =start(a0)−start(a)
for each pair of actionsaanda0, such thatinplan(a) = trueandinplan(a0) =true, and put them inDistCons. Note thatstart(a)andstart(a0)are intervals and may not be fully assigned in a solution, but instead constraint on them are represented as STN. Given aFlexiPlan(P), extracted from the solution to the transition-based constraint model, as described above, note the following two points:
1. Due to Constraint5, if an action ais included in the plan, then all its transitions T ∈
trans(a)are also included in the plan. Note that each partial order schedule on domain objects includes all active transitions on that domain object. This means that for each action included in ActIns, each of its transitions are part of the partial order schedule on the corresponding domain object, and for all transitions (except for the dummy tran- sitions) that are included in the partial order schedules, their corresponding actions are included in theActIns.
2. Each precedence constraint between a pair of transitions in the partial order schedules implies a temporal constraint between start and end times of the transition pair, which implies a distance constraint between their corresponding action start times. When an action’s start time gets updated because of precedence constraints posted on one domain object, then via Constraint2that change gets propagated to transitions on other domain objects.
What follows from the above two points is that the distance constraints (DistCons) of the
FlexiPlan(P)among the actions are the results of precedence constraints posted on the partial order schedules on domain objects.
3.5.3.1 Solution to Planning Problem
EachrealizationRof theFlexiPlan(P), where we fix the start time of each action instances (that implies the fixed start and end times for transitions) such that each distance constraint inDistConsis satisfied, creates anexecutionfor each partial order schedule on each domain object. For each domain object, each execution of the partial order schedule represents avalid scheduleon the domain object. This means that all realizations of the flexible plan arevalid realizations. That means the flexible plan extracted from the solution of the transition-based constraint model of the planning problem is a solution to the planning problem.
3.6
Summary
In this chapter we have described how a planning problem described in transition-based rep- resentation can be complied into a CSP by bounding the number of action instances. We have shown that the solution of the CSP corresponds to a flexible solution to the planning problem. The key assumption we have made for compilation is to bound the number of action instances in a plan. In many practical planning and scheduling problems, for most of the actions we can find a small, fixed number of their occurrence. There are usually only a few action(s) that a modeler has to guess the number of occurrences of. This key parameter plays an important role in the size of complied CSP, which in turn can affect the solving time of the planning problem (see Section6.5for experimental results). One possible way to overcome this restriction is to add a new copy of an action when the action is included in the plan. In the rest of the thesis we assume that each action can occur at most once.
Chapter 4
Solving: Branching, Propagation and
Inference Techniques
A constraint satisfaction problem is solved by making decisions on constraint variables, where a decision is an assignment of a value to a variable from its domain. This process of making decisions, also called search, stops when there are no more decision to make. We call a con- straint problem solved when there are no more decisions to make and none of the constraints are violated. The set of decisions is called a solution to the problem. There are mainly two ways to search for a solution for a constraint problem: systematic search, and local search. In systematic search, at each search step we assign a decision variable a possible value. If the assignment fails, meaning it violates some constraint, search backtracks to the previous step and try other possible values of the variable. In local search, usually we search for a solution by assigning all decision variables at once, and checking if this satisfies all constraints. If it violates any constraint, local search tries to fix the set of assignments, by reassigning a sub- set of variables to new values, and checking for violation of constraints again. Once it finds a set of assignment that satisfies all constraints it returns the set as the solution. One major difference between systematic search and local search is that the first one can becomplete, and latter one is not. By complete we mean that systematic search will find a solution if there exists one, otherwise it can detect if there are no solution for the problem. Local search can’t prove unsatisfiability. But, in practice, for large scale industrial problems, local search is the first choice because in general it can find a solution faster than systematic search.
The search space of a problem is defined as the all possible variable value assignments. Given a search space of a problem, only certain parts of the search space contain solutions to the problem. The time to find a solution via systematic search is proportional to the size of the search space. The bigger the search space, the more time it takes to find a solution (if one exists). One way to improve the efficiency of search1 is to remove parts of the search space where no solution exists. Propagation of constraints means pruning the search space by removing values from the domains of constraint variables, based on the property of given
1From now on we will refer to systematic search by search.
constraints. Generally, given a constraint problem, propagation of constraints is performed at each search step. Because it is invoked at each step in the search space it is usually the case that we need to compromise on how much search space it can prune and how expensive it is. A propagator is calledconsistent if it doesn’t prune any value from variables domains that is part of a solution. In other words, a consistent propagator doesn’t prune any solution from the search space. Also, a propagation method is called completeif it can remove all incon- sistent value from variable domains. The effect of employing complete propagation methods at each search step is that the search can find a solution without failing (that is backtrack free way). But devising complete propagation technique is non-trivial and expensive in terms of run time. Usually, in constraint-based search, cheap (low-order polynomial time) incomplete propagation techniques are employed during search.
In this chapter we describe propagation techniques for the constraint model described in the previous section. Before that we will discuss our basic branching scheme, that will describe how we make a decision at each search step.
4.1
Branching Scheme
A branching scheme describes how we make decisions at each search step. Note that we want to generate a flexible plan, meaning start times of action instances are intervals, not fixed. Recall that our constraint model hasstart,endandinplanvariable for each action and transition, achieve variables for each achieve-relevantpair of state variable transitions and
follow variables for eachcan-followpair of transitions on each state variable, andsupport
variables for each support-relevant pair of resource transitions on each resource. Since we don’t want to make decision on thestartandendtimes of actions and transitions, we exclude them from being decision variables. Also, due to the action activation constraints we can see that decisions on achieve andsupport determines the values of inplanvariables (for both actions and transitions). For this reason we branch on three decision variables: achieve,
followandsupport.
At each CSP search step we pick a decision variable and assign a value from its domain, then propagate the effect of assignment. If the propagation fails, i.e. if the assignment leads to an inconsistent state of CSP, we backtrack and prune that value from the domain of the variable. This means that at search step, first we select a decision variable (variable selection) and then select a value from its domain (value selection). Performance of any CSP search technique depends a lot on its variable and value selection procedure. To solve different problems, it may be necessary to employ different variable value selection techniques to solve the problems efficiently. Creating a general variable value selection heuristic that would work sufficiently well on variety of problems is a hard problem and is an active research area in the automated planning and scheduling community. This topic will not be addressed in this thesis. In this