Abstract

This paper explores the phase transitions of the contingent planning problems. We present CONTINGENT PLAN-EXISTENCE algorithm and CONTINGENT PLAN-NONEXISTENCE algorithm for quickly proving that the contingent planning instances have solutions and have no solutions, respectively. By analyzing the two algorithms, the phase transition area of the contingent planning problems is obtained. If the number of the actions is not greater than , the CONTINGENT PLAN-NONEXISTENCE algorithm can prove that nearly all the contingent planning instances have no solution. If the number of the actions is not lower than , the CONTINGENT PLAN-EXISTENCE algorithm can prove that nearly all the contingent planning instances have solutions. The results of the experiments show that there exist phase transitions from a region where almost all the contingent planning instances have no solution to a region where almost all the contingent planning instances have solutions.

1. Introduction

There are many artificial intelligence (AI) problems that have been shown to be inherently intractable. For example, the propositional satisfiability problem, or -SAT problem for short, is a prototypical NP-complete problem [1], which means that -SAT problem cannot be solved in polynomial time if . It is significant to investigate the phase transitions of the intractable problems. That is because by working on it the researchers cannot only analyze the structure of intractable problems, but also understand the average-case performance of the solvers that solve these AI problems.

In recent years, much attention has been given to the phase transitions of the random -SAT problems [28]. The researchers found that the phase transitions of the random -SAT problems did exist, where instances changed from being almost all satisfiable to being almost all unsatisfiable, and the hard instances only occurred in the phase transition area. The same phenomena were also observed for some other NP-complete problems, such as the traveling salesman problems [9], the constraint satisfaction problems [10], and the Max-SAT problems [11]. Some other researchers made tremendous progress towards the phase transitions of the artificial planning problems, for instance, STRIPS planning problems [12], conformant planning problems [13], and plan modification of the conformant planning problems [14]. In consequence, one interesting question was put forward whether there were phase transitions in other artificial planning problems.

The aim of this paper is to explore the phase transitions of the contingent planning problems. In order to investigate the phenomena, CONTINGENT PLAN-EXISTENCE algorithm and CONTINGENT PLAN-NONEXISTENCE algorithm are presented. The phase transition point of the contingent planning problems is obtained by providing probabilistic analyses of the CONTINGENT PLAN-EXISTENCE algorithm and the CONTINGENT PLAN-NONEXISTENCE algorithm. The results of the experiments show that the empirical results match the phase transitions from the theoretic analyses.

2. Background

2.1. Definitions and Notations

This section describes some notations about contingent planning problem relevant to our work. Further details, such as the exclusive actions and the consistent actions, can be found in [1519].

Definition 1 (contingent planning problem). A contingent planning problem is a 5-tuple with the following components:(i)is a finite set of states and the subset of is called belief state; (ii) is a finite set of actions. An action is a pair , respectively, called preconditions and effects. Effects are a triple , where is the effect conditions, is the deleting effects and is the adding effects; (iii) is a finite set of observations; (iv) is a set of states over , which is called the initial belief state; (v) is the goal, which is actually a partial state composed of the goal conditions.

More specifically, contingent planning problem is the task of generating a conditional plan given uncertainty about the initial state and action effects, but with the ability to observe some aspects of the current state [20]. In this paper we only focus on the contingent planning problem with uncertainty about the initial state and determinacy about the actions effects, but with the ability to sense the current state.

Definition 2 (action applicability). Let be a belief state. The action is applicable in if : .

If the preconditions of an action are satisfied by all states of the belief state, then the action can be applicable. On the contrary, if the preconditions of an action are not satisfied, the action cannot be carried out, which means that the belief state is changeless. The resulting belief state by executing an action is determined by the adding effects and the deleting effects.

Definition 3 (observation function). Let be a finite set of observations and an arbitrary belief state. The observation function over and is a function such that .

In the following, we will use to denote the set of states that are compatible with the observation ; to denote the set of states that are compatible with other observations rather than .

Definition 4 (conditional plan). The set of conditional plans is the minimal set such that(i); (ii)for an action , if and , then ; (iii)if and , then if then else .

