◆ Limits
Limits and honesty
What the tool does not do, what it does not guarantee and what has not been checked yet. Each item comes from the project plan or from the code's chapters.
The limit of the thesis
A corridor is a graphical device of aggregation, not an observed route. Routing A→C through A–B–C does not say that anyone went through B. The loss can be shown:
- The figure answers “how much flow joins this region to that one” and “where the trunks are”; it does not answer “who is linked to whom”, pair by pair.
- The size of a place measures what starts or ends there, never what passes through it.
- The original pairs are kept: the interactive page (
--html) shows, for each segment, the largest pairs that run through it, and focusing on a place shows only its flows. - When a real route network exists (roads, bus lines), give it as the skeleton (
skeleton: "input"): then the figure can say “which way”. - The risk is real: on a network of influence between cities, the corridor figure looks like a road map. The legend and the text around it must say what it is.
Out of scope
- Replacing a GIS, animating particles or showing every pair.
- Diagrams without geography: they would need a layout step the library does not have.
- Projection: the core only takes planar coordinates. Longitude and latitude must be projected by the caller (the R package refuses lon/lat in
sfobjects). Coordinates below 1/1024 of the unit collapse. - Non-additive values (percentages, indices): they are refused. Convert them first, for example weighting by the population of the origin.
What is not guaranteed
Filter and skeleton
- Top-k guarantees each place its largest links, not a share of its volume; coverage per place is measured (
place_coverage_min), not imposed. No filter guarantees connectivity. - Pruning is greedy and has no approximation ratio. The gap to the optimum was measured (by enumeration and by an exact model on small and medium random instances), not bounded.
- A pair's detour is bounded only with
max_stretch, and only for design pairs. The Delaunay triangulation itself can stretch a path to more than 1.59 times the straight distance. - The number of segments is not necessarily monotone in
mu. - With a user skeleton, pairs without a path are counted as “without a path”, not drawn.
Automatic aggregation
- Both methods of
aggregateare spatial heuristics: they do not look at who exchanges flow with whom, and two neighbours with no flow between them may merge. Only near neighbours merge (Gabriel edges of the triangulation up to 4 times their median); the factor is fixed and relative to the instance: in a region of very uneven density it may isolate legitimate places or keep long edges. An isolated place (an island, a capital of another state) stays alone and does not count in K, and a warning says how many there are. ward(the default) makes compact groups of similar weight and merges early two heavy places very close to each other (Recife and Olinda); at an intermediate K the interior splits into compact pieces represented by the heaviest member of each, sometimes a minor centre (not the centre the region looks to).gravitydoes not merge large neighbours (Recife, Olinda and Paulista stay apart to the end) while the light interior becomes a few large groups, and it draws a small place into its large neighbour even when its flows go elsewhere (a centre of another state may represent places of the region). With both, groups are contiguous along near edges; the neighbourhood graph is the initial one contracted after each merge, not a new one of the representatives. There are no zoom levels: another K is another run.
Classes and drawing
- The breaks of the width classes depend on the figure's data (with
aggregate, only on the segments between places that are not isolated; those reaching the isolated ones fall in the first or the last class); two figures are comparable only with the same legend, and there is no option yet to fix the breaks. Classes hide differences within a class; the legend may show a class with no segment. - Labels: in dense areas, minor places go without a label (the omission is counted in the honesty line). Text width is estimated with Helvetica's metrics; wider fonts can make neighbouring labels touch.
- The fixed texts of the figures (SVG and TikZ) and of the interactive page exist in Portuguese, English, Spanish and French (
style.lang); the summary printed by the command line, in Portuguese only. - With
frame_on_boundary, what lies outside the view is not drawn: the place goes (and is counted in the honesty line, “N places off the map”) and the segment towards it goes on a little past the boundary and fades out (exits: also dashed or an arrow). The end says “leaves this way”, not where to; labels do not avoid the boundary. - The two-direction mode (
directions: "split") is still too wide in a dense centre. - Sparse filters (dominant flow, a small share) with
represent: "all"route every pair through a tree and inflate the trunks with long detours; userepresent: "design"(Filters). With any filter but top-k and a largest detour above 4, the spec warns inmeta.warnings; the warning does not change the figure. - Junctions (nodes with no origin or destination, drawn as a dot and never labelled) only appear with the user's skeleton (
skeleton: "input"): they are the nodes of the given network where no flow starts or ends. With Delaunay every node is a place the user listed. A flowless node off the drawn network stays a place.
Lines by category
- A line is a category's share of the corridor's load, not an observed route nor a transit line: each pair's path is the same for every category.
- The order of the lines minimizes crossings by a heuristic, with no guarantee of optimality; the number of crossings left is reported (
line_crossings). Only on small instances was the exact optimum checked. - With many categories, or a segment with many lines, the figure gets wide; beyond
max_categoriesthe smallest become “other”. Lines do not combine withsplitnor withrails.
TikZ
- The TikZ figure is written from the same scene as the SVG and draws the same (lines, rails, two directions, themes, palettes, corners, square places, ends at the edge,
lang), except the tooltips and hooks of the interactive page. What it cannot honour becomes a% Note:line and a warning, never dropped in silence (details). - Labels are placed with the width estimated from Helvetica, not from the document's font: the Latin Modern Sans of the
standalonedocument is narrower (labels come out a little smaller than the room kept for them); a font wider than Helvetica can make neighbouring labels touch. Scaling withscaleor\resizeboxdoes not scale the text. The core does not produce PDF; the command line built with--features pdfwrites PDF directly with--pdf(below). - Direct PDF (
--pdf): only in the command line built with--features pdf(not in the default binary, the WASM or the Python and R packages). The figure is laid out again with the widths of the Go font, the one the PDF embeds, so the labels fit their halos; the PDF can therefore differ from the.svgnext to it (where a label goes, the legend rows, the page height). The text comes out as text in the Go font, not in the SVG's Helvetica nor in the document's font; for the LaTeX document's font, use--tikz. The PDF's bytes may change between versions of the converter.
Schematic layout
- It is a heuristic optimum, not the minimum cost; a valid layout may exist and not be found. Then the geographic figure stands and the reason is recorded; a layout with a silent violation never comes out.
- A node of degree above 8 makes it infeasible. Unpruned skeletons (the whole Delaunay triangulation) often fail rule H6.
- Widths and labels are not part of the computation; a path may pass one step from an unrelated node. The relative position of two non-adjacent nodes may change. The boundary is not deformed (it is left out of the schematic figure).
- Contracting the degree-2 chains trades bends inside segments for bends at the places: fewer kinks, but on some data a slightly higher mean bend at the nodes (measured). The places of a chain keep their order along it, not their distance to unrelated nodes.
- On large, sparse networks with far destinations the result can be ugly (long U-shaped detours).
What has not been checked yet
- Reproducibility across platforms. The promise is: the same input gives the same bytes everywhere. The matrix that checks it exists: the SHA-256 of the output, spec, SVG, schematic spec and schematic SVG of every reference case is kept in
crates/milk/tests/bindings/checksums.sha256, checked by the native test (tests/reproducibility.rs), by the WebAssembly Node suite and by the Python package's pytest; the CI workflow (.github/workflows/ci.yml) runs it on Linux x86-64 and ARM64, macOS ARM64, Windows x86-64 and wasm32 (and Python on Linux, macOS and Windows), and checks that the code compiles on the minimum Rust (1.85). Verified on these platforms for version 0.1.0, with the same bytes on all of them; the R package gave the native bytes on the reference cases on macOS ARM64 only. Other platforms (macOS x86-64, Windows ARM64, Linux musl) have not been verified. - The interactive page was checked in Chromium; not in Firefox or Safari, with a real pinch gesture or with a screen reader.
- Reading tests with people (a script of questions with known answers, including traps about relations that do not exist) have not been done yet.
Not implemented yet
Planned and absent from the code: zoom levels for the automatic aggregation (one cut per run, no dendrogram); flow trees for one centre; the exact schematic layout by integer programming. Net flow was examined and left out: replacing two directions by their difference changes values (it is not a mask over the pairs) and would break the accounting. Implemented since the plan: the disparity, dominant-flow, share (the plan's coverage) and threshold filters, the lines-by-category mode, the TikZ output, the direct PDF of the command line, the GeoJSON output of the drawn figure (shown over MapLibre in the gallery), junctions with the user's skeleton, aggregation by levels, automatic spatial aggregation (aggregate) and the contraction of degree-2 chains in the schematic layout.
API status
Version 0.1.0, experimental: the API and the drawing contract (FlowSpec, version 0.1) may change before 1.0. The FlowSpec will be declared stable only after the interactive layer has exercised what it still lacks.
How to cite
Cite the version you used:
milkflow 0.1.0 (2026). Simplified flow maps in the style of a metro map. Software, MIT OR Apache-2.0 license. https://github.com/StrategicProjects/milkflow.
@software{milkflow,
title = {milkflow: simplified flow maps in the style of a metro map},
version = {0.1.0},
year = {2026},
url = {https://github.com/StrategicProjects/milkflow},
license = {MIT OR Apache-2.0}
}
Methods it builds on
- H. Bast, P. Brosi, S. Storandt. Metro maps on octilinear grid graphs. Computer Graphics Forum 39(3), 2020, 357–367.
- M. Nöllenburg, A. Wolff. A mixed-integer program for drawing high-quality metro maps. Graph Drawing 2005, LNCS 3843, 2006, 321–333.
- E. R. Gansner, Y. Hu. Efficient, proximity-preserving node overlap removal. Journal of Graph Algorithms and Applications 14(1), 2010, 53–74.
- E. W. Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik 1, 1959, 269–271.
- B. Delaunay. Sur la sphère vide, 1934 (triangulation by the crate
delaunator). - Magnanti, Wong. Network design and transportation planning. Transportation Science 18, 1984 (the exact model the pruning is a heuristic for).
- Xia, Zhang. Toward the tight bound of the stretch factor of Delaunay triangulations. CCCG 2011.