\documentstyle[rawfonts]{article}
\setlength{\topmargin}{5pt}
\addtolength{\textheight}{30mm}
\addtolength{\textwidth}{20mm}
\oddsidemargin 10mm
\def\normalspacing{ \def\baselinestretch{1.0} \small \normalsize }
\def\smallspacing{ \def\baselinestretch{1.0} \small \normalsize }
\normalspacing
\renewcommand{\topfraction}{0.9}

\input{prepictex}
\input{pictex}
\input{postpictex}
\let \con=\breve

\def\blackslug{\hbox{\hskip 1pt \vrule width 4pt height 8pt depth 1.5pt
\hskip 1pt}}
\def\QED{\quad\blackslug\lower 8.5pt\null}
\def\qed{{\hfill\null\nobreak\hfill\hbox to
50pt{\quad\blackslug\lower 8.5pt\null\hfil}}}
\def\bi{\begin{itemize}}
\def\ei{\end{itemize}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}

\def\INTEGER{\mbox{\bf integer}}
\def\BOOLEAN{\mbox{\bf boolean}}
\def\PROCEDURE{\mbox{\bf procedure\ }}
\def\FUNCTION{\mbox{\bf function\ }}
\def\BEGIN{\mbox{\bf begin\ }}
\def\END{\mbox{\bf end}}
\def\RETURN{\mbox{\bf return\ }}
\def\IF{\mbox{\bf if\ }}
\def\THEN{\mbox{\bf then\ }}
\def\ELSE{\mbox{\bf else\ }}
\def\NOT{\mbox{\bf not\ }}
\def\OR{\mbox{\bf or\ }}
\def\AND{\mbox{\bf and\ }}
\def\FOR{\mbox{\bf for\ }}
\def\WHILE{\mbox{\bf while\ }}
\def\WRITELN{\mbox{\bf writeln\ }}
\def\REPEAT{\mbox{\bf repeat\ }}
\def\UNTIL{\mbox{\bf until\ }}
\def\LOOP{\mbox{\bf loop\ }}
\def\EXIT{\mbox{\bf exit\ }}
\def\TO{\mbox{\bf to\ }}
\def\DO{\mbox{\bf do\ }}
\def\IS{\mbox{$~\leftarrow~$}}
\def\EQ{\mbox{$~\equiv~$}}

\title{Fast Algebraic Methods for Interval Constraint 
Problems\footnote{This paper is an extended version of \cite{LadRei93},
including results to date.}}

\author{
\bf Peter B.~Ladkin \\
\small Universit\"at Bielefeld\\
\small Technische Fakult\"at\\
\small Postfach 10 01 31 \\
\small D-33501 Bielefeld, Germany. \\
\small {\tt ladkin@techfak.uni-bielefeld.de}
\and 
\bf Alexander Reinefeld\\
\small Paderborn Center for Parallel Computing\\
\small F\"urstenallee 7\\
\small D-33095 Paderborn, Germany\\
\small {\tt ar@uni-paderborn.de}
}

\date{21 August 1996}

\begin{document}
\maketitle
\begin{center}
An invited paper to appear in the {\it Annals of Mathematics and
Artificial Intelligence}
\end{center}

\begin{abstract}
We describe an effective generic method for 
solving constraint problems, based on Tarski's relation algebra,
using path-consistency as a pruning technique.
We investigate the performance of this method on interval
constraint problems.
Time performance is affected strongly by the
path-consistency calculations, which involve the calculation of
compositions of relations. 
We investigate various methods of tuning composition
calculations, and also path-consistency computations.
Space performance is affected by the branching
factor during search. Reducing this branching factor 
depends on the existence of `nice' subclasses of the constraint domain.
Finally, we survey the statistics of consistency properties of interval
constraint problems.
Problems of up to $500$ variables may be solved in expected
cubic time. Evidence is presented that the `phase transition'
occurs in the range $6 \leq n.c \leq 15$, 
where $n$ is the number of variables, and $c$ is the ratio
of non-trivial constraints to possible constraints.

\end{abstract}

\section{Introduction}
\label{sec:intro}

Constraint satisfaction problems, or CSPs~\cite{Mac87}
are a form of logic programming (see Section \ref{sec:theory}), and
are usually solved by various tuned search methods through tuples of
values (e.g.~\cite{Gues89}).
Interval constraints form a particular class of constraint problems 
that {\it prima facie} may not be solved using these methods, since the 
domains of the relations are infinite.
Interval constraint problems
are found in planning and scheduling in AI, and
solving such problems is essential for the mixed 
qualitative-quantitative problems studied in~\cite{KauLad91}.
Allen originally showed how to use search-pruning techniques 
based on path-consistency, 
performed as symbolic computations with the constraint
relations themselves rather than on tuples of values~\cite{All83}, and 
later research has built on this insight (e.g.~\cite{Lad90} contains
a survey of work to 1989, and see~\cite{vBe92} for more recent work).

\medskip
Ladkin and Maddux showed that the relation algebra of Tarski
is an appropriate mathematical context in which to represent and solve
binary constraint problems~\cite{LadMad88,LadMad94}.
An {\it algebra of relations} is a set of binary relations closed
under the Boolean operations (i.e. forming a Boolean algebra),
with the additional operations of {\it composition} and {\it converse},
and containing an {\it identity} relation (an algebraic identity element
for the composition operation). 
All these operations  are used in
constraint satisfaction techniques for binary constraints.
Sections~\ref{sec:theory} and~\ref{sec:pc} are an introduction
to this symbolic approach to constraint satisfaction problems.
Every finite algebra of relations contains a collection
of {\it minimal non-empty} relations, called {\it atoms} or
{\it atomic relations}, such that
every relation in the algebra may be expressed as a sum of atoms.

