Data Trajectory Similarity Metric (DTSM)
- DTSM is a family of similarity metrics that decompose trajectory comparisons into spatial, temporal, and state components, enabling applications like clustering, anomaly detection, and retrieval.
- Handcrafted formulations use weighted spatiotemporal scores and alignment-based methods, while geometric, statistical, and landmark-based approaches offer invariant properties and scalability.
- Learning-based DTSMs map trajectories to embedding spaces to approximate traditional measures with improved computational efficiency, though they involve trade-offs in fidelity and non-metric behavior.
Searching arXiv for the cited works and recent usage of “Data Trajectory Similarity Metric (DTSM)”. Data Trajectory Similarity Metric (DTSM) denotes, in the cited literature, a similarity or distance function defined on trajectories, subtrajectories, or sets of trajectories, with formulations ranging from hand-designed spatiotemporal scores to learned embedding-space distances. The term is used both as a general design lens—decomposing similarity into state, space, and time components—and as a concrete mechanism inside graph-based subtrajectory retrieval systems. Across the literature, DTSMs operate on symbolic cellular patterns, GPS point sequences, multivariate time series, road-network-constrained paths, and trajectory sets; they may return a normalized dissimilarity in , a kernel-induced RKHS distance, a Euclidean distance between learned embeddings, or a max-over-subsegments similarity score (Duong et al., 2012, Li et al., 2024, Ge et al., 7 Jul 2025, Wang et al., 2023).
1. Conceptual scope and trajectory representations
A useful synthesis is that a DTSM is always tied to a representation choice. The survey literature organizes trajectory measures along three axes—Non-learning vs. Learning, Free Space vs. Road Network, and Standalone vs. Distributed—and uses this taxonomy to frame trajectory similarity as a core functionality for similarity search, clustering, anomaly detection, and representation learning (Hu et al., 2023). This suggests that DTSM is not a single canonical formula, but a family of constructions whose semantics depend on what counts as a trajectory, how time is encoded, and whether similarity is measured directly or through an embedding.
| Regime | Trajectory/object form | Example source |
|---|---|---|
| Symbolic cellular mobility | (Duong et al., 2012) | |
| GPS point sequence | (Li et al., 2024) | |
| Multivariate time series | (Urain et al., 2019) | |
| Set of trajectories | (Bento et al., 2016) | |
| Subtrajectory query object | (Ge et al., 7 Jul 2025) |
In symbolic cellular settings, space is not Euclidean but a set of cell identifiers, and time is a predefined timestamp scale; similarity is therefore driven by overlap of visited cells and timestamp agreement at common cells rather than by coordinate geometry (Duong et al., 2012). In GPS settings, a trajectory is commonly a time-ordered sequence of sampled coordinates, later discretized into grid cells, POI cells, or graph nodes if a learning model requires tokenization or network structure (Li et al., 2024). In statistical formulations, a trajectory may be treated as a multivariate time series or even as a sample from an underlying distribution, which shifts the problem from point alignment to correlation structure or kernel mean embedding (Urain et al., 2019, Wang et al., 2023).
A plausible implication is that any encyclopedic account of DTSM must distinguish at least five objects of comparison: whole trajectories, subtrajectories, trajectories constrained by a road graph, sets of trajectories with births and deaths, and trajectory embeddings learned from unlabeled or supervised data. The rest of the literature can be read as a sequence of increasingly specialized answers to that representational question.
2. Spatiotemporal factorization and alignment-based scoring
One of the clearest hand-designed DTSM templates is the weighted spatiotemporal measure for cellular mobility patterns. There, a mobility pattern is , the spatial component is a normalized count of uncommon cells,
and the temporal component averages normalized timestamp discrepancies over common cells,
The total dissimilarity is a convex combination
with 0 (Duong et al., 2012). This formulation is reflexive, symmetric, and bounded in 1, but it is explicitly described as a symmetric dissimilarity rather than a strict metric because triangle inequality is not guaranteed.
A second classical construction approaches DTSM as an explicit monotone alignment problem between sampled trajectories. Given sampled trajectories 2 and 3, an assignment
4
allows matched points and gaps, with monotonicity constraints preventing backtracking. The global similarity score is
5
where matched pairs are rewarded by inverse squared distance and gaps are penalized through a start penalty 6 and extension term 7 (1303.05012). This model is designed to align similar portions under different sampling rates, to introduce gaps for truly dissimilar regions or missing data, and to support both global similarity and local best-subtrajectory similarity. Its dynamic program runs in 8 time.
These two constructions expose a recurrent DTSM pattern. First, define what can match—same cell, nearby point, projected segment, or aligned event. Second, score positive evidence and negative evidence separately. Third, normalize or weight the result according to the application. This suggests why later DTSMs keep reappearing in “state component + time component”, “match reward + gap penalty”, or “local similarity + global pruning” form.
3. Geometric, statistical, and landmark-based formulations
A different line of work defines DTSM through invariance or geometry rather than explicit point alignment. The Generalized Multiple Correlation Coefficient (GMCC) treats a trajectory as a multivariate time series, 9, and measures how well one trajectory can linearly predict the other. Its core similarity is
0
and the symmetric distance used in experiments is
1
GMCC is designed to be invariant to all nonsingular linear transformations—rotations, scalings, reflections, shear mappings, and squeeze mappings—while remaining selective against nonlinear relationships; it is robust to moderate noise, but it requires equal length and temporal alignment and does not handle time warping or shifting (Urain et al., 2019).
Landmark-based DTSMs take yet another route: map each trajectory to a Euclidean vector indexed by a fixed landmark set 2. For a polygonal trajectory 3, define
4
This yields two simple distances: 5 and
6
Weighted versions 7 and 8 make it possible to emphasize specific landmarks, such as a discriminative point of interest (Phillips et al., 2018). Under explicit geometric conditions—9-separated vertices inside a bounded region and a sufficiently dense grid of landmarks—both 0 and 1 are metrics on the corresponding family of curves.
A more statistical DTSM dispenses with point-to-point comparison altogether. In the distributional approach, a valid trajectory 2 is regarded as an i.i.d. sample set from an underlying distribution 3, and the empirical kernel mean embedding is
4
Trajectory similarity becomes the distributional kernel
5
and the induced distance is 6 (Wang et al., 2023). With a characteristic kernel, the representation is injective at the distribution level, yielding the uniqueness property. The paper emphasizes two distinctive features: the method does not rely on point-to-point distances, and it requires no learning. With the Isolation Kernel, it also has a data-dependent property: two distributions are more similar to each other when measured in a sparse region than in a dense region.
Taken together, these constructions show that DTSM can encode three quite different inductive biases: linear-transform invariance, proximity to salient landmarks, or equality of underlying distributions. This suggests that “trajectory similarity” is often less about choosing a single distance formula than about choosing which invariances and which nuisance factors should be collapsed.
4. Learned embedding-based DTSMs
In the learning-based literature, DTSM usually means an encoder 7 or 8 that maps each trajectory to a vector, after which similarity is computed by a simple vector-space distance. A general formulation is
9
with the learned distance in embedding space acting as the trajectory similarity metric (Chang et al., 2024). This shift is motivated by the high computational cost of conventional measures such as DTW, EDR, Hausdorff, and Fréchet, which are typically 0 in trajectory length (Li et al., 2024).
Several supervised DTSMs learn embeddings that approximate a chosen handcrafted measure. ConvTraj encodes raw GPS trajectories using a 1D convolution branch for sequential local patterns and a 2D convolution branch for geo-distribution, then uses Euclidean distance in the learned space as dissimilarity,
1
with training driven by a triplet loss and an MSE term against a target measure such as DFD, DTW, Hausdorff, EDR, or EDwP (Chang et al., 2024). ST2Vec performs an analogous role for road-network-constrained trajectories: it defines a target spatio-temporal distance
2
learns spatial embeddings with Node2Vec plus GCN and temporal embeddings with Time2Vec-like encoding plus LSTM and attention, and uses Euclidean distance between final embeddings as a metric-like DTSM (Fang et al., 2021). VeTraSS instead builds a multi-scale graph whose nodes are whole trajectories and whose edge weights derive from normalized Fréchet or Hausdorff distances; its GNN learns trajectory embeddings so that Euclidean distances reproduce the teacher geometry encoded in the trajectory graph (Cheng et al., 2024).
More recent learned DTSMs focus on improving the learning signal itself. T-JEPA defines a self-supervised DTSM by learning a representation function 3 through Joint-Embedding Predictive Architecture; similarity is then computed as a distance between learned embeddings, without negative samples and without hand-crafted trajectory augmentations (Li et al., 2024). TSMini learns
4
and combines a weighted MSE loss with a k nearest neighbor-guided LambdaLoss-style objective so that the model preserves not only absolute similarity values but also top-5 neighborhood structure induced by the teacher measure (Chang et al., 1 Feb 2025).
A particularly important refinement concerns the geometry of the embedding space itself. The LH-plugin work argues that many widely used trajectory distances violate triangle inequality and that forcing them into Euclidean embeddings can distort similarity. It therefore introduces a Lorentz distance
6
in hyperbolic space and a dynamic fusion distance
7
where 8 is pair-dependent (Si et al., 15 Apr 2025). Here the deliberate absence of triangle inequality is not a defect but a design response to non-metric ground-truth trajectory relations.
5. Set-level and subtrajectory-centric DTSMs
Some DTSMs operate on objects larger or smaller than a single whole trajectory. For sets of trajectories, the key issue is identity continuity across time. One formulation extends two sets 9 and 0 with placeholder trajectories marked by 1, defines per-time cost matrices 2, and then solves a global optimization over time-varying soft associations 3, the set of doubly stochastic matrices: 4 This “natural computable distance” is a true metric when the matrix norm is a switching norm and the base state distance is a metric; with the 5-norm, it can be computed by linear programming in polynomial time (Bento et al., 2016). It explicitly incorporates confusion of trajectories’ identity, different cardinalities, occlusions, births, and deaths.
At the opposite granularity, subtrajectory retrieval requires a similarity defined by the best local alignment between two trajectories. GTRSS introduces a concrete DTSM for that purpose. For two trajectories 6 and 7, the trajectory-level similarity is
8
where 9 is a dynamic-programming score over all subtrajectory pairs, and point pairs are marked similar or dissimilar through a binary matrix
0
The score is designed to favor subtrajectory pairs with many corresponding point pairs and few non-corresponding point pairs (Ge et al., 7 Jul 2025). A key pruning theorem states that if the starting pair is dissimilar, then the similarity of any subtrajectory pair starting there cannot exceed the similarity of the pair starting one step later; this enables aggressive pruning during dynamic programming.
Inside GTRSS, DTSM is not the final user-facing query score. Instead, it is used offline to build a dual-layer graph index. In the upper layer, representative trajectories selected per spatial grid cell are connected by high, medium, and low DTSM similarity to balance local cohesion and global coverage. In the lower layer, each trajectory links to a mixture of spatially close high-DTSM neighbors and random neighbors. This suggests a distinctive role for DTSM: not only as a scoring function, but as an indexing signal that predicts which trajectories are likely to share high-quality representative subtrajectories under a later exact or approximate subtrajectory measure (Ge et al., 7 Jul 2025).
6. Recurrent properties, evaluation criteria, and limitations
A central theme across the literature is that “trajectory similarity” does not imply a single stance on metricity. Some DTSMs are explicit metrics under stated conditions, such as landmark distances on suitable curve families and the computable set-of-trajectories distance based on soft associations (Phillips et al., 2018, Bento et al., 2016). Others are reflexive and symmetric but not guaranteed to satisfy triangle inequality, such as the weighted cellular dissimilarity and the temporal component based on common-cell timestamps (Duong et al., 2012). GMCC is not symmetric in its base form and becomes a distance only after symmetrization (Urain et al., 2019). Learned Lorentzian and fusion distances are intentionally non-metric because the teacher trajectory distances they seek to emulate often violate triangle inequality (Si et al., 15 Apr 2025).
Evaluation criteria therefore vary with the formulation. Handcrafted measures are usually assessed by effectiveness, robustness, efficiency, and scalability; the survey literature explicitly proposes an evaluation benchmark with five real-world transformation scenarios to study these four dimensions across representative measures (Hu et al., 2023). Learned DTSMs are typically judged by ranking fidelity—HR@k, R10@50, NDCG, mean rank—or by their ability to approximate teacher measures such as EDR, LCSS, Hausdorff, Fréchet, TP, DITA, LCRS, and NetERP (Li et al., 2024, Fang et al., 2021, Chang et al., 2024, Chang et al., 1 Feb 2025). Subtrajectory-centric systems add retrieval accuracy and graph-navigation efficiency, while set-level metrics emphasize mathematically consistent handling of identity switches, false alarms, and missed tracks (Bento et al., 2016, Ge et al., 7 Jul 2025).
The literature also converges on a stable list of limitations. Many classical measures are 1 and difficult to scale; this is the main reason for embedding-based DTSMs (Li et al., 2024). Symbolic or set-based formulations may ignore order or frequency; GMCC does not handle time warping; landmark methods depend on landmark placement; distributional kernels treat a trajectory as an i.i.d. sample set unless time is embedded as a feature; and learned embeddings may inherit the biases of their teacher measures or fail under strong domain shift (Duong et al., 2012, Urain et al., 2019, Phillips et al., 2018, Wang et al., 2023). The recent hyperbolic work adds a further caution: insisting on Euclidean geometry can be structurally wrong when the underlying trajectory similarity relation is non-metric (Si et al., 15 Apr 2025).
A plausible synthesis is that DTSM should be understood as a design space with three persistent trade-offs: exactness versus efficiency, metric consistency versus fidelity to non-metric trajectory relations, and hand-designed interpretability versus learned adaptability. The cited literature does not collapse these trade-offs into a single best formulation; instead, it provides a repertoire of mathematically distinct answers tailored to symbolic mobility, continuous free space, road networks, set-level tracking, and top-2 subtrajectory retrieval.