# On Restricted Disjunctive Temporal Problems: Faster Algorithms and Tractability Frontier

In 2005 Kumar studied the Restricted Disjunctive Temporal Problem (RDTP), a restricted but very expressive class of disjunctive temporal problems (DTPs). It was shown that that RDTPs are solvable in deterministic strongly-polynomial time by reducing them to the Connected Row-Convex (CRC) constraints problem; plus, Kumar devised a randomized algorithm whose expected running time is less than that of the deterministic one. Instead, the most general form of DTPs allows for multi-variable disjunctions of many interval constraints and it is NP-complete. This work offers a deeper comprehension on the tractability of RDTPs, leading to an elementary deterministic strongly-polynomial time algorithm for them, significantly improving the asymptotic running times of both the deterministic and randomized algorithms of Kumar. The result is obtained by reducing RDTPs to the Single-Source Shortest-Paths (SSSP) and the 2-SAT problem (jointly), instead of reducing to CRCs. In passing, we obtain a faster (quadratic-time) algorithm for RDTPs having only Type-1 and Type-2 constraints (and no Type-3 constraint). As a second main contribution, we study the tractability frontier of solving RDTPs by considering Hyper Temporal Networks (), a strict generalization of grounded on hypergraphs: on one side, we prove that solving temporal problems having either only multi-tail or only multi-head hyperarc constraints and Type-2 constraints, it lies in both NP and co-NP and it admits deterministic pseudo-polynomial time algorithms; on the other side, solving problems with either only multi-tail or only multi-head hyperarc constraints and Type-3 constraints, it turns strongly NP-complete.

## Authors

• 3 publications
• 11 publications
• ### Non-Interlaced SAT is in P

We investigate the NP-Complete problem SAT and the geometry of its insta...
03/27/2018 ∙ by Dr Serge Burckel, et al. ∙ 0

• ### On the Complexity Landscape of Connected f -Factor Problems

Let G be an undirected simple graph having n vertices and let f be a fun...
12/05/2018 ∙ by R. Ganian, et al. ∙ 0

• ### On Salum's Algorithm for X3SAT

This is a commentary on, and critique of, Latif Salum's paper titled "Tr...

• ### Solving Linear Constraints in Elementary Abelian p-Groups of Symmetries

Symmetries occur naturally in CSP or SAT problems and are not very diffi...
07/22/2011 ∙ by Thierry Boy de la Tour, et al. ∙ 0

• ### Hyper Temporal Networks

Simple Temporal Networks (STNs) provide a powerful and general tool for ...
03/13/2015 ∙ by Carlo Comin, et al. ∙ 0

• ### An Algorithm for Generating Strongly Chordal Graphs

Strongly chordal graphs are a subclass of chordal graphs. The interest i...
04/14/2018 ∙ by Md. Zamilur Rahman, et al. ∙ 0

• ### On efficiently solvable cases of Quantum k-SAT

The constraint satisfaction problems k-SAT and Quantum k-SAT (k-QSAT) ar...
12/27/2017 ∙ by Marco Aldi, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Expressive and efficient temporal reasoning is essential to a number of areas in Artificial Intelligence (AI)

[8, 14, 15]. Over the past few years, many constraint-based formalisms have been developed to represent and reason about time in automated planning and temporal scheduling [4, 12]. We begin by recalling the Disjunctive Temporal Problem (DTP) [13, 16, 17]. The general form of a DTP being, given a finite set of temporal variables (i.e., time-points), to schedule them on the real line in such a way as to satisfy a prescribed finite set of temporal constraints over . Every constraint is a disjunction of the form , where every is a simple temporal constraint of the form for some integers and reals .

Although DTPs are expressive enough to capture many tasks in automated planning and temporal scheduling, they are NP-complete [16]. The principal direct approach taken to solve DTPs has been to convert the original problem into one of selecting a disjunct from each constraint [16, 17], then to check whether the set of selected disjuncts forms a consistent Simple Temporal Problem (STP) [5]. This can be done in strongly polynomial time by computing single-source shortest paths (e.g., with the Bellman-Ford’s algorithm [2]). Under this prospect, of course the prohibitive complexity of solving DTPs comes from the fact that there are exponentially many disjunct combinations possible.

