RCC-8 is a formal system used to describe relationships between regions in space, emphasizing regions over points for spatial reasoning.
Fundamental Concepts
Connection (C): The primary relationship in RCC-8, where the arguments are regions.
Derived Relations:
Part-of (P): Indicates one region is part of another.
Overlap (O): Indicates regions overlap.
Basic Relations in RCC-8
RCC-8 defines eight fundamental relations between two regions:
DC (Disconnected): Regions are separate.
EC (Externally Connected): Regions touch but do not overlap.
PO (Partially Overlapping): Regions partially overlap.
EQ (Equal): Regions are identical.
PP (Proper Part): One region is a proper part of another.
TPP (Tangential Proper Part): One region is a proper part and touches tangentially.
TPPI (Tangential Proper Part Inverse): The inverse of TPP.
NTPP (Non-Tangential Proper Part): One region is a proper part and does not touch.
NTPPI (Non-Tangential Proper Part Inverse): The inverse of NTPP.
Characteristics
RCC-8 is a generalization of Allen’s interval algebra, focusing on spatial rather than temporal reasoning.
In closed disks, RCC-8 relations are exhaustive and well-defined, meaning two regions can only be in one relation at a time.
RCC-8 does not handle directional information but can model concepts like “in,” “out,” and “adjacent.”
Variants
RCC-5: Combines some RCC-8 relations for simpler applications, similar to Euler diagrams.
RCC-7: Used when spatial regions cannot partially overlap.
Applications
RCC-8 is widely used in AI and robotics for qualitative spatial reasoning.
🐍 Figure — The eight RCC-8 relations
import micropipawait micropip.install("matplotlib")import matplotlib.pyplot as pltimport matplotlib.patches as patches# Each entry: relation key -> (title line, meaning, list of region patches).# Regions are drawn as circles/ellipses positioned to illustrate the topology.# A region is described as (cx, cy, rx, ry, colour, label).RED = "#e74c3c"BLUE = "#3498db"def circ(cx, cy, r, colour, label): return (cx, cy, r, r, colour, label)# x = region A (red), y = region B (blue)relations = [ ("DC", "Disconnected — regions are separate", [circ(0.30, 0.5, 0.20, RED, "x"), circ(0.72, 0.5, 0.20, BLUE, "y")]), ("EC", "Externally Connected — touch, no overlap", [circ(0.30, 0.5, 0.20, RED, "x"), circ(0.70, 0.5, 0.20, BLUE, "y")]), ("PO", "Partially Overlapping — share a part", [circ(0.40, 0.5, 0.24, RED, "x"), circ(0.60, 0.5, 0.24, BLUE, "y")]), ("TPP", "Tangential Proper Part — x in y, touching", [(0.50, 0.5, 0.45, 0.40, BLUE, "y"), circ(0.77, 0.5, 0.18, RED, "x")]), ("TPPi", "x contains y, touching (inverse of TPP)", [(0.50, 0.5, 0.45, 0.40, RED, "x"), circ(0.77, 0.5, 0.18, BLUE, "y")]), ("NTPP", "Non-Tangential Proper Part — x deep in y", [(0.50, 0.5, 0.45, 0.40, BLUE, "y"), circ(0.50, 0.5, 0.16, RED, "x")]), ("NTPPi", "x strictly contains y (inverse of NTPP)", [(0.50, 0.5, 0.45, 0.40, RED, "x"), circ(0.50, 0.5, 0.16, BLUE, "y")]), ("EQ", "Equal — x and y are the same region", [(0.50, 0.5, 0.30, 0.30, RED, "x"), (0.50, 0.5, 0.30, 0.30, BLUE, "y")]),]fig, axes = plt.subplots(2, 4, figsize=(13, 6.5))for ax, (rel, meaning, regions) in zip(axes.ravel(), relations): for i, (cx, cy, rx, ry, colour, label) in enumerate(regions): # EQ: draw both outlines (second dashed) so the coincidence is visible e = patches.Ellipse((cx, cy), 2 * rx, 2 * ry, facecolor="none" if rel == "EQ" else colour, edgecolor=colour, lw=2.5, linestyle="--" if (rel == "EQ" and i == 1) else "-") ax.add_patch(e) # label placement: big container near its top, inner near centre if rx >= 0.40 and rel != "EQ": lx, ly = cx, cy + ry - 0.10 elif rel == "EQ": lx, ly = (cx - 0.10 if i == 0 else cx + 0.10), cy else: lx, ly = cx, cy ax.text(lx, ly, label, ha="center", va="center", fontsize=13, fontweight="bold", color="white" if (rx < 0.40 and rel != "EQ") else colour) ax.set_xlim(0, 1); ax.set_ylim(0, 1) ax.set_aspect("equal") ax.set_xticks([]); ax.set_yticks([]) ax.set_title(f"{rel}\n{meaning}", fontsize=9.5) for spine in ax.spines.values(): spine.set_edgecolor("#cccccc")plt.suptitle("RCC-8 — the eight jointly exhaustive, pairwise disjoint region relations", fontsize=13, fontweight="bold")plt.tight_layout(rect=[0, 0, 1, 0.95])plt.show()
What this shows. One panel per RCC-8 relation, each drawing two regions x (red) and y (blue) placed to make the topology literal: DC keeps them apart, EC lets their boundaries just touch, PO lets them share a proper part, and the four part-of cases (TPP, TPPi, NTPP, NTPPi) nest one region inside the other — tangential when the inner region touches the outer boundary, non-tangential when it sits strictly inside — while EQ draws them coincident. These relations are built up in the lecture from the single primitive C(x,y) (connection) via the derived P (part-of) and O (overlap) predicates, and in the space of closed discs they are jointly exhaustive and pairwise disjoint: two regions stand in exactly one of them. RCC-8 is the spatial counterpart of Allen’s Tense Logic and is reasoned over with the same composition-table machinery as Constraint Satisfaction Problems; it connects to Description Logics as a qualitative formalism for representing space in AI.