AI Glossary / Mathematics and optimization / Intermediate
Interval algebra
Definition
Interval algebra, in temporal reasoning, is a formal system for describing and combining relationships between time intervals. Allen's interval algebra uses thirteen basic relations, including before, meets, overlaps, during, starts, finishes, and equals, together with the appropriate inverse relations. It helps an AI system reason about event order even when exact dates or durations are unavailable.
What it means
An event often occupies a span of time rather than a single instant. Editing a document, attending a meeting, and running a training job all have starts and ends. Knowing that one event occurred during another conveys more than saying that their start times have a particular order.
The algebra represents these qualitative relationships explicitly. If the evidence is incomplete, a relationship can be represented as a set of possibilities rather than an invented timestamp. This entry uses the temporal meaning of interval algebra, following the source list's language-processing context. It is distinct from numerical interval arithmetic for calculating bounds on uncertain quantities.
How it works
Represent each nondegenerate interval by a start and an end, with start strictly earlier than end. Comparing two intervals' endpoints determines exactly one of the thirteen basic relations. For example, A meets B when A ends exactly where B begins; A is before B when A ends strictly earlier.
Reasoning combines known relationships through relation composition and removes incompatible possibilities. If A is before B and B is before C, then A is before C. Some combinations imply several possible relations rather than a unique answer. The algebra supplies constraints; an application must still determine which events and relationships are supported by its evidence.
Three practical examples
- A document-analysis system can represent whether a reported inspection preceded, overlapped, or occurred during a repair.
- A scheduling assistant can distinguish back-to-back tasks from tasks requiring a positive time gap.
- A video annotation tool can compare the temporal spans of actions without reducing each action to a single frame timestamp.
Think of it this way
Think of placing strips of paper along a timeline. Two strips can touch, partly overlap, share a start, or sit one inside the other. The analogy is limited because a reasoning system can retain several possible placements simultaneously, and the relationships alone do not determine exact lengths or calendar dates.
Worked example
Consider an original schedule expressed in minutes after 09:00. Let A=(0,30), B=(30,50), and C=(40,70). A meets B because A's end equals B's start. B overlaps C because 30<40<50<70. A is before C because 30<40.
Now let D=(5,25). D is during A: both its endpoints lie strictly inside A's endpoints. Let E=(0,20). E starts A because they share the same start and E ends earlier. Let F=(10,30). F finishes A because it starts later but shares A's end. These are three distinct relations, even though casual language might call all three events inside A.
For an uncertain case, suppose X overlaps Y and Y overlaps Z, without exact timestamps. Set X=(0,4) and Y=(2,7). Choosing Z=(5,9) makes X before Z. Choosing Z=(4,9) makes X meet Z. Choosing Z=(3,9) makes X overlap Z. All three choices preserve Y overlapping Z. Therefore two overlapping links do not justify asserting that the first and third intervals overlap.
Finally, take A before B and B before C. Adding C before A is inconsistent: the endpoint inequalities would force a strict cycle in time. That conclusion follows from the ordering constraints, not from a guess about event duration.
The endpoint pairs here describe temporal spans, not an instruction to use open rather than closed sets in software. The defining endpoint equalities and inequalities determine the named relations.
Illustrative case study
In a fictional example, Birch Archive extracts timelines from project reports. One sentence says testing overlapped review; another says review overlapped training. The first prototype concludes that testing overlapped training.
An analyst constructs the alternative endpoint examples shown above and demonstrates that the conclusion is unsupported. The revised system records several possible relationships until additional evidence narrows them. This invented case illustrates preserving temporal uncertainty; it does not claim a measured improvement in extraction accuracy or a completed timeline for a real project.
Common misconceptions and mistakes
Do not use the everyday word overlaps as if it always meant Allen's specific overlaps relation. In ordinary speech, overlap can include containment or equal intervals. The basic relation overlaps has a particular endpoint order, and its inverse describes the reverse ordering.
Meets is different from before: one has equal adjoining endpoints, while the other has a strict gap. During also excludes shared endpoints in the basic relation; starts and finishes handle those cases separately.
Qualitative relations do not provide a duration or a numerical delay. Nor does a locally successful constraint-propagation pass automatically establish every desired global conclusion in an arbitrary network. A system must distinguish sound deductions, unresolved possibilities, and any stronger consistency guarantee its solver actually provides.
Business use
Interval algebra can make event-based applications more explainable. Instead of presenting a fabricated exact schedule, a system can show that an event definitely occurred before another, or that several arrangements remain possible. This supports document review, workflow analysis, and temporal search.
For business use, define the time interpretation and treatment of ambiguous language. Recorded timestamps may involve rounding, time zones, or uncertain boundaries, so exact endpoint equality can be stronger than the available evidence supports. An AI extraction pipeline should retain source evidence alongside the relation and distinguish a stated relationship from one inferred through other constraints.
People also ask
Does the algebra require exact timestamps?
No. It can reason from qualitative relationships alone.
Are instantaneous events included in the basic thirteen-relation model?
The standard treatment assumes intervals of positive duration; handling points requires an explicit extension or modeling choice.
Is before symmetric?
No. If A is before B, B is after A. Equals is its own inverse, while the other basic relations occur in inverse pairs.
Check your understanding
If A overlaps B and B overlaps C, must A overlap C?
Answer: No. The worked examples show that A may be before, meet, or overlap C while both given overlaps relations remain true.
Related terms
- Allen relations
- Constraint propagation
- Event extraction
- temporal reasoning
- relation composition
- temporal interval
- timeline
- interval arithmetic
Learn next
Draw one example of each basic relation and reverse the interval names to identify its inverse. Then start with an uncertain relationship set and add endpoint evidence one fact at a time, recording which possibilities can be removed without inventing extra information.
More in Mathematics and optimization
- Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
- Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
- Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
- Σ-algebra
- Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
- Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.
Sources
Sources: Jurafsky and Martin, original Speech and Language Processing chapter on Time and Temporal Reasoning: https://web.stanford.edu/~jurafsky/slp3/old_jan23/22.pdf . Original research: James F. Allen, Maintaining Knowledge about Temporal Intervals: https://cse.unl.edu/~choueiry/Documents/Allen-CACM1983.pdf . The chapter was read; the original paper's indexed relation-table excerpt was consulted, but direct retrieval failed. All endpoint examples above are original.
Previous: Intersection over union Next: Interval estimate