In [9, 10], T.K.S. Kumar studied the Restricted Disjunctive Temporal Problem (RDTP), a tractable subclass of DTPs strictly including the classical and well established STPs [5]. In RDTPs, each constraint can be either one of the following three types: () , for real (a simple temporal difference-constraint); () , for reals (a single-variable disjunction of many interval-constraints); () , for reals (a two-variable disjunction of two interval-constraints).

It was shown in [10] that RDTPs are solvable in deterministic strongly polynomial time by reducing them to the Connected Row-Convex (CRC) [6] constraint satisfaction problem, faster randomized algorithms were also proposed. CRC constraints generalize many other known tractable classes of constraints like 2-SAT, implicational, and binary integer-weighted linear constraints [6]. Particularly, Kumar’s deterministic algorithm for solving RDTPs works by reducing them into binary Constraint Satisfiability Problems (CSPs) over meta-variables representing or constraints, meanwhile showing that such binary constraints are indeed CRC constraints, finally exploiting the algorithmic tractability of CRC constraints.

An instantiation of a consistency checking algorithm (e.g., [6]) that further exploits the structure of CRC constraints leads to a time complexity of , where is the set of constraints (respectively), and is the maximum number of disjuncts possible per single constraint [10]. Randomization reduces the running time to , where is the degree of the CRC network (i.e., the maximum number of constraints any variable participates into) [10].

Notable applications of RDTPs include solving STPs with Taboo Regions, cfr. [11].

Contributions. This work offers a deeper comprehension on the tractability of RDTPs, leading to elementary deterministic strongly polynomial time algorithms, significantly improving the asymptotic running times of both the Kumar’s deterministic and randomized solutions. Our time complexity is , where is the total number of disjuncts counting over all -constraints. Since , this improves over all of the previous solutions. The result is obtained by reducing RDTPs to the Single-Source Shortest Paths (SSSP) and the 2-SAT problem (jointly), instead of reducing to CRCs. So the full expressive power of CRCs is not needed, binary linear and 2-SAT constraints are enough. In passing, we obtain a faster (quadratic time) deterministic algorithm for solving temporal problems having only -constraints and no -constraint.

As a second main contribution, we study the tractability frontier of RDTPs widened with another kind of restricted disjunctive constraints, i.e., Hyper Temporal Networks (HyTNs) [3], a strict generalization of STNs grounded on directed hypergraphs and introduced to overcome the limitation of considering only conjunctions of constraints but maintaining a practical efficiency in the consistency check of the instances. In a HyTN a single temporal multi-tail (or multi-head) hyperarc-constraint is defined as a set of two or more maximum delay (minimum anticipation, respectively) constraints which is satisfied when at least one of these delay constraints is so. We prove that solving temporal problems having only -constraints and either only multi-tail or only multi-head hyperarc-constraints lies in and admits deterministic pseudo-polynomial time algorithms; on the other hand, solving temporal problems having only -constraints and either only multi-tail or only multi-head hyperarc-constraints turns out strongly NP-complete. See Table 1 below for a summary.

Problem Complexity Improved Time Bound Cfr.
DTPs P Sect. 3
RDTPs P
 O(|T|⋅|Ct1|+|C%t2|⋅(|Ct1|+|T|⋅log|T|)+ +|T|⋅dCt2⋅|Ct3|+|Ct3|2)
Sect. 4
HyTPs Sect. 6
HyTPs NP-complete n.a. (exponential time) Sect. 5

Table 1 Summary of main results.

## 2 Background

This section offers the basic background notions that are assumed in the rest of the paper, let’s start with Simple Temporal Networks (STNs) and related problems (STPs), cfr. [4, 5].

###### Definition 1 (STNs, STPs [4, 5]).

A Simple Temporal Network (STN) is a pair , where is a set of real-valued variables called time-points, and is a set of linear real-weighted binary constraints over called simple (or ) temporal constraints, each having the form:

An STN is consistent if it admits a feasible schedule, i.e., some such that for all . So the Simple Temporal Problem (STP) is that of determining whether a given STN is consistent or not.

