Skip to main content

High-performance Discrete Fréchet Distance implementation for trajectory analysis.

Project description

VINCULUM-F

[VECTURE ENGINEERING SOLUTION] [CLASSIFICATION: OMNICRON-1] [STATUS: OPERATIONAL]

VINCULUM-F is a high-performance computational engine designed for the precise analysis of trajectory divergence. It implements advanced geometric algorithms to calculate the convergence leash between multidimensional paths, optimized for high-throughput environments through LLVM-based JIT compilation.

1. OBJECTIVE

The primary objective of VINCULUM-F is to quantify the similarity between two polygonal chains (trajectories) in $d$-dimensional space. Unlike simple Euclidean distance metrics between point clouds, VINCULUM-F accounts for the ordering, direction, and temporal continuity of the paths.

2. SCIENTIFIC BACKGROUND

2.1 Discrete Fréchet Distance

The Fréchet distance is a measure of similarity between curves that takes into account the location and ordering of the points along the curves. It is often described via the "Dog and Leash" metaphor: a person walks along one curve and a dog walks along the other. Both can vary their speeds, but neither can move backwards. The Fréchet distance is the length of the shortest leash sufficient for both to traverse their respective paths from start to finish.

In the Discrete variant implemented here, we consider only the vertices of the polygonal chains, which simplifies the continuous problem into a combinatorial optimization task over a coupling sequence.

2.2 Dynamic Time Warping (DTW)

DTW is an algorithm for measuring similarity between two temporal sequences which may vary in speed. It finds an optimal alignment between the sequences by "warping" the time axis to minimize the cumulative distance between matched points.

3. MATHEMATICAL FOUNDATIONS

3.1 Discrete Fréchet Recurrence

Given two trajectories $P = (p_1, \dots, p_n)$ and $Q = (q_1, \dots, q_m)$, the Discrete Fréchet Distance $d_{dF}(P, Q)$ is computed using the following dynamic programming recurrence:

$$L(i, j) = \max \left( d(p_i, q_j), \min(L(i-1, j), L(i, j-1), L(i-1, j-1)) \right)$$

Where:

  • $d(p_i, q_j)$ is the Euclidean distance between points.
  • $L(1, 1) = d(p_1, q_1)$.
  • $L(i, j) = \infty$ for $i < 1$ or $j < 1$.

3.2 Dynamic Time Warping Recurrence

The cumulative DTW distance $D(P, Q)$ is defined as:

$$D(i, j) = d(p_i, q_j) + \min(D(i-1, j), D(i, j-1), D(i-1, j-1))$$

Where:

  • $D(1, 1) = d(p_1, q_1)$.
  • $D(i, j) = \infty$ for $i < 1$ or $j < 1$.

4. ARCHITECTURE & IMPLEMENTATION

4.1 Computational Acceleration

The core algorithms are implemented using Numba, an LLVM-based Just-In-Time (JIT) compiler. This allows Python-level logic to execute at near-native C/C++ speeds by compiling mathematical bottlenecks into machine code at runtime.

4.2 Space Complexity Optimization: $O(\min(n, m))$

Traditional DP implementations require an $O(nm)$ matrix to store intermediate states. VINCULUM-F employs a rolling-vector optimization. By observing that the state at $(i, j)$ only depends on the previous row and the immediate previous element of the current row, we reduce the spatial requirement from $O(nm)$ to $O(\min(n, m))$.

4.3 Memory Efficiency

  • Contiguous Layouts: Inputs are automatically coerced into C-contiguous float64 arrays to maximize CPU cache hit rates.
  • Allocation Minimization: The Euclidean distance calculation is unrolled into an explicit loop to prevent the creation of intermediate temporary arrays during JIT execution.

5. INSTALLATION

pip install numpy numba
pip install .

6. OPERATIONAL USAGE

6.1 Discrete Fréchet Distance

import numpy as np
from vinculum_f import frechet_distance

# Define trajectories as (N, D) arrays
path_a = np.array([[0,0], [1,1], [2,0]], dtype=np.float64)
path_b = np.array([[0,1], [1,2], [2,1]], dtype=np.float64)

leash_length = frechet_distance(path_a, path_b)

6.2 Dynamic Time Warping

from vinculum_f import dynamic_time_warping

warping_cost = dynamic_time_warping(path_a, path_b)

7. TECHNICAL SPECIFICATIONS

  • Temporal Complexity: $O(nm)$
  • Spatial Complexity: $O(\min(n, m))$
  • Precision: 64-bit Floating Point (IEEE 754)
  • Engine: Numba-Accelerated LLVM JIT

Optimal output achieved. Remain compliant.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vinculum_f-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vinculum_f-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file vinculum_f-0.1.0.tar.gz.

File metadata

  • Download URL: vinculum_f-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vinculum_f-0.1.0.tar.gz
Algorithm Hash digest
SHA256 11d35d059af12eb1aa4f03e370322eb2a2db08df2839ea35b69f3b004830f556
MD5 0535090cf0d9b1ded00a4c913cb0c6ec
BLAKE2b-256 e4f65f40429126e58def26ebe538ceb26a95a97018de23b671ba1e361a90fe93

See more details on using hashes here.

Provenance

The following attestation bundles were made for vinculum_f-0.1.0.tar.gz:

Publisher: workflow.yml on VectureLaboratories/vinculum-f

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vinculum_f-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vinculum_f-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vinculum_f-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7fede89e46aad089f9027813284e0265f096f3e491206f977a6a4ec887bab08
MD5 ec213018f29021289b2eeaa75cc07ebe
BLAKE2b-256 7aabcfd177bcc362577ecbb8656310b0aec066ca93f3edc09fad32db4a247d9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vinculum_f-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on VectureLaboratories/vinculum-f

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page