Definition 5 (contingent plan). Given a contingent planning problem , a contingent plan or solution is a conditional plan to the problem if and only if(i) is applicable in the initial belief state ; (ii)every run of from the initial belief state ends in .

A random contingent planning model, called variable model, is used to carry out an investigation on the phase transitions, which we will address in the following.

Definition 6 (variable model). A variable model is a 5-tuple , where(i) is a finite set of states and every state is made up of some propositions; (ii) is a finite set of actions. For , and , where and are the numbers of preconditions of and respectively, and are the numbers of postconditions of and , respectively; (iii) is a finite set of observations; (iv) is a set of initial states over , which is also called the initial belief state; (v) is the goal, which is actually a partial state composed of the goal conditions.

2.2. The Fundamental Analysis of the Variable Model

In this section, we present the distributions of instances under the variable model. Before addressing the analysis of the variable model, two assumptions of the random contingent planning instances generated in this paper are provided. The first one is that each precondition of an action is selected independently of other precondition and postcondition. Similar rule is hold for the postconditions. The second one is that each action has a fixed number of preconditions. And the number of postconditions also agrees with the rule.

Because of the assumptions that each precondition (or postcondition) of an action is selected independently of other preconditions and postconditions, and the precondition or the postcondition is either a proposition or its negation, the random contingent planning instances under the variable model are distributed as follows.

Given propositions, actions, preconditions, postconditions, and goal conditions, for a random proposition and an action , is a precondition of the action with the probability ; alternatively is a precondition with the probability . And is the probability for postconditions.

Because the initial state of the contingent planning problem is partially known, there exists a set of initial states, where the number of the initial states is in this paper. Every initial state is made up of conditions, each of which is selected at random from the conditions since there are propositions. For the goal conditions, the goal conditions are also selected at random from the conditions.

Furthermore, in the rest of paper, three inequalities are also used to analyze the phase transitions. The detailed proofs can be found in [21]

Actually, the following analyses for the phase transitions of the contingent planning problems are based on the fundamental analysis of the variable model. Because it is very simple to solve the sort of contingent planning problems that the goal conditions are satisfied when there is not any actions, in this paper we only deal with the sort of contingent planning problems that the goal conditions are not satisfied by the initial belief state.

3. Contingent Plan Nonexistence Algorithm

In this section, we present the CONTINGENT PLAN-NONEXISTENCE algorithm for quickly proving that a contingent planning instance has no solutions. By analyzing the algorithm, the phase transition area is obtained. The framework of the CONTINGENT PLAN-NONEXISTENCE algorithm is presented in Algorithm 1.

Algorithm CONTINGENT PLAN-NONEXITENCE
 for each  
  if ;
  then return  failure;
 endfor
 for each  
  if
  then return  failure;
 endfor
 for each  
;
;
  for each  
   if ;
   then returndon’t know;
  endfor
  for each
   if ;
   then returndon’t know;
  endfor
 endfor
 return  failure;
end

The CONTINGENT PLAN-NONEXISTENCE algorithm firstly considers whether the preconditions of all actions are not in any state in the initial belief state. If a state in the initial belief state does not satisfy the preconditions of all actions, then the instance has no solutions. Then the algorithm checks out whether a goal condition is not a postcondition of any action. If the postconditions of the actions do not cover all the goal conditions, then the instance has no solutions. The algorithm finally applies an observation to split the initial belief state into two belief states and checks out whether the preconditions of all actions are in any state in the two belief states, respectively. If there is a state in one of the belief states that satisfies the preconditions of all actions, then we cannot decide whether the instance has solutions or not. In addition, if there is not a state in all the split belief states that satisfies the preconditions of all actions, the instance has no solutions. For a contingent planning instance with initial states, actions, observations, and goal conditions, the time complexity of the algorithm is . Therefore, the CONTINGENT PLAN-NONEXISTENCE algorithm can decide that the instance has no solutions efficiently.

Theorem 7. The contingent planning instance has no solution if CONTINGENT PLAN-NONEXISTENCE algorithm returns failure; the contingent planning instance cannot be determined whether it has solutions if CONTINGENT PLAN-NONEXISTENCE algorithm returns do not know.

