Change log
What had changed...Running times quoted in the notes of v3.3.0 and earlier were moved to docs/archive/old_running_times.md, the archive of old running times: they come from one-off measurements that the benchmark script does not reproduce. The current, reproducible comparisons are in Reproducing the benchmarks. An entry marked "old running times: see the archive" had its numbers moved there.
v3.4.1 Release Notes
Fixed:
frechet_c_decide_exacton prepared curves (DecideCurve) with trees of two kinds (oneSausageTree, one box tree) threw aMethodErrorin the box search; such a pair now skips the test of free boxes, which needs two sausage trees, and gives the same answers.- Tests of the fallback of the box search: the recursion limit, curves in ℝ^64 (sausage trees), curves in a Hilbert space, and the exact distance where the search gives up (equal, bit for bit, to
method = :tables); the tests pass on Julia 1.10. - Benchmark scripts: a frog run that fails other than by the timeout is recorded as
FAILED <status>, notTIMEOUT, andfd_exact.jlreportsTOOBIGonly for the size check; the documentation check matches whole paths; the C++ port notes that it has no work budget. - Comments: the order of the two greedy walks.
v3.4.0 Release Notes
Needs BasicCompGeometry 0.7.1.
Fixed:
- The box search of
frechet_c_decide_exactcould take time quadratic in the length of a curve, and overflow the stack: a zigzag of 8001 vertices against a curve of 12 took 27 ms for 6001 vertices (the plain sweep: 0.46 ms) and overflowed at 8001. A search now gives up to the plain sweep once its work (the sides of the boxes it visits) exceeds 16 times the cells, or its recursion 1,000 splits (SEARCH_WORK,SEARCH_DEPTH), so the worst case is O(n m d); on the zigzag it takes 4.9 ms at 8001 vertices. No search gives up on the 897,000 queries of the benchmark of Bringmann, Künnemann and Nusser or on the pairs of Conradi et al. (the largest uses under half the budget, the deepest recursion 859 splits); the results are the same, bit for bit, and so is the speed. - Documentation: the steps of the greedy walks grow by half after a success (not double); a box that must give the exits of one side only is split parallel to that side; the box search agrees with the plain sweep up to the rounding of the free intervals.
Added:
- Curves in a Hilbert space known only through squared distances, such as the feature space of a kernel:
frechet_c_decide_exact,frechet_c_compute_bisectandfrechet_c_compute_exacttake curves of virtual points of a BasicCompGeometryHilbertSpace(vcurve(S, indices); the space caches every squared distance it computes). The decision usesSausageTree, whose tests need only distances; the free intervals come from the squared distances (the law of cosines, and Kahan's formula for the distance to a line, with a lower bound for segments much shorter than the distances to them). The exact distance on virtual curves is the smallestFloat64the decision procedure accepts, by bisection (critical values would need positions on short segments, which squared distances do not give accurately). Results agree with the same computations on coordinates up to rounding (on random curves: bisection at rtol 1e-14 within 8.4e-15 relative, the exact distance within 1.8e-15; on curves with near-duplicate vertices, within about the length of the shortest segment). New manual page "Curves in Hilbert spaces", with an action recognition experiment on the 2391 KTH videos (example_higher/prepare_kth_all.rb,kth_classify.jl,hilbert_timing.jl,hilbert_accuracy.jl). - Manual pages "Deciding, and the distance by bisection" and "The exact distance", with the benchmarks.
- The decider against the C++ decider of Bringmann, Künnemann and Nusser, in
examples/benchmarks/cpp_compare/fd_cpp/(not part of the package):frechet_c_decide_exactported to C++ line by line and built into one program with theirs, with the same flags; whole-pass timing; Porto taxi trips and Mopsi routes, with queries whose answers are known, and the pairs of the benchmark of Conradi, van der Hoog and Rotenberg; the raw results of three machines (x86-64 and ARM64) and the scripts that make the tables and figures. - The gallery of examples is on GitHub Pages, linked from the README and the manual.
examples/webpage/generate_examples.jlwrites it tooutput/gallery/, with an index page; its morphings are animated in the browser byexamples/webpage/player.jsfrom small data files, instead of movies, and the refinement steps are PNG frames instead of a GIF. The pages have no PDF files, and ffmpeg, HandBrake, ImageMagick and pdf2svg are no longer needed. Every example gives the exact distance and the times offrechet_c_compute_exactandfrechet_c_compute; on example 35, wherefrechet_c_computetakes many minutes, only the exact distance is computed.examples/webpage/deploy_gallery.rbpublishes it.
Changed:
- Requires BasicCompGeometry 0.7.1 (
HilbertSpace,VPoint). - Documentation:
frechet_c_computeis described as the older algorithm (its docstring wrongly called it exact); the README, the manual and its docstring recommendfrechet_c_compute_exactorfrechet_c_compute_bisectinstead, and point to an example where its performance is catastrophically bad (example 35 of the gallery: about 16 minutes and 10 GB, against under a millisecond for the exact algorithm). The function is unchanged. examples/datasets/download_data.jl, the old downloader (disabled: its Geolife converter renumbered the trajectories), and the BKN download script it ran are removed from the repository.ruby examples/benchmarks/reproduce.rb setup webpagemakes the data it made for the web page examples (data/birds, the white storks, anddata/characters);pigeons_splice.jlis nowmovebank_splice.jland splits both Movebank CSVs.frechet_c_decide_exactis faster (same answers): the box search of the free space takes the ranges of edges it needs, scans the sides of a box in phases, walks flat runs at once, and tests a point against a curve by the ends first. On the 13 sets of the comparison above it is 1.2 to 2.5 times as fast as the C++ decider of Bringmann, Künnemann and Nusser on 8, about as fast on 4, and slower on the tiny curves of Berlin. The leaves of the box search, swept cell by cell, have up to 64 cells (SWEEP_CELLS); with 6, OV of the frog benchmark took 1.8 times longer.ruby examples/benchmarks/reproduce.rbbuilds the C++ codes it compares with (the code of Bringmann et al., CGAL, the frog code) with-O3 -march=native -fno-math-errno(CGAL and the frog code also-ffp-contract=off), the flags of the Julia comparison, instead of their default builds (BKN's is about 5 times slower); the tables of the manual are from these builds.- Documentation: the query distances of the benchmark of Bringmann et al. are
d(1 ± 2^l), notd(1 ± 10^l). - Curves of points with coordinates: the same results, bit for bit, and the same speed (the 1510 pairs of the frog benchmark, bisection and exact; 80 pairs of video curves in ℝ^1200 and ℝ^19200).
v3.3.0 Release Notes
(November 28, 2026)
Added:
frechet_c_compute_bisect(P, Q; rtol = 1e-10, atol = 0): the continuous Fréchet distance to withinmax(atol, rtol d) / 2, by bisection withfrechet_c_decide_exacton prepared curves. The first decision is at the distance of the end points plus the tolerance, which settles the many pairs whose distance is that of their end points (old running times: see the archive).frechet_c_compute_exact(P, Q; method = :auto):method = :tablesmakes every decision of the search on the tables, by the plain cell-by-cell sweep, as before.frechet_c_decide_exact(P, Q, r; tree): the description of the curve pieces in the free-space search,LazyBoxTree,BoxTreeor the newSausageTree(a segment thickened to contain the piece: its tests need only distances between points, so it does not grow with the dimension). The default isSausageTreefrom dimension 64 on.DecideCurve(P, Tree; width = false)skips the width pass.
Changed (same results, bit for bit):
frechet_c_compute_exact: for long curves in low dimension, a bisection with the fast decision procedure narrows the search to an interval of relative width 1e-10, whose critical values are computed from the coordinates, segment by segment, with the kinetic sweep only on segments where a point can enter, leave, or change order. By default the fast decision procedure then searches them, in O(n + m) memory, without the tables; when one of its checks fails, the tables are computed as before (old running times: see the archive). The memory check no longer refuses curves whose tables fit (it charged the random sample, now drawn only when the bisection does not settle the search).frechet_c_decide_exact: in the box search of the free space, a box whose top and right edges are each free in one interval has its exits decided from its boundary (the pruning rules of Bringmann et al.), with runs of segments certainly empty or certainly free skipped by arc length (old running times: see the archive).
v3.2.0 Release Notes
(November 27, 2026)
Added:
frechet_c_compute_exact(P, Q): the exact continuous Fréchet distance, by the randomized search over the critical values of Alt and Godau from Har-Peled and Raichel, "The Fréchet distance revisited and extended" (Section 6): a random sample of critical values narrows the search to an interval, whose critical values a kinetic sweep lists (a balanced search tree, DataStructures'SortedSet, holds the order: O(log n) per event). Slow: O(n m d) once to tabulate the distances between vertices and segments (multithreaded, with the same result for any number of threads), then O(n m) per decision (O(log n) of them); no tolerance. The result does not depend on the random sample.frechet_c_decide_exact(P, Q, r): exact decision procedure for the continuous Fréchet distance (is d_F(P, Q) <= r?), the free-space reachability test of Alt and Godau (1995), in O(n m d) time and O(m) memory, with no tolerance. Static andVectorpoints.- Documentation: High-dimensional curves: comparison with Fred, on real curves in ℝ^963, ℝ^6000 and ℝ^19200 (
example_higher/exact_curves.jlcomputes the exact distances and the errors of the other methods against them).
Changed (same results, bit for bit):
SweepDist_lb_compute: each segment-segment distance is computed once instead of up to four times (old running times: see the archive).frechet_d_r_compute: no second distance computation per cell (old running times: see the archive).SweepDist_compute,Morphing_monotonize: fewer copies of points (25% less memory forVectorpoints).frechet_width_approxand the simplifiers onVectorpoints: the nearest point on the spine is created only when it moves forward, into one buffer (no allocation per vertex) (old running times: see the archive).example_higher/:FRECHET_TOLalso sets the tolerance offred_curves.py; results at a tolerance other than 1e-9 go to files with it in their names.
v3.1.0 Release Notes
(November 26, 2026)
Added:
- Curves with
Vectorpoints of run-time length (GPntSeq{AnyDim,Float64,Vector{Float64}}, BasicCompGeometry 0.7): every algorithm runs on them (the polygon hierarchy,ph_init, takes static points only), compiling once for every dimension (old running times: see the archive). Matrix curves (MatVecPntSeq) and mixed point types are converted on entry. Results agree with static points up to rounding.
Changed:
Morphing{N,T,PT},EventPoint{N,T,PT}and the search contexts take the point type as a third parameter;Morphing2FisMorphing{2,Float64,Point2F}. Code usingMorphing{N,T}still dispatches, but a field or array declaredMorphing{2,Float64}is now abstractly typed.- Static curves: same results bit for bit, same speed and compile time.
- Requires BasicCompGeometry 0.7 and DataStructures 0.19 (was 0.5.1/0.6 and 0.18); the priority queues use the 0.19 calls (
push!,popfirst!,first) instead of the deprecatedenqueue!,dequeue!andpeek. Same results bit for bit.
v3.0.1 Release Notes
(November 22, 2026)
Fixed (results change, see docs/review-2026-11.md):
Morphing_combineon long curves: breakpoints on the middle curve were merged when within a relative 1e-6 of their arc-length position, 2 units at position 1e6, giving leashes up to 159 times too large.fp_equalnow uses 1e-12 (M15). (frechet_c_computealso combines morphings; its results were correct in the cases tested.)Polygon_simplify_extno longer ends with a zero-length edge when the last vertex was already kept (M14);frechet_c_approxkeeps its leash and bounds, its morphings lose one event pair.Morphing_from_prmandMorphing_combinegive each repeated vertex its own event (M13); before, all but the last copy had none, and their radius was 0.morphing_profile:Xruns to the distance both points travel,|P| + |Q|of the morphing, matching the times it samples (before: to|P|) (M16).Morphing_as_polygons_w_times,Morphing_sample_uniformly,morphing_profileandMorphing_as_function_w_times: steps where nothing moves (orPdoes not move) take no time; they got made-up durations before, which shifted the samples.frechet_c_computewithf_accept_approxaccepts within a factor1 + tolerance, not a fixed 1.00001 that ignored a smallertolerance; same results with the default tolerance.DTW_d_compute: same price, bit for bit; between couplings of equal price it can return another one, anditersis now the number of cells.frechet_width_approx,frechet_width_exceeds,frechet_offsets,frechet_paletteandfrechet_c_mono_approx_subcurvereject NaN or infinite vertices with anArgumentError; they returned NaN,falseor a meaningless leash.
Faster (same results):
DTW_d_computeby dynamic programming (old running times: see the archive).SweepDist_compute: less allocation (old running times: see the archive).FEVER_compute(_range): the event arrays are no longer filled on every call (old running times: see the archive).
Documentation:
- Every export has a docstring and is in the manual (new pages: Simplification, Sweep distance, Low level); the docs build fails on a missing one; the site has a
stablelink again. - Docstrings and comments: typos and wording;
Morphing_combinereturnsv(u(.));Morphing_monotonizemay return its input.
Other:
- One search loop each for VE and FEVER (
ve_search!,fever_search!). - The docs build uses Documenter 1.20 (was pinned at 1.4.1 by a stale
docs/Manifest.tomlthat also held an absolute path to the package). - The example shell scripts keep temporary files under
${TMPDIR:-/tmp}/$USER/FrechetDist/.
v3.0.0 Release Notes
(November 22, 2026)
Breaking:
SweepDist_compute_splitandfrechet_mono_via_refinement_extare renamedSweepDist_compute_split!andfrechet_mono_via_refinement_ext!, and take theoutvector first:SweepDist_compute_split!(out, P, Q, iters, max_vertices),frechet_mono_via_refinement_ext!(out, P, Q, f_snapshots, approx).- Only
Float64curves are accepted; other element types raiseArgumentErrorat the entry point (before, aMethodErrororInexactErrorfrom inside). - CSV, DataFrames, Hwloc, PrettyTables, TimerOutputs, CpuId, CPUSummary and Printf are no longer dependencies; the examples declare their own in
examples/Project.toml.
Fixed (results change, see docs/review-2026-11.md):
- Sweep price of segments (
SweepDist_segs_p,Morphing_SweepDist_price): closed form without absolute thresholds; it was wrong at large or small coordinate scales. fp_dist_point_segment: no cancellation at the far endpoint; only rounding noise snaps to zero, so the range functions no longer return an upper bound below the distance.SweepDist_lb_computeno longer reports a lower bound above a known morphing.frechet_c_approxandfrechet_c_computereport a certifiedlower_boundandratio = leash / lower_bound;frechet_c_computeno longer fails on curves far apart relative to their length.DTW_d_compute,SweepDist_computeandSweepDist_lb_computereturn their objective insol_value.- Crashes on repeated event times, constant curves, 1-vertex curves and identical segments; argument validation throws
ArgumentErrorinstead of asserting.
Other:
- Widths, bounds and times accept any real number (for example an
Intwidth). - Faster:
fp_dist_segment_segmentno longer allocates (old running times: see the archive), concrete queue types, linear width scans in the simplifiers. frechet_c_computerestructured (named tuning constants, helper functions); same results.- Uses BasicCompGeometry for points, curves,
norm,geom_lengthandprefix_lengths. - Follows the Julia standards: the lifecycle tools in
tools/, explicit imports, one standalone module per test file, Aqua in the test suite, formatting withalways_for_in = true.
v2.2.2 Release Notes
- Repository hygiene, no behaviour change: stopped tracking scratch output,
*.jl.*.memallocation files and large datasets (now in.gitignore); addedAGENTS.md; removed a stale GPS regression test and its fixtures.
v2.2.1 Release Notes
- Internal cleanups, no behaviour change: removed dead debug code, reduced argument counts, added
test/snapshots/(bit-for-bit comparison against a git revision) andtools/release scripts.
v2.2.0 Release Notes
- Input contract: public entry points validate their curves and parameters and throw
ArgumentError; library code no longer callsexit()or prints. - Fixed endpoint snapping that distorted long edges and near-identical curves (leashes change by at most ~1e-16 relative).
- Fixed
SweepDistfor crossing configurations, and the penalty handling of the*_extfunctions. - The zero-distance clamp is relative to the input scale; coordinates above 1e150 are rejected.
- Internal:
frechet.jlandmorphing.jlwere split into topic files (frechet_refine.jl,frechet_c.jl,frechet_simplify.jl,morphing_prm.jl).
V2.0.0 Release Notes
(June 18, 2024)
- Added sweep-distance (continuous/discrete)
- Major performance improvements/bug fixes due to massive testing.
- Added
examples/prereq.jlto install needed packages. - Added
examples/download_data.jlto download test data. - Fixed github documentation generation.
- Added some documentation.
v1.0.0 Release Notes
Initial release, included most of the algorithms and basic codes, was added as an official Julia package.