\medskip
We present a 
general algorithm architecture in which
constraint problems over various domains
may be solved symbolically
(Figure~\ref{fig:architecture}).
Our design relies on highly-pruned search, 
and is suitable for NP-hard constraint problems in which 
search is a component of a solution algorithm.
Path-consistency preprocessing is used, followed by a search
which involves path-consistency pruning at each choice point.
Our design may be used when there is a class of 
constraint relations $C$
such that
\begin{description}
\item[(a)] the composition table for members of $C$ may
be stored and accessed efficiently; 
\item[(b)] there is an efficient\footnote{By
`efficient' here we mean low polynomial time, e.g. quadratic time.}
method for solving problems whose constraints are all in $C$;
\item[(c)] all constraint relations in the problem
domain may be represented as unions of members of $C$.
\end{description}
The last condition (c) entails that the atomic relations are members of
$C$, and so if conditions (a) and (b) hold for the atomic relations,
they form the minimal class $C$ for which (a) - (c) hold.
Our algorithm takes as input a constraint problem in the domain,
and returns a more restricted
problem in which all constraints are relations in $C$
that are potentially tighter than the originals.
One may then apply the $C$-constraint-solver (condition (b)) to complete
the solution.
Although $C =$ {\it atomic relations} will work if any class
$C$ does, it is preferable to choose class $C$ as large as possible
satisfying (a) - (c),
to reduce the branching factor in search and to reduce the 
time taken in calculations of compositions (see below).



\medskip
Interval constraint problems fit this paradigm,
as do various spatial reasoning methods (see %\ref{par:RelatedWork}
{\bf Recent Related Work} below).
Solving interval constraint problems is NP-complete \cite{ViKaVB89,Mad94},
so some search must be expected in a solution algorithm
(unless P=NP).
There are $13$ atoms 
(atomic relations) in the Interval Algebra, giving a composition
table of $169$ entries ($144$ entries are actually used since one of the 
atoms is an identity for composition);
and problems with 
atomic constraints may be solved deterministically in quadratic time.
There is also a larger class $C$ with $187$ members, namely
the {\it pointisable relations}, fulfilling conditions (a)--(c)
(see Section~\ref{sec:theory} for a definition of {\it pointisable}).
Hence we can compare performance of the algorithm design with
$C =$ {\it atoms} with that of $C =$ {\it pointisables}.
The pointisable relations were introduced independently in
\cite{LadMad88} and in~\cite{vBeCoh89}. 
A quadratic time algorithm
for solving interval problems with either atomic constraints or
pointisable constraints may be derived from~\cite{vBe90}.
Nebel and B\"urckert discovered the maximal subclass fulfilling
conditions (a)--(c),
called the ORD-Horn relations~\cite{NebBur95:ORD-Horn}. 
There are 868 ORD-Horn relations,
and ORD-Horn constraint problems may be solved in asymptotic cubic time.

\medskip
Our generic algorithm design works with a finite
algebra of constraint relations.
There are important infinite classes of constraints,
for example numerical constraints such as 
$a \leq x-y \leq b$ (in which $a,b$ are real numbers) of~\cite{DeMePe91}.
This class does not satisfy condition (a) above, but nevertheless
there is an efficient way to calculate the composition of two
constraints, and in fact solutions may be obtained
in asymptotic cubic time.

\medskip In previous experiments on interval problems, we found that
path-consistency is particularly effective as a preprocessing method,
especially on large problems~\cite{ReiLad92}, and that when used also for
incrementally pruning the search, reduces the search almost to a linear
selection in most cases~\cite{LadRei92}.  Our results were reported for 
{\it completion coefficient} approximately equal to $1$, and $C =$ {\it atoms}.
The {\it completion coefficient} is the ratio of actual non-trivial
constraints in a problem to the number of possible constraints.
For random problems,
algorithm  versions return atomic reductions
extremely fast. 1000 problems may be solved in 3 seconds or so
on a notebook 486-based computer running Linux and {\it gcc}.
The fast solution time seems to be due to (a) the pruning power
of path-consistency; (b) the now generally-recognised
`phase transition' feature of 
NP-complete problems~\cite{Sel95:IJCAI-invited}:
in this case, with extremely high probability,
randomly generated interval networks with $n.c \geq 14$ 
are inconsistent, which is rapidly detected by 
a path-consistency computation, whereas small networks are
consistent with dense solution nodes, entailing that there is
little backtracking on either small or large problems.

\medskip
We show here (as in the `conference version' of this paper~\cite{LadRei93}) 
that the conclusions of~\cite{LadRei92} are also valid for
varying values of the completion coefficient $c \geq 0.5$,
namely that problems with non-trivial search lie generally in the
range $6 \leq n.c \leq 15$ for this range of $c$.
To obtain the conclusions for $c = 1$, we had run large-scale
experiments on over $200,000$ networks of sizes $3 \leq n \leq 20$.
Constraint problems were generated using a 
distribution in which, for every individual constraint in a problem,
each possible relation had equal probability of being that constraint.
We performed similar experiments for other values of $c$.
These results are summarised in Figure \ref{plot:incomplete} with
the curve $c = 1$. 
We also performed experiments for
$C =$ {\it pointisable relations}.
This reduced the branching factor in search, and therefore enabled us
to study behavior on large problems (see below).

\medskip
By comparing times taken on smaller problems with $C =$ {\it atoms}
with that taken on the same problems with $C =$ {\it pointisables},
we also found that a significant amount of computation time was involved in
calculating the composition of constraint relations. There are
$2^{13}$ possible interval constraint relations, 
so caching the entire composition table ($64M$ entries)
may not always be convenient.
Also, our generic algorithm design should work with algebras
with more than 13 atomic relations and therefore a much larger
composition table.
We thus compare various different methods of calculating the
compositions.
We observed that time performance of the
algorithm design is strongly affected by the method of calculating
compositions.
In particular, the `optimal method', caching the entire table,
is so fast as to be `off-scale'--we cannot effectively plot the
relative-time results on the same graph as we plot times for
the other methods. We conclude that, whenever possible,
when extremely rapid solution is required,
the entire composition table should be cached.
The space-time trade-off is heavily in favor of time.

\medskip
The computation of compositions takes place within 
path-consistency computations, but is not the only
time bottleneck in these computations.
Counting compositions as taking unit time,
path-consistency is known to be cubic time~\cite{Mac77},
and there is a class of examples
on which iterative local algorithms must take
quadratic time even on parallel machines~\cite{LadMad88,LadMad94}.
However, there is some experimental evidence that 
iterative local algorithms generally take 
linear time in parallel~\cite{SusHen91}.
We compute path-consistency  using
the relational-matrix composition algorithm of~\cite{LadMad88},
explained in Section~\ref{sec:pc}.
The speed of path-consistency computations is essential to the
performance of the algorithm design, and 
the raw Ladkin-Maddux algorithm may be improved by tuning.
For the larger consistent problems we generated,
we found that path-consistency computations dominate
solution time.
We conclude that improving path-consistency computations
is essential for good time performance of the constraint-solution
algorithm design.

\paragraph{Large Consistent Problems}
We have also looked at solving consistent problems with large
numbers (up to 500) of variables~\cite{ReiLad92}.
The techniques we found also `scale down' to the smaller 
problems, so we discuss the techniques in this paper in the context of
the smaller problems, without differentiating them.
We summarise briefly here what we found by working on the larger problems.
To solve large consistent problems,
we used $C$ = {\it pointisables}.
Every constraint relation is a sum of very few pointisable
relations, the average being  $\sim 3$.
Consequently, choosing pointisable subrelations during search
instead of atomic subrelations
reduces the search branching factor from an average
of between $6$ and $7$ to an average of $\sim 3$.
Space is the more significant limitation on solution algorithm
performance  rather
than time, and it was possible to solve problems of $500$ variables 
and $250,000$ non-trivial constraints using
pointisable search, whereas problems of $200$ variables caused
significant memory problems with search using atomic subrelations.
The maximal problem size is mainly restricted by the available
memory space to hold the (reduced) network matrices in the
depth-first search tree.
We conclude that the branching factor during search
is an important space performance factor which 
may be influenced by judicious choice of the class $C$.

\medskip
These large problems were generated using the method of
\cite{ReiLad92} (also noted in~\cite{LadRei92}), namely generating
a configuration of intervals with the endpoints of each interval
picked randomly
from a finite collection of possible endpoints.
This yields a solvable interval constraint problem with atomic
constraints, and to each constraint noise was then added.
At these larger sizes, using this problem generation method,
it turns out that a path-consistency computation returns a 
solution by itself in one pass, and the solution time is 
expected $O(n^3)$.
For networks of between 200 and 500 variables, the solution is found
by the initial path-consistency computation. 
The ratio (average solution speed for k-variable networks):
(average solution speed for m-variable networks) for $100 \leq m < k \leq 500$
is thus approximately $k^3:m^3$.
(The fact that solutions are often found on the first path-consistency
pass for problems with over $200$ variables
may lead one to question this particular method for generating
large consistent problems,
but there is yet no more effective method available.)

\medskip
In practice (e.g. N\"okel's technical diagnosis system~\cite{Noek91}), 
large application problems are unlikely to exhibit the characteristics 
of random networks, and one may expect that
domain specific knowledge can be exploited
to aid in the solution process. 
However, domain-specific knowledge is unlikely to reduce the
roughly cubic time needed to solve large problems, unless it
can considerably reduce the time spent in path-consistency
calculations.

\paragraph{Summary}
We knew already~\cite{LadRei92} that
recurring path-consistency computations are an effective pruning method,
that practically eliminates backtracking except 
in the `phase transition'~\cite{Sel95:IJCAI-invited}
of interval constraint problems.
We also knew that the phase transition for $c = 1$ lay between
$6 \leq n \leq 15$, and that a majority of time in the algorithm
was spent in path-consistency computations, in particular in 
composition calculations.
In this paper, we show that 
\begin{itemize}
\item the phase transition lies between $6 \leq c \cdot n \leq 15$;
\item it is important to use larger classes $C$ fulfilling the
conditions (a)--(c) above, to reduce branching factor during search,
and thus to solve problems with many more variables;
\item expected behavior is cubic time on large problems;
\item path-consistency calculations retain the greatest
potential for speed-up;
\item when composition is a table look-up, the algorithm is
extremely fast;
\item other methods of calculating composition still greatly
improve over the `naive method' of Allen;
\end{itemize}
The first four points were included in~\cite{LadRei93}, the latter
two results are new to this paper.

\paragraph{Recent Related Work.}
\label{par:RelatedWork}
Nebel~\cite{Neb96:HardProbs} has evaluated the algorithm
in this paper on a class of hard interval
constraint problems within a different distribution of problems
from the one which we consider.
He looks at problem instances in the classes
$A(n,d,s)$ in which $n$ is the number of nodes (variables), 
$d$ is the average degree of a node, and
$s$ is the average size of a constraint ({\it size} is the
number of atoms that sum to form the constraint), the
constraints selected from a uniform
distribution.
For fixed $s$, he identifies the range of values
of $d$ in which the phase transition occurs, and shows empirically
that this range of values is roughly independent of $n$. 
(Our work here identifies a 
phase transition function which has $n$ as an argument, 
for a different problem instance distribution.)
Additionally, he considers the class $H(n,d)$ of
problem instances with $n$ and $d$ as before, but 
in which a constraint on
a pair of nodes is selected uniformly from a particular set of 3006 
`probably very hard' constraints (based on theory 
from~\cite{NebBur95:ORD-Horn}). 
He also finds that using $C$ = {\it the ORD-Horn relations} yields
some improvement in performance for some problems in the phase transition 
region over using {\it $C$ = the pointisable relations}, although the average 
performance remains
roughly the same for both choices of $C$.
The table of ORD-Horn compositions
is 20 times larger than that for pointisables, and contains
roughly 750,000 entries.

The techniques we describe in this paper are not limited to
interval constraints - they work
for any domain which is describable as a finite relation algebra.
In principle, this includes all finite domains, although for
an arbitrary finite domain the combinatorics of expressing it 
as a relation algebra might negate any advantage obtained by
using our methods (a major difference
is that in standard pair-search
methods~\cite{Gues89} the relational operators are evaluated 
pointwise on the element 
pairs in the constraints as the algorithm progresses, 
whereas to use our algorithm the value returned by the operators on entire 
constraints must be known when required at a given point in the algorithm).
Perhaps this point could be expressed by saying that
we would expect our method to work efficiently for any domain
which is {\it efficiently} describable as a finite relation algebra.

Other problem domains with efficient descriptions as relation
algebras occur in spatial reasoning. 
The work of Randell, Cohn and Cui bases spatial reasoning on 
a class of ``{\it jointly exhaustive and pairwise disjoint sets 
of binary relations for pairs of spatial regions}''~\cite{CoRaCu95:Taxonomies}.
Such a class forms the atomic relations of a Boolean algebra of
binary relations, and a relation algebra may be defined therefrom
by calculating the composition of each pair of atoms (and also
the converse of each atom, but this is usually straightforward
if not trivial)~\cite{LadMad94}.
Calculation of the composition 
is not always easy, for example for this so-called
``RCC'' theory of spatial relations~\cite{RaCuCo92:KR92}.
The authors note that ``{\it the task of constructing
[composition] tables poses an interesting problem for automated
theorem provers in its own right}''~\cite{RaCoCu92:CADE11}.
Bennett has improved the calculation for the RCC theory by
using techniques based on propositional 
logics~\cite{Ben94:PropSpatReas}.
Our algorithm architecture would function to solve constraint
problems in the RCC theory of spatial relations, with $C$ = the atomic
(RCC) relations. The compositions of relations 
in $C$ would be calculated for use by the algorithm. 
However, fulfilling condition (b) for the RCC relations may require 
additional theorem-proving of the sort discussed by Randell, Cohn, Cui and
Bennett.

Maddux has presented certain relation algebras called the
{\it compass algebras}~\cite{Mad94}, which can be interpreted as describing
particular directions (say, when describing relative position) 
in $n$-dimensional Euclidean space. He discusses
the (mathematical) solution of constraint problems over the compass
algebras. Many are NP-complete, including those for relatively simple
compass algebras: ``{\it essentially all but the most trivial compass
and interval algebras have NP-hard constraint satisfaction 
problems}''~\cite{Mad94}.
Our algorithm could be used to solve compass algebra
CSPs. Again, using $C$ = the set of atoms of the particular compass
algebra, the compositions of atoms 
must be evaluated for use by the algorithm, 
and constraint problems involving only
atomic constraints must be easily soluble (condition (b)).


\paragraph{Overview of the Paper.}
In Sections~\ref{sec:theory} and~\ref{sec:pc} we introduce the theoretical 
background for symbolic constraint problem solving. 
We describe the generic algorithm design in Section~\ref{sec:arc}.
Section~\ref{sec:speedy} discusses ways of tuning the 
computation of path-consistency, including a comparison of
alternative methods of calculating composition.
Section~\ref{sec:empirical}
summarises previous experimental results,
and presents new results on interval problems.

\section{Binary Constraint Networks}
\label{sec:theory}

We introduce binary constraint problems and
their mathematical background, using interval constraint problems 
as an example.
A binary constraint problem on
$n$ variables $x_1, ..., x_n$ is given by a formula
\[(P_{12}(x_1, x_2) \; \wedge \; P_{13}(x_1, x_3) \; \wedge \;
...... \; \wedge \; P_{n-1, n}(x_{n-1}, x_n) )\]
where the $P_{ij}$
are predicate symbols representing relational constraints
on the variables $x_i$ taken in pairs~\cite{Mac87}.
Constraints are thus binary relations.
A constraint problem  is {\it satisfied} by finding values for the
variables which satisfy the logical formula.
Since we represent binary constraint problems as graphs
(e.g. Figure~\ref{fig:4variableexample}), we shall also
refer to a constraint problem as a {\it network} whose
nodes are labelled with the variables and whose
edges are labelled with symbols representing the constraint
relations between the nodes.

In general constraint problems, the constraints $P_{ij}$ may
be given by explicit tuples of values, or by a rule which generates
explicit tuples of values (e.g.~\cite{Gues89}). 
Alternatively, the constraints may be given symbolically.
One way is for the constraints to be specified as
{\it unions} of distinguished relations from some small class $A$.
(Binary relations mathematically speaking are sets of pairs,
and {\it union} is normal set union. We shall also
call it a {\it sum}, to conform with relation-algebraic usage.)

The properties we require of this distinguished subclass $A$
are that:
\begin{description}
\item[(i)]  relations in $A$
are pairwise disjoint (no pair of values belongs to more than
one relation); 
\item[(ii)] the union of all members of $A$
is everything (every pair of values belongs to one of these relations); and 
\item[(iii)] all the constraint relations may be written as a union of
relations in $A$.
\end{description}
We call members of a class $A$ satisfying (i) - (iii)
{\it atomic relations}.
The class of all possible unions of the atomic relations
forms a Boolean algebra, of which the atomic relations are atoms
\cite{BurSan81}. Further, if this Boolean algebra is closed under
composition and converse, and contains the equality relation,
then this class forms a relation algebra~\cite{JonTar52}.

We use interval relations to illustrate.
An {\it interval} is a pair $\langle a,b \rangle$ of real or rational
numbers, such that $a < b$~\cite{All83}.
We consider just the binary relations on intervals
obtained by considering the ordering (or equality) of their
endpoints.
There are 13 atomic relations in this class\footnote{A general 
reference for interval relations is~\cite{vBen91}.}.
Seven of them are defined in Figure \ref{fig:reldefs},
and the other six are obtained by taking the {\it converses}
(see below) of these relations\footnote{%
In most papers, including~\cite{All83}, these relations are 
defined by pictures.}.
The atomic relations are sets of
interval pairs $\langle\langle x,y \rangle,\langle x',y' \rangle\rangle$. 
There are thus $2^{13}$ possible interval relations, obtained by
taking all possible unions of the atomic relations\footnote{
Note that although the relations themselves are infinite, there are only
finitely many relations obtained by this procedure.}.
By the connection between set-union and
logical {\sf or} ($\vee$), we may write
a binary constraint in the logical form
\[P_{ij}(x_i,x_j) \; \equiv \; 
( \: (x_i \: R_1 \: x_j) \: \vee \:
........
(x_i \: R_q \: x_j) \: )\]
where the $R_p$ are specific
atomic relations from Figure~\ref{fig:reldefs}.
We thus see that an interval constraint problem is a logical
formula in a restricted conjunctive normal form,
in which each individual clause only has literals containing the
same two free variables.

\begin{figure}
\hfill\begin{tabular}{|lr|} \hline 
{\em Equals:} & $Id(S) = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
 x = x' < y = y' \in {\bf R} \}
$\\

{\em Precedes:} & $
P = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
 x < y < x' < y' \in {\bf R} \}
$\\


{\em During:} & $
D = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
x' < x < y < y'  \in {\bf R} \}
$\\


{\em Overlaps:} & $
O = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
x < x' < y < y' \in {\bf R} \}
$\\


{\em Meets:} & $
M = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
x < y = x' < y' \in {\bf R} \}
$\\


{\em Starts:} & $
S = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
x = x' < y < y' \in {\bf R} \}
$\\


{\em Finishes:} & $
F = 
\{ \langle \langle x,y \rangle,
\langle x',y' \rangle \rangle :
x' < x < y = y' \in {\bf R} \}
$\\
\hline
{\em Converses:} &  $P^\smile, D^\smile, O^\smile, M^\smile,
S^\smile, F^\smile$\\
\hline \end{tabular}\hspace*{\fill}
\caption{The Formal Definition of The Interval Relations}
\label{fig:reldefs}
\end{figure}


\begin{figure}
\small
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\parbox{15pt}{\mbox{}}
& \parbox{15pt}{$1^{\prime}$}
& \parbox{15pt}{$p$} 
& \parbox{15pt}{  $p^{\smile}$ } 
& \parbox{15pt}{$d$} 
& \parbox{15pt}{$d^{\smile}$} 
& \parbox{15pt}{$o$} 
& \parbox{15pt}{$o^{\smile}$}
& \parbox{15pt}{$m$}  
& \parbox{15pt}{$m^{\smile}$} 
& \parbox{15pt}{$s$} 
& \parbox{15pt}{$s^{\smile}$} 
& \parbox{15pt}{$f$} 
& \parbox{15pt}{$f^{\smile}$} \\
\hline\hline


\parbox{15pt}{$1^{\prime}$}
& \parbox{15pt}{$1^{\prime}$}
& \parbox{15pt}{$p$} 
& \parbox{15pt}{  $p^{\smile}$ } 
& \parbox{15pt}{$d$} 
& \parbox{15pt}{$d^{\smile}$} 
& \parbox{15pt}{$o$} 
& \parbox{15pt}{$o^{\smile}$}
& \parbox{15pt}{$m$} 
& \parbox{15pt}{$m^{\smile}$} 
& \parbox{15pt}{$s$} 
& \parbox{15pt}{$s^{\smile}$} 
& \parbox{15pt}{$f$} 
& \parbox{15pt}{$f^{\smile}$} \\
\hline


\parbox{15pt}{$p$} 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$1$} 
& \parbox{15pt}{$u$ } 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$u$} 
& \parbox{15pt}{$p$}
& \parbox{15pt}{ $u$ } 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$u$} 
& \parbox{15pt}{$p$} \\
\hline



\parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$1$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$v^\smile$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$v^\smile$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$v^\smile$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$v^\smile$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$p^{\smile}$}  \\
\hline




\parbox{15pt}{$d$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$p$} 
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$1$ }
& \parbox{15pt}{$u$ }
& \parbox{15pt}{  $v^\smile$  }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$v^\smile$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$u$}\\
\hline

\parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$v$ }
& \parbox{15pt}{$u^\smile$ }
& \parbox{15pt}{  $n$  }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$z^{\smile}$ }
& \parbox{15pt}{$y^{\smile}$ }
& \parbox{15pt}{$z^{\smile}$ }
& \parbox{15pt}{$y^{\smile}$ }
& \parbox{15pt}{$z^{\smile}$ }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$y^{\smile}$ }
& \parbox{15pt}{$d^{\smile}$ }\\
\hline

\parbox{15pt}{$o$ }
& \parbox{15pt}{$o$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$u^{\smile}$ }
& \parbox{15pt}{$y$ }
& \parbox{15pt}{$v$ }
& \parbox{15pt}{$x$ }
& \parbox{15pt}{$n$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$y^{\smile}$}
& \parbox{15pt}{$o$ }
& \parbox{15pt}{$z^{\smile}$}
& \parbox{15pt}{$y$}
& \parbox{15pt}{$x$}\\
\hline

\parbox{15pt}{$o^{\smile}$ }
& \parbox{15pt}{$o^{\smile}$ }
& \parbox{15pt}{$v$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$}
&  \parbox{15pt}{$u^{\smile}$  }
& \parbox{15pt}{  $n$  }
& \parbox{15pt}{$x^{\smile}$}
& \parbox{15pt}{$z^{\smile}$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$}
& \parbox{15pt}{$x^{\smile}$}
& \parbox{15pt}{$o^{\smile}$ }
& \parbox{15pt}{$y^{\smile}$}\\
\hline

\parbox{15pt}{$m$ }
& \parbox{15pt}{$m$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$u^{\smile}$  }
& \parbox{15pt}{$y$}
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$y$}
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$a$}
& \parbox{15pt}{$m$ }
& \parbox{15pt}{$m$ }
& \parbox{15pt}{$y$ }
& \parbox{15pt}{$p$ }\\
\hline

\parbox{15pt}{$m^{\smile}$ }
& \parbox{15pt}{$m^{\smile}$ }
& \parbox{15pt}{$v$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$b$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$m^{\smile}$ }
& \parbox{15pt}{$m^{\smile}$ }\\
\hline

\parbox{15pt}{$s$ }
& \parbox{15pt}{$s$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$v$}
& \parbox{15pt}{$x$ }
& \parbox{15pt}{$z$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$m^{\smile}$ }
& \parbox{15pt}{$s$ }
& \parbox{15pt}{$b$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$x$ }\\
\hline

\parbox{15pt}{$s^{\smile}$ }
& \parbox{15pt}{$s^{\smile}$ }
& \parbox{15pt}{$v$}
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$z$ }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$z^{\smile}$}
& \parbox{15pt}{$o^{\smile}$ }
& \parbox{15pt}{$z^{\smile}$}
& \parbox{15pt}{$m^{\smile}$ }
& \parbox{15pt}{$b$}
& \parbox{15pt}{$s^{\smile}$ }
& \parbox{15pt}{$o^{\smile}$ }
& \parbox{15pt}{$d^{\smile}$ }\\
\hline

\parbox{15pt}{$f$ }
& \parbox{15pt}{$f$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$u^{\smile}$  }
& \parbox{15pt}{$y$ }
& \parbox{15pt}{$x^{\smile}$}
& \parbox{15pt}{$m$ }
& \parbox{15pt}{$p^{\smile}$ }
& \parbox{15pt}{$d$ }
& \parbox{15pt}{$x^{\smile}$}
& \parbox{15pt}{$f$ }
& \parbox{15pt}{$a$}\\
\hline

\parbox{15pt}{$f^{\smile}$ }
& \parbox{15pt}{$f^{\smile}$ }
& \parbox{15pt}{$p$ }
& \parbox{15pt}{$u^{\smile}$  }
& \parbox{15pt}{$y$ }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$o$ }
& \parbox{15pt}{$y^{\smile}$}
& \parbox{15pt}{$m$ }
& \parbox{15pt}{$y^{\smile}$}
& \parbox{15pt}{$o$ }
& \parbox{15pt}{$d^{\smile}$ }
& \parbox{15pt}{$a$}
& \parbox{15pt}{$f^{\smile}$ }\\
\hline
\end{tabular}

\vspace{0.2cm}
$\begin{array}{l}
x  = (p+o+m) \\
y   = (d+o+s)  \\
z   = (d + o^\smile + f)  \\
a   = (1^\prime + f + f^\smile)  \\
b   = (1^\prime + s + s^\smile)  \\
u   = (x + y)  = (p+o+m+d+s)  \\
v   = (x + z^\smile)  = (p+o+m+ d^\smile + f^\smile) \\
n  = (z + z^\smile + b)  = (y + y^\smile + a)  =
(1^\prime + f + d + o + s + f^\smile + d^\smile + o^\smile + s^\smile ) \\
\end{array}$
\caption{The Relation Composition Table for the Interval Algebra}
\label{fig:compositiontable}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P+M$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$O+P+M$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$O+M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P+M$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P+P^\smile$}}
\put(1.00,6.00){\makebox(0,0)[lb]{$i_1(O+M)i_2 ~\wedge~ i_1(P+M) i_3 ~\wedge~ i_1(P+P^\smile) i_4$}}
\put(1.00,1.00){\makebox(0,0)[lb]{$\wedge~ i_2(O+P+M)i_4 ~\wedge~ i_3(P+M)i_4$}}
\end{picture}\hspace{\fill}
\caption{An Interval Constraint Problem in 4 variables and its Network}
\label{fig:4variableexample}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\begin{picture}(143.00,40)
\small
\put(6.00,6.00){\circle{6.00}}
\put(44.00,6.00){\circle{6.00}}
\put(44.00,6.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,6.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,6.00){\vector(1,0){32.00}}
\put(25.00,7.00){\makebox(0,0)[cb]{$P+M$}}
\put(46.00,8.00){\vector(1,1){17.00}}
\put(63.00,28.00){\circle{6.00}}
\put(63.00,28.00){\makebox(0,0)[cc]{$i_4$}}
\put(9.00,8.00){\vector(3,1){52.00}}
\put(30.00,18.00){\makebox(0,0)[cc]{$P+P^\smile$}}
\put(54.00,14.00){\makebox(0,0)[lc]{$P+M$}}
\
\put(83.00,6.00){\circle{6.00}}
\put(121.00,6.00){\circle{6.00}}
\put(121.00,6.00){\makebox(0,0)[cc]{$i_3$}}
\put(83.00,6.00){\makebox(0,0)[cc]{$i_1$}}
\put(86.00,6.00){\vector(1,0){32.00}}
\put(102.00,7.00){\makebox(0,0)[cb]{$P+M$}}
\put(123.00,8.00){\vector(1,1){17.00}}
\put(140.00,28.00){\circle{6.00}}
\put(140.00,28.00){\makebox(0,0)[cc]{$i_4$}}
\put(86.00,8.00){\vector(3,1){52.00}}
\put(107.00,18.00){\makebox(0,0)[cc]{$P$}}
\put(131.00,14.00){\makebox(0,0)[lc]{$P+M$}}
\end{picture}

\caption{A Triangle Violating Path Consistency, and its Modification}
\label{fig:triangleviolating}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}
\begin{picture}(117.00,40)
\small
\put(10.00,15.00){\circle{6.00}}
\put(48.00,15.00){\circle{6.00}}
\put(48.00,15.00){\makebox(0,0)[cc]{$i_3$}}
\put(10.00,15.00){\makebox(0,0)[cc]{$i_1$}}
\put(13.00,15.00){\vector(1,0){32.00}}
\put(29.00,16.00){\makebox(0,0)[cb]{$P+M$}}
\put(30.00,38.00){\circle{6.00}}
\put(30.00,38.00){\makebox(0,0)[cc]{$i_2$}}
\put(11.00,18.00){\vector(1,1){17.00}}
\put(16.00,26.00){\makebox(0,0)[rc]{$O+M$}}
\put(32.00,36.00){\vector(3,-4){13.67}}
\put(4.00,6.00){\makebox(0,0)[lb]{$(O+M)^\smile \circ (P+M)~\mbox{is}$}}
\put(4.00,1.00){\makebox(0,0)[lb]{$(1'+P+M+O+S+D^\smile + F^\smile + S^\smile)$}}
\put(41.00,27.00){\makebox(0,0)[lc]{$1$}}
\
\put(76.00,15.00){\circle{6.00}}
\put(114.00,15.00){\circle{6.00}}
\put(114.00,15.00){\makebox(0,0)[cc]{$i_3$}}
\put(76.00,15.00){\makebox(0,0)[cc]{$i_1$}}
\put(79.00,15.00){\vector(1,0){32.00}}
\put(95.00,16.00){\makebox(0,0)[cb]{$P+M$}}
\put(96.00,38.00){\circle{6.00}}
\put(96.00,38.00){\makebox(0,0)[cc]{$i_2$}}
\put(77.00,18.00){\vector(1,1){17.00}}
\put(82.00,26.00){\makebox(0,0)[rc]{$O+M$}}
\put(98.00,36.00){\vector(3,-4){13.67}}
\put(70.00,6.00){\makebox(0,0)[lb]{$X~\mbox{is}~(1'+P+M+O+S+D^\smile + F^\smile + S^\smile)$}}
\put(107.00,27.00){\makebox(0,0)[lc]{$X$}}
\end{picture}
\hspace{\fill}

\caption{Another (Implicit) Violating Triangle and Its Modification}
\label{fig:triangle2violating}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P+M$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$O+P+M$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$O+M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P+M$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(28.00,35.00){\vector(3,-4){13.67}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P$}}
\put(35.00,30.00){\makebox(0,0)[cb]{$X$}}
\put(1.00,5.00){\makebox(0,0)[lb]{$X$ is $(1'+P+M+O+S+D^\smile + F^\smile + S^\smile)$}}
\end{picture}\hspace{\fill}

\caption{The Path-Consistent Reduction}
\label{fig:pcred}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P+M$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$O+P+M$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P+M$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(28.00,35.00){\vector(3,-4){13.67}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P$}}
\put(35.00,30.00){\makebox(0,0)[cb]{$X$}}
\put(1.00,5.00){\makebox(0,0)[lb]{$X$ is $(1'+P+M+O+S+D^\smile + F^\smile + S^\smile)$}}
\end{picture}\hspace{\fill}

\caption{Choice of $M$ between $i_1$ and $i_2$}
\label{fig:firstchoice}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$O+P+M$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P+M$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(28.00,35.00){\vector(3,-4){13.67}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P$}}
\put(35.00,30.00){\makebox(0,0)[cb]{$Y$}}
\put(1.00,5.00){\makebox(0,0)[lb]{$Y$ is $(P+M+O+D^\smile + F^\smile)$}}
\end{picture}\hspace{\fill}

\caption{Choice of $P$ between $i_1$ and $i_3$, and reduction}
\label{fig:secondchoice}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$P$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P+M$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(28.00,35.00){\vector(3,-4){13.67}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P$}}
\put(35.00,30.00){\makebox(0,0)[cb]{$P$}}
\end{picture}\hspace{\fill}

\caption{Choice of $P$ between $i_2$ and $i_3$, and reduction}
\label{fig:thirdchoice}
\end{figure}

\begin{figure}
\unitlength=1.00mm
\linethickness{0.4pt}
\hspace{\fill}\begin{picture}(67.00,40)
\small
\put(6.00,14.00){\circle{6.00}}
\put(44.00,14.00){\circle{6.00}}
\put(44.00,14.00){\makebox(0,0)[cc]{$i_3$}}
\put(6.00,14.00){\makebox(0,0)[cc]{$i_1$}}
\put(9.00,14.00){\vector(1,0){32.00}}
\put(25.00,15.00){\makebox(0,0)[cb]{$P$}}
\put(46.00,16.00){\vector(1,1){17.00}}
\put(26.00,37.00){\circle{6.00}}
\put(64.00,37.00){\circle{6.00}}
\put(64.00,37.00){\makebox(0,0)[cc]{$i_4$}}
\put(26.00,37.00){\makebox(0,0)[cc]{$i_2$}}
\put(29.00,37.00){\vector(1,0){32.00}}
\put(45.00,38.00){\makebox(0,0)[cb]{$P$}}
\put(7.00,17.00){\vector(1,1){17.00}}
\put(12.00,25.00){\makebox(0,0)[rc]{$M$}}
\put(58.00,25.00){\makebox(0,0)[lc]{$P$}}
\put(9.00,16.00){\vector(3,1){52.00}}
\put(28.00,35.00){\vector(3,-4){13.67}}
\put(45.00,29.00){\makebox(0,0)[cb]{$P$}}
\put(35.00,30.00){\makebox(0,0)[cb]{$P$}}
\end{picture}\hspace{\fill}

\caption{Final choice of $P$ between $i_3$ and $i_4$}
\label{fig:fourthchoice}
\end{figure}

\medskip
We shall write interval relations in infix form.
Consider the example constraint problem
\[(i_1 \: O \: i_2 \; \vee \; i_1 \: M \: i_2) \; \wedge \;
(i_1 \: P \: i_3 \; \vee \; i_1 \: M \: i_3) \; \wedge \;
(i_1 \: P \: i_4 \; \vee \; i_1 \: {\con P} \: i_4) \; \wedge \;\]
\[(i_2 \: O \: i_4 \; \vee \; i_2 \: P \: i_4 \; \vee \; i_2 \: M \: i_4)
\; \wedge \;
(i_3 \: P \: i_4 \; \vee \; i_3 \: M \: i_4 ) \]
shown in graphical form as a constraint network 
in Figure~\ref{fig:4variableexample}.
The relation $P_{12}(i_1,i_2)$, for example, is
$(i_1 \: O \: i_2 \; \vee \; i_1 \: M \: i_2)$.

\paragraph{Relation Sum.}
The two literals in the $P_{12}$
clause share the same arguments (in the same order).
The expression defines a binary relation between these two arguments,
which is the set-theoretic union of the relations defined by
each literal (since the logical connective is $\vee$).
We denote this relation by $(O+M)$ and the corresponding
operator on relations by $+$. 
We can now write the problem more compactly:

\[i_1 \: (O+M) \: i_2 \; \wedge \;
i_1 \: (P+M) \: i_3 \; \wedge \;
i_1 \: (P+{\con P}) \: i_4 \; \wedge \;
i_2 \: (O+P+M) \: i_4 \; \wedge \;
i_3 \: (P+M) \: i_4 \]

One calculates the relation sum symbolically:
it is easy to see that the sum of $(P+M+O)$ and
$(O+S+F+M)$ is the sum of atoms occurring in either, 
i.e. $(P+M+O+S+F)$.


\paragraph{Relation Intersection.}
Relation intersection is just intersection of sets.
The symbolic calculation of this operation is also simple,
when relations are represented as sums of atoms.
Atomic relations are pairwise disjoint (i.e. the
intersection of any two of them is empty), 
thus trivial set theory shows that
the intersection of two relations such as $(P+M+O)$ and $(O+S+F+M)$ 
is just the sum of the atomic relations common to both, namely $(O+M)$.

\paragraph{Relation Converse.}
The {\it converse} ${\con R}$ of a relation $R$ is defined
by the equivalence 
\[
x {\con R} y \; \equiv_{def} \; y R x
\]
If the relation $R$ labels the edge $[i,j]$ in a network, then the
same information is conveyed by a label of ${\con R}$ on the 
reverse edge $[j,i]$.
The {\it converse} operation is needed in 
path-consistency computations.

\paragraph{Composition, or Relative Product.}
Given binary relations $R(x,y)$, $S(x,y)$, the
{\em composition} $R  \circ S$ of the relations
is defined by
\[
(R  \circ S)(x,y) \Leftrightarrow (\exists z)(R(x,z) \; \& \; S(z,y))
\]

\paragraph{Pointisable Relations.}
A {\it pointisable relation} on intervals is a relation
which may be written as a conjunction of equality and
inequality relations on its endpoints.
For example, let $x_L, x_R$ denote respectively the 
left and right endpoints of interval $x$.
Then $x (O+M) y$ may be written as $(x_L < y_L \; \wedge \; y_L \leq x_R)$,
and thus is pointisable.
However, not all formulas may be written thus, e.g. $x (P+{\con P}) y$.
The reader may verify that
a succinct formula for this relation is the disjunction
$(x_R < y_L \; \vee \; y_R < x_L)$.
Interval constraint problems all of whose constraints are pointisable
may be written without loss of information
as constraint problems whose variables are the endpoints, and whose
non-trivial, non-empty constraints are one of $<, =, >, \leq, \neq, \geq$.
Such problems may be solved in quadratic time~\cite{vBe90}, and all
such problems which are path-consistent are also
soluble~\cite{LadMad88,LadMad94}.

There are 187 pointisable relations,
defined and investigated in~\cite{LadMad88}, 
and independently in~\cite{vBeCoh89}.
N\"okel's~\cite{Noek91} technical diagnosis system uses
algorithms on $1$-convex and $2$-convex relations, which are
subclasses of the pointisable relations.
For further information on the relation between pointisable
interval constraint problems and equivalent point networks,
see~\cite{LadMad88,KauLad91}.

\section{3-Consistency and Path-Consistency}
\label{sec:pc}

We here describe the property of
path-consistency, which turns out to be equivalent to
3-consistency.
We present a formal representation and an algorithmic formulation
of a general path-consistency algorithm based on
relational matrices.

The composition table of the $13$ atomic relations on intervals was given
in~\cite{All83}, and shown in Figure~\ref{fig:compositiontable},
using auxiliary definitions of eight other (non-atomic) interval relations.
From the composition table from atoms, one calculates the 
composition of two arbitrary relations by using the distributive
laws $R \circ (S + T) \: = \: (R \circ S)+(R \circ T)$ and
$(R + S) \circ T \: = \: (R \circ T)+(S \circ T)$.
Use of these distributive laws is very time-consuming,
and can easily account for most of the computation time 
unless care is taken. We compare the various methods of
calculating composition in Section~\ref{sec:speedy}.
There is a space/time tradeoff in how much of the
entire composition table  to store or cache, and
how much to compute. However, the tradeoff is weighted
very heavily in favor of time--when the entire table is
cached, our solution algorithm is extremely fast.

\paragraph{3-Consistency.}
By the definition, $(a,b) \in (R \circ S)$ if and only if
there is a value $c$ such that $(a,c) \in R$ and $(c,b) \in S$.
For any satisfying values $ a_1, ..., a_n $
for the variables $x_1, .., x_n$
we must have, by this definition,
$\langle a_i , a_k \rangle \in P_{ik}
\; \Rightarrow \; \langle a_i , a_k \rangle \in P_{ij} \circ P_{jk}$,
for any $i,j,k \leq n$.
This necessary condition may be used
as  a pruning technique to
narrow down the potential choices of $a_i$ and $a_k$:
we calculate the relation $P_{ij} \circ P_{jk}$, and
then intersect it with $P_{ik}$ to form the new,
potentially smaller relation (and thus tighter constraint) 
$P_{ik} \cap (P_{ij} \circ P_{jk})$.
We then use this as the new constraint on $x_i$ and $x_k$.
We call this a {\it triangle operation}.
A triangle operation on our example problem shown in 
Figure~\ref{fig:4variableexample}
is given in Figure~\ref{fig:triangleviolating},
and another in Figure~\ref{fig:triangle2violating}.
We say that a triangle operation {\it stabilises} if the
result is identical to the original label, 
equivalently that $(P_{ij} \circ P_{jk}) \subseteq P_{ik}$.
We say that a network is {\it 3-consistent}, or {\it is stable},
if every triangle operation stabilises.
The stable network resulting from triangle operations on
Figure~\ref{fig:4variableexample} is shown in 
Figure~\ref{fig:pcred}.
To stabilise a network, 
triangle operations must be performed on all possible constraints
$P_{ij}$ using all length-2 paths for every $P_{ij}$
(which involves also using the {\it converse} operation on labels)\footnote{%
This is how all 3-consistency algorithms in the literature work.}.
In general, triangle 
operations must be iterated for each $P_{ij}$ for the network to stabilise.
$3$-consistency is equivalent to path-consistency~\cite{Mon74}, so we follow
standard terminological abuse by conflating the two notions.

\paragraph{3-Consistency Is Relatively Cheap.}
3-consistency is the least expensive form of consistency-checking
for interval networks.
{\em Arc-consistency} (2-consistency) is computationally cheaper,
but unfortunately every interval problem is guaranteed to be 
arc-consistent~\cite{LadMad88}.

\paragraph{Complexity.}
Path-consistency is a necessary condition for consistency
but does not imply consistency~\cite{All83}.
As noted previously,
path-consistency algorithms are serial cubic time~\cite{Mac77}, or
parallel $O(n^2 \: log \: n)$ time, and iterative algorithms
may take $\theta(n^2)$ time~\cite{LadMad88}, 
but some studies conclude they can run in near
linear time on fast parallel machines~\cite{SusHen91,Sus91}.
Path-consistency computations have been implemented in a planning system 
which uses interval computations~\cite{Koo88,Koo89}.

\paragraph{A Path-Consistency Reduction Scheme.}
Denote {\it intersection} of relations by `$\cdot$', and
{\it composition} of relations by `$\circ$'.
Let $P_{ij}$ be the relational constraint between variables $x_i$ and $x_j$.
A path-consistency computation
may be regarded as computing the greatest fixed point of the
following sets of equations
(i.e. the collection of largest possible relations $r_{ij}$ satisfying them):
\[
r_{ij} \leq P_{ij}
\]
\[
r_{ij} = r_{ij} \cdot \prod_k (r_{ik} \: \circ \: r_{kj})
\]
where the symbol $\prod_k$ denotes the product taken over all 
$k \leq n$.
This fixed point is the most-general path-consistent reduction of
the original network.
This observation leads to the representation of 
constraint problems by $(n \times n)$
matrices of relation symbols, 
where the matrix $M$ corresponding to the 
constraint problem $A$ has
entries $M_{ij} = P_{ij}$. 
We call such a matrix a {\it relational matrix}.
By its nature, the matrix has to represent a complete graph, so
it contains an entry of {\bf 1} (the universal relation\footnote{%
Called `no info' in~\cite{All83}.} 
, i.e. the union of all $13$ atoms)
wherever no
constraint edge appears in the original problem.

{\it Product} and {\it composition} for relational matrices
are defined by the following schemes, which use intersection and
composition defined on relations:
\[
(M \cdot M')_{ij} = M_{ij} \cdot (M')_{ij}
\]
\[
(M \: \circ \: M')_{ij} = \prod_{k \leq n} M_{ik} \: \circ \; (M')_{kj}
\]
Define also the power $M^n$ by the usual induction,
$ M^1 = M$, and
$ M^{n+1} = (M^n) \: \circ \: M$.
So, for example, $M^2 = (M \: \circ \: M)$, as we use in our 
path-consistency function in Figure~\ref{fig:pc}.
More information about relation matrices may be found in~\cite{LadMad94}.

\paragraph{A Path-Consistency Algorithm.}

\begin{figure}[tp]\smallspacing
\begin{tabbing} xxxxxxxxxxx\=xxx \= xxx \= xxx \= \hspace{6cm} \= \kill
\>\FUNCTION {\em PC} ({\bf var} $M$:~{\bf matrix}):~\BOOLEAN;\\
\>\>	\REPEAT \\
\>\>\>		$M \IS M \cdot M^2;$\\
\>\>	\UNTIL $M = M^2;$\\
\>\>	\RETURN $(M \neq {\bf 0});$ \\
\>\END;
\end{tabbing}\normalspacing
\vspace{-3mm}
\caption{Path-Consistency Algorithm}
\label{fig:pc}
\end{figure}

The path-consistency algorithms in the literature to date are
all {\it iterative local} algorithms~\cite{LadMad94},
differing mainly in
the details of the iterations over the triangles. 
Our formulation in Figure~\ref{fig:pc} works on a relational
matrix $M$, which is iteratively reduced in the {\bf repeat} loop.
If $PC$ detects a zero edge in $M$ it halts immediately and returns false,
thereby indicating that the network is not path-consistent.

In a practical implementation, only the triangles of
edges $P_{ij}$ whose labels have changed in the previous iteration
need to be recomputed.
Some authors~\cite{Mac77,All83} propose a queue data structure
for maintaining the triangles that must be recomputed.
The computation then simply proceeds until the queue is empty.
In our implementation we flip a bit in the network matrix, 
denoting that this element must be recomputed in the next iteration.
This preserves the same edge evaluation order
from one iteration to the next.

We say that a network {\it fails\/} if a path-consistency computation
detects inconsistency, and it {\it succeeds\/} if it stabilises without
detecting inconsistency. 
Succeeding networks are usually consistent, but this need not be always 
the case, as we show in Figure~\ref{plot:incomplete}.


\section{A Generic Solution Algorithm Architecture}
\label{sec:arc}

\begin{figure}[t]
\unitlength=1.00mm
\linethickness{0.4pt}
\begin{picture}(98.00,113.00)
\footnotesize
\put(62.00,96.00){\framebox(25.00,10.00)[cc]{\shortstack[c]{preprocessing\\{\em (pc-comp.)}}}}
\put(62.00,59.00){\framebox(25.00,10.00)[cc]{\shortstack[c]{intelligent\\backtracking\\search}}}
\put(62.00,20.00){\framebox(25.00,10.00)[cc]{\shortstack[c]{postprocessing\\{\em (det.\ sol.\ alg.)}}}}
\put(74.00,91.00){\line(-2,-1){12.00}}
\put(62.00,85.00){\line(5,-3){12.00}}
\put(74.00,77.67){\line(5,3){13.00}}
\put(87.00,85.33){\line(-5,2){13.00}}
\put(74.00,78.00){\line(0,-1){9.00}}
\put(74.00,85.00){\makebox(0,0)[cc]{\shortstack[c]{path-consistent?}}}
\put(88.00,86.00){\makebox(0,0)[cb]{no}}
\put(87.00,85.00){\vector(1,0){9.00}}
\put(98.00,85.00){\makebox(0,0)[lc]{stop}}
\put(74.00,52.00){\line(-2,-1){12.00}}
\put(62.00,46.00){\line(5,-3){12.00}}
\put(74.00,38.67){\line(5,3){13.00}}
\put(87.00,46.33){\line(-5,2){13.00}}
\put(74.00,39.00){\line(0,-1){9.00}}
\put(74.00,46.00){\makebox(0,0)[cc]{\shortstack[c]{consistent?}}}
\put(88.00,47.00){\makebox(0,0)[cb]{no}}
\put(87.00,46.00){\vector(1,0){9.00}}
\put(98.00,46.00){\makebox(0,0)[lc]{stop}}
\scriptsize
\put(74.00,113.00){\makebox(0,0)[cb]{\em\shortstack[c]{Input:\\interval constraint problem}}}
\put(75.00,75.00){\makebox(0,0)[lc]{\em\shortstack[c]{reduced\\path-consistent\\problem}}}
\put(75.00,36.00){\makebox(0,0)[lc]{\em\shortstack[c]{consistent\\sub-problem}}}
\put(74.00,20.00){\vector(-2,-1){18.00}}
\put(74.00,20.00){\vector(2,-1){18.00}}
\put(92.00,9.00){\makebox(0,0)[ct]{\em\shortstack[tc]{assignment\\of values\\to labels}}}
\put(56.00,9.00){\makebox(0,0)[ct]{\em\shortstack[c]{consistent\\atomic\\labeling}}}
\put(74.00,52.00){\line(0,1){7.00}}
\put(74.00,91.00){\line(0,1){5.00}}
\put(74.00,110.00){\line(0,-1){4.00}}
\put(90.00,64.00){\makebox(0,0)[lc]{\em (see text)}}
\end{picture}
\caption{General Algorithm Design}
\label{fig:architecture}
\end{figure}

Figure~\ref{fig:architecture} illustrates our
generic solution algorithm design as a flow chart.
Details on the path-consistency check
and the backtracking search are given in the
pseudo-code in Figs.~\ref{fig:pc} and \ref{fig:cc}.
At the core of any interval constraint solver is an
intelligent backtracking search, with some pre- and postprocessing.

We found a path-consistency check effective for pre-processing,
but other reduction schemes are possible (not arc-consistency!).
Path-consistency is a necessary condition for consistency,
and often suffices to prove a network inconsistent.
Preprocessing with path-consistency
has the additional advantage that it
returns a logically equivalent, syntactically {\em reduced network},
in which many atoms that can not be part of a solution have been deleted.
The reduction is more pronounced for large networks than for small ones,
so that few or no nodes need to be expanded in the solution search.

After preprocessing, the network is further reduced
by an intelligent backtracking search 
until it is known to be consistent.
A network is {\em consistent} if there exists a solution,
or equivalently for the case of interval problems, 
a consistent atomic reduction~\cite{LadMad88}.
Figure~\ref{fig:cc} gives pseudo code for our
consistency check routine, $CC$.
It works on a relation matrix $M$ and is started on the first edge
$M_{12}$, i.e.\ function $CC$ is initially invoked with parameters 
$M$, $i=1$ and $j=2$.
$CC$ selects a sub-label $k_l \in E$ from the edge $M_{ij}$,
where $E$ is (in our case) either the set of pointisable labels
or the set of the 13 atomic labels.
The path-consistent reduction of the resulting network is
calculated, and if it is non-trivial (i.e. not inconsistent),
$CC$ recursively deepens on the next edge, 
and selects again a sub-label $l \in E$ on that edge.
When all selected atomic labels form a path consistent network, 
the whole network is consistent~\cite{LadMad88}. 
If the network does not succeed at some point,
the algorithm backtracks and chooses another sub-label $l$ on that label.
Only when all sub-labels have been unsuccessfully tried
may the entire network be deemed inconsistent.
Figures~\ref{fig:firstchoice} -~\ref{fig:fourthchoice} show
an actual run of the algorithm on
the initial path-consistent reduction (Figure~\ref{fig:pcred})
of our example (Figure~\ref{fig:4variableexample}).

Each $PC$-call in the search reduces the network matrix $M$.
The resulting search tree is bushy near the root and gets thinner 
in deeper levels.
The larger the network, the more reductions are achieved,
because in the large networks
more label compositions are intersected,
constraining the remaining label to a greater extent.
In very large networks (eg. $n>100$), 
the initial path-consistency check seems often to
suffice to determine the result.

To obtain an actual solution,
an assignment of values to variables,
from a consistent atomic labelling,
one needs to use van Beek's procedure of $O(n^2)$ steps, as mentioned.


\begin{figure}[tp]
\smallspacing
\begin{tabbing} xxx \= xxx \= xxx \= xxx \= \hspace{6cm} \= \kill
\FUNCTION {\em CC} ({\bf var} $M$:~{\bf matrix};$~i,~j$:~\INTEGER):~\BOOLEAN;\\
\{Recursive consistency computation, starting at edge $M_{ij}$\}\\
\>	$M' \IS M;$			\>\>\>\>\{save matrix $M$\}\\
\>	\FOR $each~sublabel~l_k \in M_{ij}$ \DO \BEGIN\\
\>\>            $M_{ij} \IS l_k;$\\
\>\>		\IF $PC(M)$  \THEN\\
\>\>\>			\IF $M_{ij}~is~last~edge~\OR CC(M,~next\_i,~next\_j)$ \THEN\\
\>\>\>\>			\RETURN ($true$);\\
\>\>		$M \IS M'$;	\>\>\>\{restore $M$\}\\
\>	\END; \\
\>	\RETURN ($false$); \>\>\>\>\{no consistent atomic labeling\}\\
\END;
\end{tabbing}
\normalspacing
\vspace{-5mm}
\caption{Consistency Computation Algorithm}
\label{fig:cc}
\end{figure}

\begin{table}[t]
\hspace*{\fill}\begin{tabular}{|l|cccccccccccc|c|}\hline
  &  $p$ & ${\con p}$ & $d$ & ${\con d}$ & $o$ & ${\con o}$ & $m$ & ${\con m}$ & $s$ & ${\con s}$ & $f$ & ${\con f}$ & $\sum$\\ \hline
$p$ &  1 & 13 &  5 &  1 &  1 &  5 &  1 &  5 &  1 &  1 &  5 &  1 &  41\\ 
${\con p}$ & 13 &  1 &  5 &  1 &  5 &  1 &  5 &  1 &  5 &  1 &  1 &  1 &  41\\ 
$d$ &  1 &  1 &  1 & 13 &  5 &  5 &  1 &  1 &  1 &  5 &  1 &  5 &  41\\ 
${\con d}$ &  5 &  5 &  9 &  1 &  3 &  3 &  3 &  3 &  3 &  1 &  3 &  1 &  41\\ 
$o$ &  1 &  5 &  3 &  5 &  3 &  9 &  1 &  3 &  1 &  3 &  3 &  3 &  41\\ 
${\con o}$ &  5 &  1 &  3 &  5 &  9 &  3 &  3 &  1 &  3 &  3 &  1 &  3 &  41\\ 
$m$ &  1 &  5 &  3 &  1 &  1 &  3 &  1 &  3 &  1 &  1 &  3 &  1 &  25\\ 
${\con m}$ &  5 &  1 &  3 &  1 &  3 &  1 &  3 &  1 &  3 &  1 &  1 &  1 &  25\\ 
$s$ &  1 &  1 &  1 &  5 &  3 &  3 &  1 &  1 &  1 &  3 &  1 &  3 &  25\\ 
${\con s}$ &  5 &  1 &  3 &  1 &  3 &  1 &  3 &  1 &  3 &  1 &  1 &  1 &  25\\ 
$f$ &  1 &  1 &  1 &  5 &  3 &  3 &  1 &  1 &  1 &  3 &  1 &  3 &  25\\ 
${\con f}$ &  1 &  5 &  3 &  1 &  1 &  3 &  1 &  3 &  1 &  1 &  3 &  1 &  25\\ 
\hline \end{tabular}\hspace*{\fill}
\label{labelsize}
\caption{Number of Atoms resulting from Label Compositions}
\end{table}

\section{Speeding Up Path Consistency}
\label{sec:speedy}

A complete network of size $n$ has $n \cdot (n-1) / 2$ edges. 
For every edge, the compositions of all $n-2$ alternative length-2-paths
(the other possible edges of the triangle) 
must be intersected with the original edge, giving a total of
$${{n \cdot (n-1) \cdot (n-2)} \over {2}}$$ compositions and intersections.
Computing the converse relations (the other triangular matrix) 
requires another $n \cdot (n-1) / 2$ operations.
For size $10$ networks, only 405 operations are needed,
but for size 50, we get 60,025 and for size 100 even 490,050 operations.
To make things worse, path-consistency is an iterative process, 
that usually needs more than one iteration to stabilize.
Path-consistency seems to stabilize on interval problems
quite rapidly in practice (Figure~\ref{plot:iterations}).
This figure also shows that larger random networks stabilize earlier 
than small ones.
This convenient property is due to the larger number of intersections,
which effectively reduces the size of the labels.


\subsection{Improved Path-Consistency Algorithms.}

The path-consistency algorithm of Section~\ref{sec:pc} simply
recomputes all labels in every iteration.
In practice, it suffices to recompute only the triangles of
edges $P_{ij}$ whose labels changed in the previous iteration.
Some authors~\cite{Mac77,All83} proposed a queue data structure
for maintaining the triangles that must be recomputed.
The path-consistency 
computation then simply proceeds until the queue is empty.
For our implementation, it turned out to be
faster to flip a bit in the network matrix, 
denoting that this element must be recomputed next time.
This also preserves the evaluation order for the next iteration.
This method has also been used by van Beek~\cite{vBeMan96}.

\subsection{Implementing Triangle Operations}
An efficient implementation of the triangle operation
$$
	\mbox{\it new-}P_{ij} = P_{ij} \cap (P_{ik} \circ P_{kj} )
$$
($1 \leq i,j,k \leq n, i \neq j \neq k \neq i$)
must perform `$\cap$' and `$\circ$' as fast as possible.
It seems natural to implement labels as bit vectors.
Thus the fastest operations on a modern RISC
processor (namely the bit-wise AND operation) can be used to perform the
intersection operation.

\hspace*{\fill}
\begin{figure*}[ht]
\beginpicture 
\small
\setcoordinatesystem units <4mm,3mm>
\setplotarea x from 3 to 30, y from 0 to 35

\axis bottom label {Network Size} ticks numbered from 5 to 30 by 5 
  short unlabeled from 3 to 30 by 1 /

%\axis left label {\stack{CPU,Time,[\%]}} ticks numbered from 0 to 35 by 5 
%	short unlabeled from 0 to 35 by 1 /
\axis left label {\stack{\%,,CPU,,Time}} ticks withvalues
	0 10 20 30 40 50 60 70 80 90 100 /
	at 0 3.5 7 10.5 14 17.5 21 24.5 28 31.5 35 / /

\plot
3 0.230
4 1.030
5 3.360
6 7.660
7 14.150
8 22.300
9 29.710
10 32.120
11 28.970
12 21.210
13 15.130
14 13.000
15 12.410
16 11.740
17 10.610
18 10.550
19 9.810
20 9.540
21 8.750
22 8.700
23 7.990
24 8.150
25 7.880
26 7.800
27 7.360
28 7.450
29 7.010
30 7.320
/
\put{Allen}[l] at 11 30

\setdashes
\plot
3 0.100
4 0.410
5 1.060
6 2.270
7 3.910
8 5.790
9 7.660
10 8.240
11 7.320
12 5.400
13 3.740
14 3.220
15 3.090
16 3.110
17 2.720
18 2.620
19 2.540
20 2.290
21 2.240
22 2.430
23 2.090
24 2.360
25 2.160
26 2.240
27 2.020
28 2.140
29 2.020
30 2.100
/
\put{Hogge}[l] at 12 7

\setdashpattern <12pt, 2pt>
\plot
3 0.080
4 0.300
5 0.780
6 1.560
7 2.760
8 4.200
9 5.300
10 5.750
11 4.900
12 3.430
13 2.500
14 2.150
15 2.120
16 2.060
17 1.770
18 1.850
19 1.640
20 1.420
21 1.660
22 1.680
23 1.380
24 1.580
25 1.480
26 1.580
27 1.330
28 1.350
29 1.530
30 1.720
/
\put{impr.~Hogge}[l] at 7.5 2.6

\setdashpattern <4pt, 4pt>
\plot
3 0.240
4 0.880
5 2.390
6 4.900
7 8.560
8 13.190
9 18.300
10 20.850
11 20.700
12 17.280
13 14.450
14 13.710
15 13.490
16 13.180
17 12.240
18 12.050
19 11.150
20 10.440
21 10.330
22 9.610
23 9.610
24 9.450
25 8.910
26 9.030
27 8.350
28 8.220
29 8.420
30 8.410
/
\put{hashing}[l] at 18 13


\put{\em cons.}[l] at 7.6 32.5
\put{\em path-cons.}[r] at 7 33
\setdots
%consistent
%3 1000 4 998 5 996 6 983 7 946 8 802 9 549 10 241 11 79 12 8 13 1 14 0 /
\plot
3 35
4 34.93
5 34.86
6 34.405
7 33.11
8 28.07
9 19.215
10 8.435
11 2.765
12 0.28
13 0.035
14 0
/

%path- consistent
%3 1000 4 998 5 996 6 983 7 952 8 847 9 660 10 387 11 217 12 81 13 29 14 9 15 4 16 1 17 0 18 0 /
\plot
3 35
4 34.93
5 34.86
6 34.405
7 33.32
8 29.645
9 23.1
10 13.545
11 7.595
12 2.835
13 1.015
14 0.315
15 0.14
16 0.035
17 0
/
\endpicture
\caption{Runtime on complete networks, 1000 problems each}
\label{fig:linux_time}
\end{figure*}
\hspace*{\fill}


\subsubsection{Speeding Up Composition.}
Speeding up the composition operation itself
could require a little more thought:
various methods are compared by their effect on the
average algorithm running time in Figure \ref{fig:linux_time}.
However, there is a clear winner: the optimal method, a table look-up,
which yielded such comparatively fast results that it couldn't 
be plotted on the same curve as the other methods!
The optimal method should therefore be used whenever possible
(it requires 64MB storage for the table for interval problems--see below).

\paragraph{Allen's method}~\cite{All83}:
A composition of non-atoms is computed
by looking up the compositions of atomic sublabels in a simple
composition table of size 13 by 13 and summing the results
(composition commutes with sum).
For each atom combination, the Allen composition table 
contains the compositions with all other atoms.
Compositions are performed by looping over all atoms in a label.
Between one and $12 \times 12 = 144$ atomic compositions must be looked up
($1'$ is a left- and right-identity for composition,
so we don't include it in the table)
and combined with a bitwise inclusive OR.
Allen's method appears poor when compared with the four
methods below.

\paragraph{The Optimal Method:} 
Given enough memory, the full $2^{13} \times 2^{13}$
composition table can be pre-computed and stored.
At run-time, a single memory reference yields
the composition of any two labels.
(It may be thought that a complete composition table 
would require slightly fewer entries since
any composition $R \circ \mbox{\it eq}$ or $\mbox{\it eq} \circ R$
is trivial. However, an equality-check must then
be added to the code, slowing it down.)

Implementation needs only half of that, because only an upper
(or lower) triangular matrix must be built:
the converse of a labeling is computed by flipping
all 13 bits (= the number of atoms), 
since converse conjugates with composition.
Since each entry has 2 bytes, one needs a total of 64 Megabytes memory
for the table for interval constraint problems.

We experimented on a 
SUN SparcStation 20 with 128 MB main memory, with the upper triangular
composition matrix (64 MB) held in memory.
The program was found to be extremely fast: 
10.000 problems each of size 3 to 30 took between 2 and 5 seconds only.
It was far too fast for us to plot the results in 
Figure~\ref{fig:linux_time}.
It's clear that, when possible, the optimal method should be used.

\subsubsection{Alternative methods}

It might be infeasible for constraint problems in domains with 
more than 13 atoms to store the entire composition table. We thus consider
three additional methods: one due to Hogge; an improvement of Hogge's 
method; and simple hashing.
The results of using these different methods may be seen in 
Figure~\ref{fig:linux_time}. 

\paragraph{Hogge's method}~\cite{Hogge87}:
John C. Hogge\footnote{We are grateful to Peter van Beek for
pointing out Hogge's work to us.} devised a method 
that uses four tables instead of only one. These are of size
$2^7 \cdot 2^7$  (bit 1-7 of rel1, bit 1-7 of rel2),
$2^7 \cdot 2^6$  (bit 1-7 of rel1, bit 8-13 of rel2),
$2^6 \cdot 2^7$  (bit 8-13 of rel1, bit 1-7 of rel2), and
$2^6 \cdot 2^6$  (bit 8-13 of rel1, bit 8-13 of rel2).
The result is given by the
union of the four array accesses plus 3 shift operations and
some logical ANDs.
A total of (16k + 8k + 8k + 4k) = 72k bytes memory space is needed.

\paragraph{An improved Hogge method}:
At the cost of a slight increase of memory space, Hogge's method can be
improved to use only two tables, one holding the 7 low order atom
compositions, and the other holding the 6 high order atom compositions.
We need memory space of size 
$(2^{13} \cdot 2^7) \cdot 2$ bytes = 2 MByte plus
$(2^{13} \cdot 2^6) \cdot 2$ bytes = 1 MByte.
This amount of memory is even available on many Intel-based home PCs
\footnote{In fact, we did our implemented work on an Intel 80486
running the Linux operating system.}.
More important is the improved computation speed, 
requiring only two memory accesses, one logical shift and one OR operation.


\paragraph{Hashing:}
In consistent networks, 
path consistency computation is computed iteratively many times over the
same triangles, while yielding only a few changes.
This motivated us to implement a hashing table holding all
previously computed compositions.
Before a composition is computed, we look in the table
to see whether it is there already.
If so, we use it.
If not, we compute the composition
using Allen's method, store the result in the hash table and proceed.
This hashing method has the advantage that any available
amount of memory can be utilized. In our case, we used 2 MBytes.

Figure \ref{fig:linux_time} shows that the hashing technique is
effective in consistent networks, where the same edges may be
evaluated in successive iterations.  Hashing is faster (on a CPU-time
basis) than Allen's method in complete networks of size $<14$, where
many iterations must be performed to prove a network consistent.
An explanation of this effectiveness is given in 
Figure~\ref{fig:hash_hits}, which shows the percentage hit-rate
in accessing the hash table, as a function of network size,
on networks with $c = 1$.
While the largest table of 2 mega-bytes gives best results,
we can save 99\% of the memory
with only negligible performance reductions:
A hashing table of only 8 kilo-bytes ($2^{13}$) gives almost the same results.
In this table we simply used the exclusive or of the two 13-bit relations
as a hashing index.
Figure \ref{fig:linux_time} also shows that 
reducing the table size further to only 256 bytes still 
gives significant savings over the naive composition method.

\hspace*{\fill}
\begin{figure*}[h]
\beginpicture
\small
\setcoordinatesystem units <6mm,0.8mm>
\setplotarea x from 3 to 20, y from 0 to 100

\axis bottom label {Network Size} ticks numbered from 5 to 20 by 5 
  short unlabeled from 3 to 20 by 1 /

\axis left label {\stack{\%,,Hash,,Table,,Hits}} ticks numbered from 0 to 100 by 20
	short unlabeled from 0 to 100 by 10 /

\plot 
%3 22 4 34 5 32 6 26 7 20 8 16 9 13 10 7 11 6 12 2 13 0
3 23
4 33
5 32
6 26
7 20
8 15
9 12
10 8
11 5
12 2
13 1
14 0
/
\put{256\,B}[l] at 6.8 25


\plot
3 28
4 51
5 59
6 62
7 63
8 61
9 59
10 55
11 47
12 35
13 19
14 10
15 3
16 2
17 1
18 0
/
\put{8\,kB}[c] at 7 59


\plot
3 30
4 53
5 62
6 66
7 67
8 67
9 65
10 59
11 53
12 38
13 22
14 12
15 7
16 3
17 1
18 0
/
\put{1MB}[c] at 7 69.5

\setdots
\plot
3 100.0 4 99.8 5 99.6 6 98.3 7 94.6 8 80.2 9 54.9 10 24.1 11 7.9 12 0.8 13 0 /
\put{\em cons.}[l] at 8.5 82

\plot
3 100.0 4 99.8 5 99.6 6 98.3 7 95.2 8 84.7 9 66.0 10 38.7 11 21.7 12 8.1 13 2.9 14 0.9 15 0.4 16 0 /
\put{\em path-cons.}[r] at 7.5 85

\endpicture
\caption{Hit rate for various hash table sizes (p=1.0, 1000 probs)}
\label{fig:hash_hits}
\end{figure*}
\hspace*{\fill}


\subsection{Improved Order of PC-Computations}

One may consider ordering the edges of the constraint
network in order to 
reduce the number of non-significant (or redundant) atoms
and to stabilize faster.

Van Beek gives each edge a heuristic label and processes the edge-stack 
according to the heuristic value. He suggested the following 
criteria~\cite{vBeMan96}:
\begin{enumerate}
\item
If either $P_{ij}$ or $P_{jk}$ is 1, then the result is 1.
\item
If two edge-labels to be composed include respectively
atoms $P$ and ${\con P}$; or ${\con P}$ and $P$; or $D$ and ${\con D}$,
then the result of the composition is 1. One may
check these three conditions in the bit-vectors and 
conclude the result, without further calculation.
\item
If, during calculation of the composition, it is determined
that the composition is already larger than the label
already constraining the target edge, the calculation for this
edge-triple may be stopped, since it cannot further constrain
the target edge : see ~\cite[Fig.~4]{vBeMan96}.
\end{enumerate}
In~\cite{ReiLad92}, we proposed some ordering schemes, namely:
\begin{description}
\item[Skip atomic edges]
In the search process, skip all edges with atomic labels.
Due to the previous path-consistency computation,
atomic labels are known to be consistent with the other labels
and hence do not further restrict the search space.
This not only saves computing time,
but more importantly saves memory space.
For the network sizes we investigated, skipping atomic edges
turns out to be almost essential. 
\item[Select $1'$-atoms first]
If an edge of the network contains an $equals$-relation,
reduce the dimension of the network matrix by joining the two vertices
and intersecting the labels of all adjacent edges. Formally,
let $P_{ij}$ contain a $1'$ (possibly among other atoms).
Select the $1'$-relation first and
perform for all $k \leq n$ the operations
$P_{ik} \leftarrow P_{ik} \cap P_{jk}$
and $P_{jk} \leftarrow P_{jk} \cap P_{ik}$.

If $1'$ is the only atom of $P_{ij}$,
delete the $i$-th row and the $i$-th column from the network matrix.
The label intersection has already been computed in the preceding 
path-consistency computation.
\item[Select point-meeting-relations first]
Select first those labels which have only few entries in the composition table:
for example for those intervals starting or ending at exactly the same
time instance: {\em equals, meets, starts, finishes} and their converses.
This cuts the search space at the start by reducing the amount of atoms
remaining in the network by what one hopes is a large amount.
This is a standard technique in constraint satisfaction.
In general, one would generate a statistic of label compositions
giving the most reduction in the label size.
This information could then be used to select the most probable
compositions first. For the case of interval networks, 
ongoing research may determine the effectiveness of this strategy.
\end{description}

\section{Empirical Studies of Random Networks}
\label{sec:empirical}

\begin{figure}[tb]
\beginpicture
\footnotesize
\setcoordinatesystem units <5mm,1mm>
\setplotarea x from 3 to 30, y from 0 to 100

\axis bottom label {Network Size} ticks numbered from 3 to 30 by 1 /

\axis left label {\stack[r]{\% of,cons.,probs.}} ticks
  numbered from 0 to 100 by 10 /

% pointisable, c=1
\plot 3 92.97 4 75.39 5 49.69 6 25.67 7 10.09 8 2.79 9 0.56 10 0.07 11 0.02 12 0 /
\put{$c=1$}[lc] at 5.2 50
\put{\em pointisable}[lc] at 5.3 47


%connectivity 1, 1000 runs, path-consistent nets:
\plot 3 100 4 99.9 5 99.9 6 98.9 7 94.5 8 84.6 9 64.2 10 41.3 11 20.0 12 9.0 13 2.2 14 1.2 15 .1 16 0 /

%connectivity 1, 1000 runs, consistent nets:
\plot 3 100.0 4 99.9 5 99.9 6 98.9 7 93.8 8 80.8 9 54.2 10 26.7 11 8.2 12 .5 13 0 /
\put{$c=1$}[lc] at 9.8 50


%connectivity 0.75, 1000 runs, path-consistent nets:
\plot 3 100.0 4 100.0 5 99.9 6 100.0 7 99.4 8 98.5 9 95.4 10 89.8 11 79.1 12 65.0
13 49.6 14 32.3 15 20.1 16 10.8 17 4.8 18 2.7 19 .3 20 .5 21 .2 22 0 /
\put{$c=0.75$}[lc] at 13.4 50

%connectivity 0.75, 1000 runs, consistent nets:
\plot 3 100.0 4 100.0 5 99.9 6 100.0 7 99.4 8 98.2 9 94.7 10 87.8 11 73.6 12 55.2
13 34.6 14 16.7 15 5.4 16 1.9 17 .1 18 .2 19 0 20 0 21 0 22 0 /


%1000 problems, conn=0.5, path-consistent networks:
\plot 3 100.0 4 100.0 5 100.0 6 100.0 7 99.8 8 99.9 9 99.9 10 99.6 11 99.3 12 97.9
13 96.6 14 94.1 15 91.0 16 87.0 17 80.4 18 71.2 19 59.1 20 49.7 21 37.6 22 28.4
23 20.1 24 13.2 25 9.4 26 5.2 27 2.7 28 1.9 29 .6 30 .4 31 0 /
\put{$c=0.5$}[lc] at 20.4 50

%1000 problems, conn=0.5, consistent networks:
\plot 3 100.0 4 100.0 5 100.0 6 100.0 7 99.8 8 99.9 9 99.8 10 99.6 11 99.3 12 97.9
13 96.3 14 92.7 15 88.7 16 81.4 17 71.9 18 57.3 19 41.8 20 28.6 21 14.6 22 7.9
23 3.0 24 .8 25 .1 26 0 /
\endpicture
\caption{Percentage of Consistent Networks (1000 Probs.)}
\label{plot:incomplete}
\end{figure}

We generated interval constraint networks
where the labels are independent, identically distributed random variables
drawn from a discrete probability distribution.
The networks have the following properties:
\bi
\item Each atom within a label occurs with the same probability.
\item Each label within the network occurs with the same probability.
\ei
We excluded initial 
networks with zero-labels, since they are known to be inconsistent.
Also, since one cannot expect constraint graphs to be complete in practice,
we generated graphs with different completion coefficients
ranging from $c=1$ (complete network) to $c= 0.5$ (every second edge
has a non-trivial constraint).
Unconstrained edges are labeled with the universal relation {\bf 1},
as explained above.

Figure~\ref{plot:incomplete} shows 
the percentage of networks of sizes $3 \leq n \leq 30$
that succeeded in the first path-consistency computation, and also those that
were later found to be consistent by the solution search. 
Three pairs of graphs are shown (for completion coefficients
of 1, 3/4 and 1/2).
In each pair, the left hand graph gives the percentage of consistent networks
and the right hand graph gives the percentage of path-consistent networks.
For the pointisable networks, only one graph is shown, 
because here path-consistency implies consistency.

All graphs show a sharp decline in the 
consistency rate with increasing network size.
We call it the {\em transition range}.
For complete networks ($c=1$),
the transition range lies between the size
8 networks (where roughly 20\% fail) and the size 11 networks 
(where roughly 80\% fail).
Networks in the transition range took particularly long to search,
in comparison with networks outside the transition range.
Even so, back in 1992,
the average solution time required within the transition range
was less than half a second of CPU time on a Sun SparcStation~1
(remember those?).
Although the problem is NP-complete,
we saw no case that needed longer than half a minute to solve,
amongst the 200,000 complete networks generated.

Moreover, for $c = 1$,
we found that {\it all} complete networks that we randomly generated
with more than 13 variables are inconsistent,
as are all pointisable networks with more than 11 variables~\cite{LadRei92}.
While at sizes 14 to 17, some small number ($\leq 1\%$)
of these inconsistent networks succeed,
inconsistency of large networks is usually detected right in
the initial path-consistency computation.

It is interesting to note that the
transition range gets wider in the networks for which $c < 1$.
Also the distance between the two graphs (consistent and path-consistent)
is growing, which indicates that the initial path-consistency computation 
is not so effective in networks with smaller values of $c$.
(We attribute this unwanted behavior to the smaller number of intersections of
relations, which is less constraining.)

\begin{figure}[tb]
\beginpicture
\footnotesize
\setcoordinatesystem units <6mm,10mm>  % Laenge einer Einheit x-, y-Achse
\setplotarea x from 3 to 20, y from 0 to 5

\axis bottom label {Network Size} ticks
   numbered from 4 to 20 by 2 short unlabeled from 3 to 19 by 2  /

\axis left label {\stack{Number of,Iterations}} ticks
  numbered from 0 to 5 by 1 short unlabeled from 0 to 5 by 0.5 /

\plot 3 1.16 4 1.47 5 1.88 6 2.36 7 2.83 8 3.23 9 3.32 10 2.99 11 2.46
12 1.93 13 1.53 14 1.27 15 1.13 16 1.05 17 1.02 18 1.01 19 1.00 20 1.00 /
\put{\sl random general (all)}[lb] at 11, 2.46

\plot 3 1.16 4 1.47 5 1.88 6 2.38 7 2.90 8 3.46 9 3.94 10 4.24 11 4.38 12 4.38 13 4.34 /
\put{\sl ~random general (path-cons.\ only)}[lc] at 13, 4.34

\plot 3 1.61 4 1.78 5 1.62 6 1.37 7 1.17 8 1.05 9 1.01 10 1.00 11 1.00 12 1.00
13 1.00 14 1.00 15 1.00 16 1.00 17 1.00 18 1.00 19 1.00 20 1.00 /
\put{\sl random pointisable}[lb] at 7, 1.17

\endpicture
\caption{Iterations in Initial Path-Consistency Computation, 10,000 Probs.}
\label{plot:iterations}
\end{figure}

\paragraph{Average Number of Iterations to Stabilise.} 
Figure~\ref{plot:iterations} shows 
the average number of iterations required to stabilise 
in the path-consistency computation for complete networks.
The number of iterations correlates with the transition range.
The peak (of 3.3 iterations)
occurs in the middle of the transition range at sizes 9 and 10.

While for sizes $n \leq 7$ always the same average number of iterations are
required, regardless of whether a network is path-consistent or not,
in larger sizes the consistent networks need more iterations to stabilise
than the inconsistent ones.
Inconsistency is usually detected right in the first iteration.

\begin{figure}
\beginpicture
\setcoordinatesystem units <8mm,1.5mm>
\setplotarea x from 0.5 to 13, y from 0 to 50

\axis bottom label {Branching Factor} ticks numbered from 1 to 13 by 1 /

\axis left label {\stack[c]{Cases,[\%]}} ticks numbered from 0 to 50 by 10 
short unlabeled from 0 to 50 by 5 /

%Pointisable
\setbars <-2pt,0pt> breadth <0pt> baseline at y = 0
\linethickness=4pt
%plot 1 187 2 2060 3 3670 4 1932 5 342 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 1 /
\plot 1 2.28
2 25.1465
3 44.7998
4 23.5840
5 4.1748
13 0.0122 /
\put {\em \stack[l]{search for,pointisable subsets}}[lc] at 3.1 44.7998

%General 
\setbars <2pt,0pt> breadth <4pt> baseline at y = 0
\linethickness=.25pt
%\plot 1 13 2 78 3 286 4 715 5 1287 6 1716 7 1716 8 1287 9 715 10 286 11 78 12 13 13 1 /
\plot
1 0.1587
2 0.9521
3 3.4912
4 8.7280
5 15.7104
6 20.9473
7 20.9473
8 15.7104
9 8.7280
10 3.4912
11 0.9521
12 0.1587
13 0.0122 /
\put{\em \stack[l]{search for,atoms}}[lc] at 7.3 20.9473

\endpicture
\caption{Distribution of Node Branchings}
\label{plot:branching}
\end{figure}

\paragraph{Initial Label Sizes}
Figure \ref{plot:branching} gives the initial distribution of 
the label sizes in random networks.
In absolute numbers,
the white bars add up to $2^{13}=8192$,
which is the total number of atoms over all possible labelings, 
ranging from $\emptyset$ to {\bf 1}.
Here, the numbers are given relative to the maximum, $8192=100\%$.

In random networks, there are an
average of $13/2=6.5$ atoms per label before the initial 
path-consistency computation.
This would be the average branching degree in a brute force solution search 
when no path-consistency reduction is applied.
The white bars in Fig.~\ref{plot:branching} show the distribution of the
label sizes over the whole range from one to thirteen atoms.
The curve has the shape of a Gaussian with the peak lying at 6 and 7,
as it should be.

When searching for pointisable sub-labels,
the branching is done on subsets rather than single atoms.
This reduces the branching degree to an average of $3.02$, 
as can be seen in the black bars in Fig.~\ref{plot:branching}.
Note that this gives a worst case estimate of the search branching degree,
because the frequent path-consistency checks in (and before)
the search further reduce the label size.

Since the branching degree is crucial to
the overall performance of any search problem,
we expect the search-for-pointisable-subsets to be much more efficient
than a direct search for atomic labelings.
In our experiments,
we noted speedups between a factor of 3 and 7
for network sizes ranging from 10 to 50, respectively.
In the very large problems of size $n>100$,
path-consistency is such an effective pruning technique
that further search is only seldomly required.
Hence, in the very large problems, the search-for-pointisable-subsets
can not speed up solution time.
However, as we have noted, it is nevertheless a significant factor
in space efficiency.


\paragraph{Average Label Reductions by Path-Consistency.}
We also investigated the pruning power of the path-consistency computation
in the search for atomic labelings.
In inconsistent networks
the first iteration of the path-consistency computation almost halves 
the label sizes, 
especially when the networks are very small ($\leq 7$) 
or very large ($\geq14$).
The following iterations then reduce the 
remaining atoms further, until a zero-label is found.

For the succeeding networks, 
also half of the total work is done in the first iteration.
In an additional experiment with large (non-random) {\em consistent}
networks, we found that path-consistency is more effective the larger
the network. 
In the size-80 networks, for example, path consistency reduces the average
label size to merely 1.1 atoms per label. 
In addition, fewer iterations are required.
For the details of these experiments see~\cite{ReiLad92}.


\paragraph{Solution Density in the Search for Atomic Labelings.}
The effort needed to solve a given problem depends 
on the density of the solution nodes in the search space.
As explained above,
this effort is greatly reduced by the path-consistency computations,
which reduces the size of the search tree.
But how much does path-consistency
reduce the average label size?

To answer this question, we modified our algorithm to examine the 
complete search space and return {\em all} solutions, rather than only one.
Overall, we found a surprisingly high solution density.
In networks of size $n<8$
every 10th to 25th leaf node (path) is a solution.
In the larger networks, more nodes must be searched to find a solution,
with the peak lying at size $9$-networks,
where every $\approx 200$th node contains a solution.
But even in this worst case,
the solution density is quite high considering the large search space.

When the path-consistency heuristic is applied in every interior node of the 
search tree (like in the above $CC$ algorithm), 
even fewer nodes are expanded.
The solution density is then at about 0.4,
that is, there is a 40\% probability for a node being a solution node.
Unfortunately,  the structure of the search tree is highly unbalanced,
with the solution nodes clustering in certain subtrees.
One cannot conclude that 
{\em each} interior search node has the same probability of
lying on a solution path.
But the given figure of 40\% remains the same
over the whole range of network sizes from $n=3$ to $n=11$.


\paragraph{Solution is Thus Expected Cubic Time.}
From the high solution density following each path-consistency
computation, we can predict
that the path-consistency computation dominates other
aspects of the solution algorithm,
and that in practice one can expect the
number of path consistency computations to be almost constant.
It therefore follows from~\cite{Mac77,MacFre85} that the solution procedure
is {\em expected cubic time} for serial computations.
Our statistics bear this out.

\paragraph{Resource Constraints.}
While for larger networks
a cubic time solution algorithm could be expected to be impractical
in terms of {\em time} taken,
in our experience the excessive {\em space} requirements
of the solution search are the more restrictive constraint.
Even with a simple depth-first search approach
the solution process builds a search tree 
of depth $d = n \cdot (n-1) \cdot 1/2$.
For every interior node one (triangular) network matrix
is stored on a stack, which results in a total 
space requirement of $d^2$ words.
For size-$100$-networks with $c = 1$, for example,
a maximum of 24 million memory words are needed.
Note, however, that our program usually needs less storage than this,
because it skips all atomic edges.
In our experiments, we saw no case which needed a full search depth of
$n \cdot (n-1) \cdot 1/2$.


\section{Conclusions}
\label{sec:conclusions}

We have presented a general algorithm architecture for solving
binary constraint problems symbolically.
Any class of constraint problems is included in a relation algebra,
which, when finite, contains atomic relations.
Our algorithm design may be used when there is a sub class $C$ of
the constraint relations for which
\begin{description}
\item[(a)] the composition table may
be stored and accessed efficiently; 
\item[(b)] there is an efficient
method for solving problems whose constraints are all in $C$;
\item[(c)] all constraint relations (including the atomic ones)
may be represented as sums of elements of $C$.
\end{description}
The algorithm searches on subrelations of a constraint
that are in $C$, and caches the composition table for all of $C$.
This reduces the branching factor in search, which decreases the
space requirements of the algorithm.
It also reduces the time taken in calculating compositions of arbitrary
constraints using the distributive law, but we suggest caching
the entire table instead, when practical, rather than computing
any of it.

Our experiments on interval problems showed that:
\begin{itemize}
\item 
Our methods are efficient enough to solve interval constraint
problems of $500$ variables and more in reasonable CPU time.
This includes problems in the {\it transition range}, which has
been observed by others typically to include the hardest areas
of random problems~\cite{ChKaTa91,Sel95:IJCAI-invited}.
\item 
Path-consistency computations {\em during} the search are an 
excellent pruning technique, considerably reducing backtracking
during search even on problems in the transition range.
For problems outside the transition range, search becomes almost
a linear selection of atomic (or pointisable) labels for the edges.
\item 
The computation time is dominated by path-consistency computations,
which are actual cubic time ($\approx 1/6 \cdot n^3$), in particular by
calculating compositions of arbitrary constraint relations from the
cached composition table.
\item
The computation space requirements are affected by the branching
factor in the search, and are a more significant resource limitation
than the time requirements.
Hence, more sophisticated solution
search methods (like best-first searches) are not generally needed.
\end{itemize}

We conclude that the critical performance factors 
in time and space are
\begin{itemize}
\item
Reducing the branching factor during search (space critical);
\item
Caching all of the composition table, or if that cannot be done,
using Hogge's method or hashing (a space/time tradeoff, heavily leaning
towards time);
\item
Using a fast symbolic path-consistency algorithm (time critical).
\end{itemize}


\subsection*{Acknowledgements}
This work has benefitted from continuing fruitful 
discussions with Peter van Beek,
who has independently verified many of the phenomena.
Peter also suggested experimenting
with $C =$ {\it pointisables}, and obtained the first results for this case,
some of which appear in~\cite{vBe92}. 
To him, our grateful thanks for ongoing cooperation.
 
\newcommand{\etalchar}[1]{$^{#1}$}
\begin{thebibliography}{VKvB89}

\bibitem[All83]{All83}
James~F. Allen.
\newblock Maintaining knowledge about temporal intervals.
\newblock {\em Communications of the ACM}, 26(11):832--843, November 1983.

\bibitem[Ben94]{Ben94:PropSpatReas}
B.~Bennett.
\newblock Spatial reasoning with propositional logics.
\newblock In {\em Knowledge Representation and Reasoning: Proceedings of the
  Fourth International Conference (KR94)}, pages 51--62. Morgan Kaufmann, 1994.

\bibitem[BS81]{BurSan81}
Stanley Burris and H.~P. Sankappanavar.
\newblock {\em A Course in Universal Algebra}.
\newblock Springer Verlag, 1981.

\bibitem[CKT91]{ChKaTa91}
P.~Cheeseman, R.~Kanefsky, and W.M. Taylor.
\newblock Where the really hard problems are.
\newblock In {\em Proceedings of the 12th International Joint Conference on
  Artificial Intelligence (IJCAI-91)}, pages 331--337, Sydney, Australia, 1991.
  Morgan Kaufmann.

\bibitem[CRC95]{CoRaCu95:Taxonomies}
A.~G. Cohn, D.~A. Randell, and Z.~Cui.
\newblock Taxonomies of logically defined qualitative spatial relations.
\newblock {\em International Journal of Human-Computer Studies},
  43(5-6):831--846, 1995.
\newblock Available from {\tt
  http://agora.leeds.ac.uk/spacenet/publications.html}.

\bibitem[DMP91]{DeMePe91}
Rina Dechter, Itay Meiri, and Judea Pearl.
\newblock Temporal constraint networks.
\newblock {\em Artificial Intelligence}, 49:61--95, May 1991.

\bibitem[G{\"u}s89]{Gues89}
Hans-Werner G{\"u}sgen.
\newblock {\em {CONSAT}: A System for Constraint Satisfaction}.
\newblock Morgan Kaufmann/Pitman, 1989.

\bibitem[Hog87]{Hogge87}
John~C. Hogge.
\newblock {TPLAN}: A temporal interval-based planner with novel extensions.
\newblock Technical Report UIUCDCS-R-87-1367, Univ.~of Illinois at
  Urbana-Champaign, Dept.~of Computer Science, September 1987.

\bibitem[JT52]{JonTar52}
Bjarni J\`onsson and Alfred Tarski.
\newblock Boolean algebras with operators {II}.
\newblock {\em American Journal of Mathematics}, 74:127--162, 1952.

\bibitem[KL91]{KauLad91}
Henry~A. Kautz and Peter~B. Ladkin.
\newblock Integrating metric and qualitative temporal reasoning.
\newblock In {\em Proceedings of the 9th National Conference on AI (AAAI-91)},
  pages 241--246, Anaheim, CA, 1991. AAAI Press.

\bibitem[Koo88]{Koo88}
Johannes A. G.~M. Koomen.
\newblock The {TIMELOGIC} temporal reasoning system.
\newblock Technical Report 231, University of Rochester, Dept.~of Computer
  Science, Rochester, NY, 1988.

\bibitem[Koo89]{Koo89}
Johannes A. G.~M. Koomen.
\newblock Localizing temporal constraint propagation.
\newblock In {\em Proceedings of the First International Conference on
  Principles of Knowledge Representation and Reasoning (KR89)}, pages 198--202,
  Toronto, Canada, 1989. Morgan Kaufmann.

\bibitem[Lad90]{Lad90}
Peter~B. Ladkin.
\newblock Constraint reasoning with intervals: A tutorial, survey, and
  bibliography.
\newblock Technical Report TR-90-059, International Computer Science Institute,
  Berkeley, CA, September 1990.

\bibitem[LM88]{LadMad88}
Peter~B. Ladkin and Roger~D. Maddux.
\newblock On binary constraint networks.
\newblock Technical Report KES.U.88.8, Kestrel Institute, Palo Alto, CA, 1988.
\newblock An extensively revised version appeared in \cite{LadMad94}.

\bibitem[LM94]{LadMad94}
Peter~B. Ladkin and Roger~D. Maddux.
\newblock On binary constraint problems.
\newblock {\em Journal of the ACM}, 41(3):435--469, May 1994.

\bibitem[LR92]{LadRei92}
Peter~B. Ladkin and Alexander Reinefeld.
\newblock Effective solution of qualitative interval constraint problems.
\newblock {\em Artificial Intelligence}, 57(1):105--124, September 1992.

\bibitem[LR93]{LadRei93}
Peter~B. Ladkin and Alexander Reinefeld.
\newblock A symbolic approach to interval constraint problems.
\newblock In Jacques Calmet and John Campbell, editors, {\em Artificial
  Intelligence and Symbolic Mathematical Computing}, volume 737 of {\em Lecture
  Notes in Computer Science}, pages 65--84, Karlsruhe, Germany, 1993.
  Springer--Verlag.

\bibitem[Mac77]{Mac77}
Alan~K. Mackworth.
\newblock Consistency in networks of relations.
\newblock {\em Artificial Intelligence}, 8:99--118, 1977.

\bibitem[Mac87]{Mac87}
Alan~K. Mackworth.
\newblock Constraint satisfaction.
\newblock In Stuart Shapiro, editor, {\em Encyclopedia of Artificial
  Intelligence}. Wiley Interscience, 1987.

\bibitem[Mad94]{Mad94}
Roger~D. Maddux.
\newblock Relation algebras for reasoning about time and space.
\newblock In Maurice Nivat, Charles Rattray, Teodor Rus, and Giuseppe Scollo,
  editors, {\em Algebraic Methodology and Software Technology, Enschede 1993},
  Workshops in Computing Series, pages 27--44. Springer-Verlag, 1994.

\bibitem[MF85]{MacFre85}
Alan~K. Mackworth and Eugene~C. Freuder.
\newblock The complexity of some polynomial network consistency algorithms for
  constraint satisfaction problems.
\newblock {\em Artificial Intelligence}, 25:65--74, 1985.

\bibitem[Mon74]{Mon74}
Ugo Montanari.
\newblock Networks of constraints: Fundamental properties and applications to
  picture processing.
\newblock {\em Information Sciences}, 7:95--132, 1974.

\bibitem[NB95]{NebBur95:ORD-Horn}
Bernhard Nebel and Hans-J{\"u}rgen B{\"u}rckert.
\newblock Reasoning about temporal relations: A maximal tractable subclass of
  {A}llen's {I}nterval {A}lgebra.
\newblock {\em Journal of the ACM}, 42(1):43--66, January 1995.

\bibitem[Neb96]{Neb96:HardProbs}
Bernhard Nebel.
\newblock Solving hard qualitative temporal reasoning problems: Evaluating the
  efficiency of using the ord-horn class.
\newblock {\em Constraints}, 1996.
\newblock To appear.

\bibitem[N{\"o}k91]{Noek91}
Klaus N{\"o}kel.
\newblock {\em Temporally Distributed Symptoms in Technical Diagnosis}, volume
  517 of {\em Lecture Notes in Artificial Intelligence}.
\newblock Springer--Verlag, 1991.

\bibitem[RCC92a]{RaCoCu92:CADE11}
D.~A. Randell, A.~G. Cohn, and Z.~Cui.
\newblock Computing transitivity tables: a challenge for automated theorem
  provers.
\newblock In D.~Kapur, editor, {\em CADE-11, Proceedings of the 11th Conference
  on Automated Deduction}, volume 607 of {\em Lecture Notes in Computer
  Science}, pages 786--790. Springer-Verlag, 1992.
\newblock Available from {\tt
  http://agora.leeds.ac.uk/spacenet/publications.html}.

\bibitem[RCC92b]{RaCuCo92:KR92}
D.~A. Randell, Z.~Cui, and A.~G. Cohn.
\newblock A spatial logic based on regions and connection.
\newblock In B.~Nebel, C.~Rich, and W.~Swartout, editors, {\em Proceedings of
  the 3rd International Conference on Knowledge Representation and Reasoning,
  KR'92}, pages 165--176. Morgan Kaufmann, 1992.
\newblock Available from {\tt
  http://agora.leeds.ac.uk/spacenet/publications.html}.

\bibitem[RL92]{ReiLad92}
Alexander Reinefeld and Peter~B. Ladkin.
\newblock Fast solution of large interval constraint networks.
\newblock In Janice Glasgow and Roland Hedley, editors, {\em Proceedings of the
  9th Biennial Conference of the Canadian Society for Computational Studies of
  Intelligence (AI'92)}, pages 156--162, Vancouver, Canada, May 1992. Morgan
  Kaufmann.

\bibitem[Sel95]{Sel95:IJCAI-invited}
Bart Selman.
\newblock Stochastic search and phase transitions: {AI} meets {P}hysics.
\newblock In {\em Proceedings of the 14th International Joint Conference on
  Artificial Intelligence (IJCAI-95)}, volume~1, pages 998--1002, Montr{\'e}al,
  Canada, August 1995. IJCAII.

\bibitem[SHZ{\etalchar{+}}91]{SusHen91}
Steve Susswein, Thomas~C. Henderson, Joe Zachary, Chuck Hansen, Paul Hinker,
  and Gary Marsden.
\newblock Parallel path consistency.
\newblock Technical Report UUCS-91-010, Univ.~of Utah, July 91.

\bibitem[Sus91]{Sus91}
Steven Susswein.
\newblock Parallel path consistency.
\newblock Master's thesis, University of Utah, Dept.~of Comp.~Sci., 1991.

\bibitem[vB90]{vBe90}
Peter~G. van Beek.
\newblock Reasoning about qualitative temporal information.
\newblock In {\em Proceedings of the 8th National Conference on Artificial
  Intelligence (AAAI-90)}, pages 728--734, Boston, MA, 1990. Morgan Kaufmann.

\bibitem[vB91]{vBen91}
Johan F. A.~K. van Benthem.
\newblock {\em The Logic of Time}.
\newblock D.~Reidel, second edition, 1991.

\bibitem[vB92]{vBe92}
Peter~G. van Beek.
\newblock Reasoning about qualitative temporal information.
\newblock {\em Artificial Intelligence}, 58:297--326, 1992.

\bibitem[vBC89]{vBeCoh89}
Peter~G. van Beek and Robin Cohen.
\newblock Approximation algorithms for temporal reasoning.
\newblock In {\em Proceedings of the 11th Joint Conference on Artifical
  Intelligence (IJCAI-89)}, pages 1291--1296, Detroit, MI, 1989. Morgan
  Kaufmann.
\newblock Long version appeared in \cite{vBeCoh90}.

\bibitem[vBC90]{vBeCoh90}
Peter~G. van Beek and Robin Cohen.
\newblock Exact and approximate reasoning about temporal relations.
\newblock {\em Computational Intelligence}, 6:132--144, 1990.

\bibitem[vBM96]{vBeMan96}
Peter~G. van Beek and Dennis~W. Manchak.
\newblock The design and an experimental analysis of algorithms for temporal
  reasoning.
\newblock {\em Journal of Artificial Intelligence Research}, 4:1--18, 1996.

\bibitem[VKvB89]{ViKaVB89}
Marc Vilain, Henry~A. Kautz, and Peter~G. van Beek.
\newblock Constraint propagation algorithms for temporal reasoning.
\newblock In Daniel Weld and Johan de~Kleer, editors, {\em Readings in
  Qualititative Reasoning About Physical Systems}, pages 373--381. Morgan
  Kaufmann, San Mateo, CA, 1989.

\end{thebibliography}


\end{document}