Proof. Let us first list the cases that the CONTINGENT PLAN-NONEXISTENCE algorithm returns failure. (1) The initial belief state involves a state that does not contain the preconditions of all the actions. As we know, if the preconditions of all the actions are not in the state, any action cannot be executed. Because in this paper we only deal with the sort of contingent planning problems that no goal conditions are satisfied by the initial belief state, a sequence of empty actions cannot be the solution of the instances. Therefore, the contingent planning instances do not have solutions. (2) There is a goal condition that is not an effect of any action, which means that the goal condition cannot be obtained by executing any action. Therefore, the contingent planning instances do not have solutions. (3) There is not a state in all the split belief states that satisfies the preconditions of all actions, which means that any action cannot be executed. Therefore, the contingent planning instances have no solutions. Then let us discuss the case that the CONTINGENT PLAN-NONEXISTENCE algorithm returns do not know. There is a state in one of the belief states that satisfies the preconditions of all actions, which means that at least an action can be executed from the belief state. However, we cannot guarantee that all the goal conditions are satisfied by executing any conditional plan from each state in the initial belief state. Therefore, the contingent planning instance cannot be determined whether it has solutions.
By Theorem 7, we know that the CONTINGENT PLAN-NONEXISTENCE algorithm is correct, but it cannot guarantee the completeness. In other words, if a contingent planning instance has solutions, the CONTINGENT PLAN-NONEXISTENCE algorithm could not determine that the instance has solutions. However, we can prove in Theorem 8 that nearly all contingent planning instances have no solutions when is small enough ( is a constant and ).

Theorem 8. For random contingent planning instances under the variable model, if the number of actions satisfies where is the number of propositions; is the number of actions; and , respectively, are the expected numbers of preconditions and postconditions within an action; is the number of goal conditions; is the number of initial states; () is a constant, then the CONTINGENT PLAN-NONEXISTENCE algorithm proves that no solution exists for at least of the instances.

Proof. If we are to prove that the algorithm determines that no solution exists for at least of the instances, we only need to prove that the probability that every initial state satisfies the preconditions of any action, the probability that a goal condition is not a postcondition of any action, and the probability that every initial state in the belief state (or ) satisfies the preconditions of any action are not more than . Suppose (4) is true, we have
Because the initial state of the contingent planning problem is partially known, there exists a set of initial states, where the number of the initial states is in this paper. Every initial state is made up of conditions, each of which is selected at random from the conditions since there are propositions. At first, the probability that every initial state satisfies the preconditions of any action is given as follows:: probability that a state satisfies the preconditions of an action;: probability that a state does not satisfy the preconditions of an action;: probability that a state does not satisfy the preconditions of any action;: probability that a state satisfies the preconditions of any action;: probability that every initial state satisfies the preconditions of any action.
Then, the probability that every initial state in the belief state satisfies the preconditions of any action is given as follows, where the number of the states in (or ) is (),: probability that a state satisfies the preconditions of an action;: probability that a state does not satisfy the preconditions of an action;: probability that a state does not satisfy the preconditions of any action;: probability that a state satisfies the preconditions of any action;: probability that every initial state in the belief state (or ) satisfies the preconditions of any action.
For the goal conditions, the goal conditions are also selected at random from the conditions. Then, the probability that a goal condition is not a postcondition of any action is as follows:: probability that the goal condition is a postconditions of the action;: probability that the goal condition is not a postconditions of the action;: probability that the goal condition is not a postconditions of any action;: probability that the goal condition is a postconditions of some action;: probability that every goal condition is a postconditions of some action.
In the following, we will prove that the probability that every initial state satisfies the preconditions of any action and the probability that every initial state in the belief state (or ) satisfies the preconditions of any action both are not more than . Because the probability that every initial state satisfies the preconditions of any action is less than the probability that every initial state in the belief state (or ) satisfies the preconditions of any action, we only prove that the probability that every initial state in the belief state (or ) satisfies the preconditions of any action is not more than .
By (5), we get
This is equivalent to
Let . By (1), we have
From (8) and (9), we have
This is equivalent to
Let . By (2), we have
From (11) and (12), we have
Simplify (13), and we get
In addition, for therefore, we obtain
Thus, if the inequality of the theorem is satisfied, then the probability that every initial state in the belief state (or ) does not satisfy the preconditions of any action and the probability that every initial state satisfies the preconditions of any action are at least .
Finally, we prove that the probability that a goal condition is not a postcondition of any action is not more than .
From (5), we get
This is equivalent to
By (1), we get
From (18) and (19), we have
This is equivalent to
By (2), we get
From (21) and (22), we have
Simplify (23), and we get Thus, if the inequality of the theorem is satisfied, then the probability that some goal condition is not a postcondition of any action is at least .
Therefore, if the inequality of the theorem is satisfied, then the algorithm will determine that no solution exists for at least of the instances.