Any STN can be seen as a directed weighted graph with vertices and arc set . So, a path in is any finite sequence of vertices (some ) such that for every ; the total weight of is then . A cycle in is any set of arcs cyclically sequenced as where an head equals a tail, i.e., , iff ; it is called a negative cycle if , where stands for . A graph is called conservative when it contains no negative cycle. A schedule is any function . So the reduced weight of an arc with respect to a schedule is defined as . A schedule is feasible iff for every .

It is also worth noticing that, given two feasible schedules of any STN, the pointwise-minimum schedule, is also feasible. Indeed, among all of the possible feasible schedules of a given consistent STN, it is natural to consider the least feasible one; i.e., is the least feasible schedule of STN if is feasible for and, for any other non-negative feasible schedule of , it holds .

Remarkably, finding the least feasible schedule of an STN takes polynomial time [4].

###### Theorem 1 ([4]).

Let be an STN. The Bellman-Ford (BF) algorithm (cfr. [2]) produces in time: either the least feasible schedule , in case is consistent; or a certificate that is inconsistent in the form of a negative cycle. Moreover, if the weights of the arcs are all integers, then the scheduling values of are all integers too.

Concerning the BF algorithm itself, it’s worth considering an improved variant of it that we call the Bellman-Ford Value-Iteration (BF-VI). The basic idea of BF-VI is the same as the original BF algorithm in that each vertex is used as a candidate to relax its adjacent vertices. The improvement is that instead of trying all vertices blindly, BF-VI maintains a queue of candidate vertices and adds a vertex to only if that vertex is relaxed. A candidate vertex is extracted from according to a fixed policy (e.g., LIFO), and then the adjacent vertices of are possibly relaxed as usual and added to (if they are not already in there, no repetitions are allowed). This process repeats until no more vertex can be relaxed.

BF-VI serves us as a basic model, to be leveraged to design faster algorithms for RDTPs.

### 2.1 Restricted Disjunctive Temporal Problems

Let us proceed by formally defining RDTNs and RDTPs. Fig. 2 and Fig. 2 (above) illustrate an example of a -constraint and -constraint (respectively).

###### Definition 2 (RDTNs, RDTPs [9, 10]).

A Restricted Disjunctive Temporal Network (RDTN)  is a pair , where is a set of time-points and is a set of restricted disjunctive temporal constraints over , each being either one of the following three types:

1. : , where and ;

2. : , where and for every ;

3. : , where and for .

An RDTN is consistent if it admits a feasible schedule, i.e., some satisfying all of the disjunctive temporal constraints in . The Restricted Disjunctive Temporal Problem (RDTP) is that of determining whether a given RDTN is consistent or not.

Notice that -constraints do coincide with simple temporal constraints of STNs.

We assume w.l.o.g. that the disjuncts of any -constraint are arranged in ascending order of the end points of their corresponding intervals, i.e., , whenever ; these natural orderings on the interval domains of the time-points will be referred to as as their nominal ordering. For any , denotes the number of -constraints (i.e., the cardinality of , not the encoding length). Also, for any , denotes the number of disjuncts of , and . Finally, let us fix a total ordering on the time-points, i.e., , this induces an ordering on the pair of disjuncts in any -constraint; so, provided, , for some , then, and are called the first and the second disjunct of (respectively).

As mentioned in the introduction, Kumar showed in [10, 9] that RDTPs are solvable in deterministic strongly polynomial time by reducing them to CRCs [6].

### 2.2 Hyper Temporal Networks

In order to study the tractability frontier of RDTPs, we shall consider the HyTN model which is grounded on directed hypergraphs as defined next.

###### Definition 3 ([3]).

A directed hypergraph is a pair , where is the set of nodes, and is the set of hyperarcs. Each hyperarc is either multi-head or multi-tail:

• A multi-head hyperarc has a distinguished node , called the tail of , and a non-empty set containing the heads of ; to each head , it is associated a weight , which is a real number (unless otherwise specified). Fig. 3 depicts a possible representation of a multi-head hyperarc: the tail is connected to each head by a dashed arc labeled by the name of the hyperarc and the weight associated to the considered head.

