Back

frechet.xyz

More applied than theory…


The Fréchet Distance

Similarity between curves

Started with [@ag-cfdbt-95]

  • Quadratic time / complicated (use parametric search)
  • Large amount of work on extensions, implementation, etc.

Frogs taking a walk

The Discrete Fréchet Distance


The problem

with the Fréchet Distance

The problem II

with the Fréchet Distance


This work


The Fréchet distance via free space diagram


Fréchet distance: Free space diagram II


The Fréchet morphing in this case


First idea: Make moves locally


The problem: Bottleneck shortest path

  • Directed graph
  • Edges have height
  • Compute path from source to target minimize max edge.
    • Min max weight edge.
  • Quadratic time since DAG.


The resulting morphing

Vertex-Edge Fréchet (new¿)

  • Easy to compute.

  • Not necessarily monotone!

  • But almost monotone!

  • Bottleneck shortest path

    For general graphs

    • \(O(n \log n + m)\) Dijkstra

    • \(O(m \log^* m)\)

      [@gt-atbop-88]


Bottleneck shortest path

Undirected graphs


Retractable Fréchet

Always keep leash as short as possible

\(G\): Directed graph with weights on edges

Definition: Retractable path is the bottleneck shortest path, recursively retractable when removing the bottleneck.


Retractable definition by example


Retractable Fréchet \(\implies\) better morphing


Computing Retractable Path


Claim: \(\forall \cA, \cB\) : \(\,\,\) \(\distFr{\cA}{\cB} \geq \distVEFr{\cA}{\cB}\).


Non-monotonicity…


Non-monotonicity…

Brute force monotonization…

Optimal Fréchet \(\in[\distVEFrC. \mathrm{mono}(\distVEFrC)]\).


Reduce non-monotonicity by inserting vertices


Reduce non-monotonicity by inserting vertices II


Reduce non-monotonicity by inserting vertices a few iterations later


Exact \(\distFrC\) distance…

No such thing as exact algorithms


The result…


Approx Fréchet: segment


Comp Fréchet distance segment \(\Leftrightarrow\) curve



Lemma

\(3\)-approx. \(O(n)\) time for Fréchet dist between curve and segment.


Simplification: Approx


Greedy Fréchet simplification

  • greedy simplification.

[@ahkww-fdcr-06]

  • High quality “slow”.

  • Idea: Pick vertices greedy fashion…


Approximation via simplification


Simplification: Exact


Simplification to make speed great again


Morphing sensitive simplification I


Morphing sensitive simplification II


Morphing sensitive simplification III


Morphing sensitive simplification IV


Shticks and tricks

and questions

Arising from the implementation


Low quality simplification, but fast

Task: Preprocess \(\cA\) (\(10,000\)s of vertices).

Query: Given \(\delta > 0\) output curve \(\cB\) s.t. \(\distFr{\cA}{\cB} \leq \delta\).

Running time: \(O( |V(\cB)|)\).


Output sensitive simplification…

Given \(\alpha\): Extract all vertices label \(>\alpha\).

Running time: Output sensitive.


Simplifications hierarchy/caching


Implementations


Julia (Programming language)


ACM SIGSPATIAL Cup 2017

The Fréchet distance is defined as the minimal length of a leash connecting a dog on one trajectory with its owner on a second trajectory, both never moving backwards. For this challenge, the “true” Fréchet distance shall be used, though teams are free to exploit the existing approximations including the Discrete Fréchet distance as they wish. The challenge for this year consists of finding and combining spatiotemporal indexing schemes with efficient algorithms for Range Queries in very large databases of trajectories…


C++

[@bkn-wdfpa-21]: C++ implementation.

Implementation

Julia+Python package.

Experiments

[@bkn-wdfpa-21]: C++ implementation.


Inputs


Julia results


Python results


Future research


Future research

Bibliography