Theorem 8 presents an upper bound of the phase transition. If we can obtain a lower bound, the phase transition area of the contingent planning problems will be acquired. Therefore, in the next section, we will present the CONTINGENT PLAN-EXISTENCE algorithm and discuss the lower bound of the contingent planning problems by analyzing the algorithm.

4. Contingent Plan Existence Algorithm

In this section, we present the CONTINGENT PLAN-EXISTENCE algorithm for powerfully determining that a contingent planning instance has solutions. By analyzing the algorithm, the lower bound of the phase transition is obtained. The framework of the CONTINGENT PLAN-EXISTENCE algorithm is presented in Algorithm 2.

Algorithm CONTINGENT PLAN-EXISTENCE
;
for each  
  if
  then ;
 endfor
if
 then returntrue
 for each  
  if applicable and and
  then ;
;
;
    CONTINGENT PLAN-EXISTENCE ;
 endfor
 for each  
;
;
     if and
     then CONTINGENT PLAN-EXISTENCE
      CONTINGENT PLAN-EXISTENCE
 endfor
 returndon’t know
end

In the algorithm, denotes the set of unsatisfied goal conditions, denotes the set of satisfied goal conditions, denotes the considered belief state; denotes the adding effects of the action , denotes the deleting effects of the action , and applicable denotes the action applicable in the belief state . The algorithm firstly initializes , , and , that is, , , and . Then it checks whether all states in the considered belief states satisfy the goal. If each state in the considered belief state satisfies the goal, the value of flag will not change, which means that the instance has solutions. Otherwise, the algorithm considers whether an action can be applied to the considered belief state to ensure that the postconditions of the actions satisfy more goal conditions. If there exists such actions, the process is repeated. The algorithm finally checks whether there is an observation that can split the considered belief state into two nonnull belief states. If the observation does exist, the similar process is repeated in the two branches, and the instance has solutions only when the two branches return true. Except the above three cases, the algorithm cannot determine whether the contingent planning instance has solutions.

Theorem 9. The contingent planning instance has solutions if the CONTINGENT PLAN-EXISTENCE algorithm returns true; the contingent planning instance cannot be determined whether it has solutions if the CONTINGENT PLAN-EXISTENCE algorithm returns do not know.

Proof. Let us first discuss the case that the CONTINGENT PLAN-EXISTENCE algorithm returns true. When all the goal conditions are satisfied by a conditional plan from each state in the initial belief state, we can determine that the instance has solutions. Then we list the cases that the CONTINGENT PLAN-EXISTENCE algorithm returns do not know. (1) The considered belief state has no applicable actions. (2) The number of unsatisfied goal conditions does not decrease by executing all applicable actions. (3) One of branches that the observation splits returns do not know. The above three cases imply that we cannot determine whether the instance has solutions or not.
The CONTINGENT PLAN-EXISTENCE algorithm is correct, but we also cannot guarantee the completeness. In the following, we prove that almost all the contingent planning instances have solutions by analyzing the algorithm when is small enough ( is a constant and ).

Lemma 10. Consider random planning instances under the variable model expecting that of the goal conditions are not satisfied, if where is the number of propositions; is the number of actions; and , respectively, are the expected numbers of preconditions and postconditions within an action; is the number of goal conditions; is the number of initial states; is the number of states of an arbitrary belief state; () is a constant, then the CONTINGENT PLAN-EXISTENCE algorithm applying some action will increase the number of satisfied goal conditions for at least of the instances.