• A multi-tail hyperarc has a distinguished node , called the head of , and a non-empty set containing the tails of ; to each tail , it is associated a weight , which is a real number (unless otherwise specified). Fig. 3 depicts a possible representation of a multi-tail hyperarc: the head is connected to each tail by a dotted arc labeled by the name of the hyperarc and weights.

The cardinality of a hyperarc is if is multi-head, and if is multi-tail; when , then is a standard arc. The order and size of a directed hypergraph are and  (respectively).

###### Definition 4 (General-HyTN[3]).

A general-HyTN is a directed hypergraph where each node represents a time-point, and each multi-head/multi-tail hyperarc stands for a set of temporal distance constraints between the tail/head and the heads/tails.

In general-HyTNs, an hyperarc is satisfied when at least one of its distance constraints is satisfied. Then, a HyTN is consistent when it is possible to assign a value to each time-point so that all of its hyperarcs are satisfied. More formally, in the HyTN model the consistency-checking problem is the following decision problem.

###### Definition 5 (General-HyTP[3]).

Given a general-HyTN , the General Hyper Temporal Problem (General-HyTP) is that of deciding whether or not there exists a schedule such that, for every hyperarc , the following hold:

• if is a standard arc, then: ;

• if is a multi-head hyperarc, then: ;

• if is a multi-tail hyperarc, then: .

Any such schedule is called feasible. A HyTN that admits at least one feasible schedule is called consistent.

Comparing the consistency of HyTNs with the consistency of STNs, the most important aspect of novelty is that, while in a distance graph of STNs each arc represents a distance constraint and all such constraints have to be satisfied by any feasible schedule, in a HyTN each hyperarc represents a disjunction of one or more distance constraints and a feasible schedule has to satisfy at least one of such distance constraints for each hyperarc.

Let us survey some interesting properties about the consistency-checking problem above. The first one is that any integer-weighted HyTN admits an integer-valued feasible schedule when it is consistent, as stated in the following proposition.

###### Proposition 1 ([3]).

Let be an integer-weighted***Integer-weighted means that for every and for which is defined. and consistent general-. Then admits an integer feasible schedule , where .

The following theorem states that General-HyTP is NP-complete, in a strong sense.

###### Theorem 2 ([3]).

General-HyTP is an NP-complete problem even if the input instances are restricted to satisfy and for every .

As observed in [3], Theorem 2 motivates the study of consistency problems on HyTNs having either only multi-head or only multi-tail hyperarcs. In the former case, the consistency-checking problem is called head-HyTP, while in the latter it is Tail-HyTP; as stated in Theorem 3, the complexity of checking these two problems turns out to be lower than that for DTPs, i.e., both , instead of being NP-complete.

So it’s worth considering the following specialized notion of consistency for HyTNs.

Given a multi-head HyTN , the head-HyTP problem is that of deciding whether or not there exists a schedule such that:

 s(tA)≥minv∈HA{s(v)−wA(v)},∀A∈A.

The tightest currently known worst-case time complexity upper-bound for solving (integer-weighted) head-HyTPs was established in [3] and it is expressed in the following theorem.

###### Theorem 3 ([3]).

The following proposition holds on (integer-weighted, multi-head) HyTNs. There exists an pseudo-polynomial time algorithm for checking head-HyTP; given any HyTN , if is consistent the same algorithm also returns an integer-valued feasible schedule of ; otherwise, it returns a negative certificate in the form of a negative hypercycle (cfr. Appendix A for more details on that).

Above, is the maximum absolute value among the weights.

Concluding this section we recall that the two problems head-HyTP and Tail-HyTP are actually inter-reducible, i.e., one can check any one of the two models in -time whenever there’s an -time procedure for checking the consistency of the other one.

###### Theorem 4 ([3]).

head-HyTP and Tail-HyTP are inter-reducible by means of -space, linear-time, local-replacement reductions.

Thus, Theorem 3 extends to multi-tail HyTNs (i.e., they’re checkable in pseudo-poly time).

## 3 Faster Deterministic Algorithm for t2DTPs

