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 constraintbased 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., timepoints), 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 NPcomplete [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 singlesource shortest paths (e.g., with the BellmanFord’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 differenceconstraint); () , for reals (a singlevariable disjunction of many intervalconstraints); () , for reals (a twovariable disjunction of two intervalconstraints).
It was shown in [10] that RDTPs are solvable in deterministic strongly polynomial time by reducing them to the Connected RowConvex (CRC) [6] constraint satisfaction problem, faster randomized algorithms were also proposed. CRC constraints generalize many other known tractable classes of constraints like 2SAT, implicational, and binary integerweighted linear constraints [6]. Particularly, Kumar’s deterministic algorithm for solving RDTPs works by reducing them into binary Constraint Satisfiability Problems (CSPs) over metavariables 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 SingleSource Shortest Paths (SSSP) and the 2SAT problem (jointly), instead of reducing to CRCs. So the full expressive power of CRCs is not needed, binary linear and 2SAT 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 multitail (or multihead) hyperarcconstraint 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 multitail or only multihead hyperarcconstraints lies in and admits deterministic pseudopolynomial time algorithms; on the other hand, solving temporal problems having only constraints and either only multitail or only multihead hyperarcconstraints turns out strongly NPcomplete. See Table 1 below for a summary.
Problem  Complexity  Improved Time Bound  Cfr.  
DTPs  P  Sect. 3  
RDTPs  P 

Sect. 4  
HyTPs  Sect. 6  
HyTPs  NPcomplete  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 realvalued variables called timepoints, and is a set of linear realweighted 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 pointwiseminimum 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 nonnegative 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 BellmanFord (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 BellmanFord ValueIteration (BFVI). The basic idea of BFVI 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, BFVI 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.
BFVI 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 timepoints and is a set of restricted disjunctive temporal constraints over , each being either one of the following three types:

: , where and ;

: , where and for every ;

: , 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 timepoints 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 timepoints, 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).
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 multihead or multitail:

A multihead hyperarc has a distinguished node , called the tail of , and a nonempty 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 multihead 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 multitail hyperarc has a distinguished node , called the head of , and a nonempty 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 multitail 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 multihead, and if is multitail; when , then is a standard arc. The order and size of a directed hypergraph are and (respectively).
Definition 4 (GeneralHyTN [3]).
A generalHyTN is a directed hypergraph where each node represents a timepoint, and each multihead/multitail hyperarc stands for a set of temporal distance constraints between the tail/head and the heads/tails.
In generalHyTNs, 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 timepoint so that all of its hyperarcs are satisfied. More formally, in the HyTN model the consistencychecking problem is the following decision problem.
Definition 5 (GeneralHyTP [3]).
Given a generalHyTN , the General Hyper Temporal Problem (GeneralHyTP) 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 multihead hyperarc, then: ;

if is a multitail 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 consistencychecking problem above. The first one is that any integerweighted HyTN admits an integervalued feasible schedule when it is consistent, as stated in the following proposition.
Proposition 1 ([3]).
Let be an integerweighted^{*}^{*}*Integerweighted means that for every and for which is defined. and consistent general. Then admits an integer feasible schedule , where .
The following theorem states that GeneralHyTP is NPcomplete, in a strong sense.
Theorem 2 ([3]).
GeneralHyTP is an NPcomplete 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 multihead or only multitail hyperarcs. In the former case, the consistencychecking problem is called headHyTP, while in the latter it is TailHyTP; 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 NPcomplete.
So it’s worth considering the following specialized notion of consistency for HyTNs.
Definition 6 (headHyTP).
Given a multihead HyTN , the headHyTP problem is that of deciding whether or not there exists a schedule such that:
The tightest currently known worstcase time complexity upperbound for solving (integerweighted) headHyTPs was established in [3] and it is expressed in the following theorem.
Theorem 3 ([3]).
The following proposition holds on (integerweighted, multihead) HyTNs. There exists an pseudopolynomial time algorithm for checking headHyTP; given any HyTN , if is consistent the same algorithm also returns an integervalued 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 headHyTP and TailHyTP are actually interreducible, 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]).
headHyTP and TailHyTP are interreducible by means of space, lineartime, localreplacement reductions.
Thus, Theorem 3 extends to multitail HyTNs (i.e., they’re checkable in pseudopoly time).
3 Faster Deterministic Algorithm for DTPs
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 valueiteration approach in which all are initially set to zero and then updated monotonically upwards by necessary arc relaxations – this is somehow reminiscent of the BFVI algorithm for STPs mentioned in Section 2. Indeed, given a DTN , we firstly solve the STP (e.g., with BFVI). 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 lowerbound 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 reducedcosts 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:
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 :
Then, the following holds by telescoping:
(1) 
Thus, provided is the shortest path distance from to in the original network , we have:
(by def. of )  
(by (1))  
( is constant here)  
(by def. of ) 
For the same reason, . Therefore,
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 lowerbound constraint over , i.e.,
Let be the STN reweighted according to the reducedcosts 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:
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 lowerbound 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 anywherezero^{†}^{†}†The anywherezero 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:
(1) 
For the sake of the argument, let us define: .
So, the following holds:
(2) 
Then, either one of the following two cases holds:

If , then , so . Therefore,
(by (2)) (by (1)) 
If , it is easy to check that .
By definition of and since , then . Therefore,
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. Multiplesources singletarget 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 singletarget node as if it were a singlesource. 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:
So, by Lemma 2, the following updating rule:
yelds the least feasible schedule for the next auxiliary STN obtained by adding the new lowerbound constraint . At each iteration of the whileloop is enriched with an additional lowerbound constraint as above. So, has timepoints ( included) and at most constraints (one constraint per is enough, as for each only its greatest lowerbound counts). If the whileloop 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 valueiteration 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 whileloop of , where is assumed to be the last iteration where the updating is applied.
For every iteration , the auxiliary STN is formally defined as:
where, for all , is the (unique) appearing in some constraint that is considered at the whileloop’s th iteration, and is its corresponding lowerbound.
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 whileloop, it must be
Comments
There are no comments yet.