Proof. At first, the probability that some action will increase the number of satisfied goal conditions is given as follows:: probability that a state satisfies the preconditions of an action;: probability that a state does not satisfy the preconditions of an action;: the least probability that every state in an arbitrary belief state does not satisfy the preconditions of an action;: probability that every state in the arbitrary belief state satisfies the preconditions of an action;: the most probability that every state in the arbitrary belief state satisfies the preconditions of an action. Because in this paper we research on the contingent planning problem whose actions have deterministic effects, the belief state during the execution has most states;: probability that the postconditions of an action are consistent with the goal conditions already achieved;: probability that the postconditions of an action achieve at least one of remaining goal conditions.
Thus, the probability that a particular action can be applied will not exclude any satisfied goals and will achieve at least one more goal condition which is is the probability that the action is missing one or more of these properties, and is the probability that actions are unsatisfactory.
Because , then there will be some satisfactory action with probability at least . The inequality is satisfied if .
By (1), we get
By (3), we get
Then, finally,
Thus, if the inequality is satisfied by the number of the actions, the CONTINGENT PLAN-EXISTENCE algorithm applying some action will increase the number of satisfied goal conditions for at least of the instances.

Theorem 11. Consider random planning instances under the variable model if; where is the number of propositions; is the number of actions; and , respectively, are the expected numbers of preconditions and postconditions within an action; is the number of goal conditions; is the number of initial states; () is a constant, the CONTINGENT PLAN-EXISTENCE algorithm will find solutions for at least of the instances.

Proof. For a contingent planning instance with goal conditions, the number of satisfied goal conditions will be increased at most times. If each increase occurs with probability at least , increase (the most possible) will occur with probability at least .
Thus, Lemma 10 can be applied using instead of . Maximizing over the goal conditions leads to
Therefore, if the inequality is satisfied by the number of the actions, the algorithm will find solutions for at least of the instances.

Theorem 11 shows that when the number of actions is not lower than , the CONTINGENT PLAN-EXISTENCE algorithm can prove that nearly all the contingent planning instances have solutions.

5. Experimental Results

In this section, we take experiments on the contingent planning instances under the variable model in order to investigate the relationship between the densities (ratio of the number of actions to the number of propositions) and the effectiveness of the contingent planning instances. In the experiment, we generate a large collection of instances with three preconditions and two postconditions within an action, ( is a constant) initial states, one observation, and two goal conditions. In addition, the propositions are 6, 8, 10, 12, 14, 16, and 18, respectively. All experiments are run on a cluster of 2.4 GHz Intel Xeon machines with 2 GB memory running Linux CentOS 5.4. Figure 1 illustrates the relationship between the densities and the effectiveness of the contingent planning instances. From the results we can see that the effectiveness grows when the density increases and the numbers of propositions and goal conditions are constant. Furthermore, the experiments show that there is a transition from insoluble to soluble instances as the density grows and the transition points drop with the propositions growing.

6. Conclusions

In this paper, we present analyses for the phase transitions of the contingent planning problems. By analyzing the CONTINGENT PLAN-NONEXISTENCE algorithm and the CONTINGENT PLAN-EXISTENCE algorithm, quantitative results are obtained. If the number of actions is not greater than , the CONTINGENT PLAN-NONEXISTENCE algorithm can prove that almost all the contingent planning instances have no solution; if the number of actions is not lower than , the CONTINGENT PLAN-EXISTENCE algorithm can prove that almost all the contingent planning instances have solutions. The results of the experiments also show that there exist the phase transition phenomena.

Acknowledgments

This work was fully supported by the National Natural Science Foundation of China (Grants nos. 11226275 and 61070084), the Fundamental Research Funds for the Central Universities (Grant no. 11QNJJ006), the Ministry of Education (Grant no. 20120043120017), the Postdoctoral Science Foundation of China (2012M520658), and the opening fund of top key discipline of computer software and theory in Zzhejiang Provincial Colleges at Zhejiang Normal University (Grant no. ZSDZZZZXK37).