This section offers a deterministic quadratic time algorithm for solving temporal problems having only -constraints, as defined below.

The same algorithm will be leveraged to solve RDTPs fastly, later on in Section 4.

###### Definition 7.

Any RDTN having is called DTN.

So, DTNs are denoted simply as . The corresponding temporal problem, i.e., DTP, is that of determining whether a given DTN is consistent or not.

One possible solution to DTPs is Kumar’s reduction from RDTPs to CRCs [10]. Our solution, named , employs kind of a value-iteration approach in which all are initially set to zero and then updated monotonically upwards by necessary arc relaxations – this is somehow reminiscent of the BF-VI algorithm for STPs mentioned in Section 2. Indeed, given a DTN , we firstly solve the STP (e.g., with BF-VI). If is consistent, the returned least feasible schedule provides an initial candidate, the next step in mind being that of satisfying all the -constraints. For this, recall that the disjuncts of any are arranged according to their nominal ordering, so that we can try to satisfy any given by iteratively picking the next (i.e., in ascending order) unsatisfied disjunct of and by enforcing its lower-bound constraint in an auxiliary STN as if it were a -constraint. While there’s an unsatisfied -constraint , the current candidate schedule is thus increased by the least necessary amount satisfying both and the whole . It turns out that this can be done efficiently by performing calls to the Dijkstra shortest paths algorithm [7]. In order to show this, let us point out two key facts (i.e., Lemma 1 and 2).

###### Lemma 1.

Let be any STN, and let be any pair of schedules of .

Let be the STN reweighted according to the reduced-costs weight transformation  (i.e., each weight in is simply replaced by ), let be the same w.r.t. . Let be the length of the shortest path in from any to , and let be the same w.r.t. .

Then for every , either and are both , or the following holds:

 δφ′X(T)−δφX(T)=(φ′(T)−φ(T))−(φ′(X)−φ(X)).
###### Proof.

Let (arbitrarily), w.l.o.g. is reachable from in (otherwise, and are both ). Consider any path from to in , i.e., for some :

 pT,X≜(T=T0,T1,T2,…,Tk=X), having total % weight wφpT,X≜k−1∑i=0wφTi,Ti+1 in Nφ.

Then, the following holds by telescoping:

 wφpT,X …+(wTk−1,Tk−φ(Tk)+φ(Tk−1)) =φ(T0)−φ(Tk)+k−1∑i=0wTi,Ti+1=φ(T)−φ(X)+wpT,X. (1)

Thus, provided is the shortest path distance from to in the original network , we have:

 δφX(T) =min{wφpT,X∣pT,X is a path % from T to X in N} (by def. of δφX) =min{φ(T)−φ(X)+wpT,X∣pT,X % is any path from T to X in N} (by (1)) =φ(T)−φ(X)+min{wpT,X∣pT,X % is any path from T to X in N} (φ is constant here) =φ(T)−φ(X)+δX(T). (by def. of δX)

For the same reason, . Therefore,

 δφ′X(T)−δφX(T) =(φ′(T)−φ(T))−(φ′(X)−φ(X)).

This concludes the proof. ∎

###### Lemma 2.

Let be any STN, and let be the least feasible schedule of . Fix some and some real value . Let be the auxiliary STN obtained by introducing a corresponding lower-bound -constraint over , i.e.,

 T′≜T∪{z},C′t1≜Ct1∪{(z−T≤0)∣T∈T}∪{(z−X≤−lX)}.

Let be the STN reweighted according to the reduced-costs weight transformation , and let be the length of the shortest path in from (any) to .

Then, for every , the least feasible schedule of is given by:

 ^φ′(T)=^φ(T)+max(0,lX−^φ(X)−δ^φX(T)).
###### Proof.

Let w.l.o.g. . In order to become feasible for we claim, for every , that the least feasible schedule must be increased by at least time units (because of the lower-bound constraint ). Indeed, for any that reaches in , the -constraint (which is induced by telescoping all of the -constraints along any shortest path from to ) must be satisfied. On the other hand, by Lemma 1 (applied to and to the anywhere-zeroThe anywhere-zero schedule is that defined as, for every . schedule), it holds . This can be seen as follows: if is kept fixed, then can be increased by at most time units without breaking the induced constraint . Here, must be increased by at least time units in order to satisfy , so must be increased by at least the amount said above.

Next, we claim this increase also preserves feasability, i.e., it is the least feasible increase. For ease of notation, let and .

In order to prove that satifies all the constraints in , pick any . By hypothesis, it holds:

 ^φ(B)−^φ(A)≤wA,B. (1)

For the sake of the argument, let us define: .

So, the following holds:

 f(B)−f(A)=^φ(B)−^φ(A)+ΔA,B. (2)

Then, either one of the following two cases holds:

• If , then , so . Therefore,

 f(B)−f(A) ≤^φ(B)−^φ(A) (by (2)) ≤wA,B. (by (1))
• If , it is easy to check that .

By definition of and since , then . Therefore,

 f(B)−f(A) ≤^φ(B)−^φ(A)+δ^φX(A)−δ^φX(B) ≤^φ(B)−^φ(A)+w^φA,B=wA,B.

So, in either case, .

Finally, clearly , so is also satisfied.

This proves is a feasible schedule of . All in, it is the least feasible, i.e., . ∎

With this two facts in mind, the description of can now proceed more smoothly.

Recall that, firstly, the STN is checked. If is already inconsistent, so it is ; otherwise, is the least feasible schedule of . So, for every constraint in . Now, for each target node , the Dijkstra algorithm on input computes . The whole distance matrix is computed here, and kept stored in memory. Multiple-sources single-target shortest paths are needed, actually, but these can be easily computed with the traditional Dijkstra’s algorithm, e.g., just reverse the direction of all arcs in the input network and treat the single-target node as if it were a single-source. What follows aims, if there’s still an unsatisfied -constraint , at increasing the candidate schedule by the least necessary amount satisfying both and the whole . So, let us initialize . Then the following iterates.

While some and s.t. doesn’t satisfy :

if , then is inconsistent (see Theorem 5); otherwise, let be the smallest such that . By Lemma 1 and given , then is given by:

 δfX(T)←δ^φ0X(T)+(f(T)−^φ0(T))−(f(X)−^φ0(X)),∀T∈T.

So, by Lemma 2, the following updating rule:

 f(T)←f(T)+max(0,li∗−f(X)−δfX(T)),∀T∈T.

yelds the least feasible schedule for the next auxiliary STN obtained by adding the new lower-bound -constraint . At each iteration of the while-loop is enriched with an additional lower-bound -constraint as above. So, has time-points ( included) and at most -constraints (one -constraint per is enough, as for each only its greatest lower-bound counts). If the while-loop completes without ever finding to be inconsistent (because, eventually, for some at some point), then the last updating of yelds the least feasible schedule of (as shown below in Theorem 5). This concludes the description of .

Notice that, during the whole computation, the scheduling values can only increase monotonically upwards – like in a value-iteration process.

###### Theorem 5.

is correct, i.e., on any input DTN , it returns a feasible schedule , if is consistent; otherwise, it recognizes as inconsistent.

###### Proof.

Let be all the iterations of the while-loop of , where is assumed to be the last iteration where the updating is applied.

For every iteration , the auxiliary STN is formally defined as:

 N′(ι)t1≜(T∪{z},C′(ι)t1), where z is the % \emph{zero time-point}, and ...
 C′(ι)t1≜Ct1∪{(z−T≤0)∣T∈T}∪{(z−X(γ)≤−l(γ)i∗)∣1≤γ≤ι},

where, for all , is the (unique) appearing in some -constraint that is considered at the while-loop’s -th iteration, and is its corresponding lower-bound.

Also, let be the candidate schedule as updated by during the -th iteration.

By applying Lemma 1 and 2 repeatedly, for each iteration , it holds that is the least feasible schedule of . This is the key invariant at the heart of .

Concerning actual correctness, firstly, assume that recognizes as inconsistent.

If was already inconsistent (cfr. Theorem 1), so is too. Otherwise, the inconsistency of really holds because of these two facts jointly: (i) the key invariant mentioned above; and, (ii) at the end of the while-loop, it must be