◆ Filters
Filters
The filter chooses the design pairs: those that design the skeleton of corridors. It changes no value, it only says yes or no to each pair, and so the accounting always closes. With represent: "all" (the default) the other pairs are still routed through the corridors the filter chose.
Ties are always broken by the same total order: larger value, then smaller origin, then smaller destination. JSON option filter; on the command line, --filter with --k, --alpha, --share, --n or --min. k only applies to top_k: a k other than the default next to another filter is refused, not ignored.
filter | rule | when to use it |
|---|---|---|
{"kind": "top_k", "k": 3}the default; k absent: the options' k | The k largest pairs leaving each place or arriving at it (the union). k = 0: all. | Nearly always: it gives every place, however small, its largest links. |
{"kind": "dominant"} | Nystuen and Dacey (1961): each place's largest outflow, when it goes to a place that receives more. The places with no dominant flow are the terminals, the centres of the nodal regions. | Hierarchy: who depends on whom. Use with represent: "design". |
{"kind": "disparity", "alpha": 0.05} | Serrano, Boguñá and Vespignani (2009), directed: the pair stays when it is significant, at level alpha, for its origin or its destination, against the hypothesis that a place's strength is split at random among its links. | Networks with very unequal strengths, where a cut by value would wipe out the small places. Significance is not relevance: a pair can be significant and small. |
{"kind": "share", "share": 0.8} | The largest pairs, largest first, until they cover the share share of the volume between places. | When the question is “the flows that make up 80%”. |
{"kind": "largest", "n": 50} | The n largest pairs. | A fixed budget of pairs. |
{"kind": "threshold", "min": 100} | The pairs with a value of at least min. | A cut with a meaning of its own (for example, “more than 100 trips a day”). |
The same data under four filters
The links of the REGIC 2018 survey (IBGE) that start in the municipalities of Pernambuco (regic_pe.json, the same as in the gallery), framed on the state outline: 214 places and 1,092 pairs. Every pair is routed in every figure (the volume in corridors is the same, 100%); the filter only decides the skeleton. Design pairs: top-k 759, dominant 181, disparity 134, 80% share 299.
top_k, k = 3 (default): 759 design pairs244 segments · mean detour 1.11, max. 8.17 · 100% of the volume in corridors{"style": {"frame_on_boundary": true, "max_labels": 40, "lang": "en"}}
milkflow regic_pe.json --title "" --frame boundary --labels 40 --lang endominant: 181 design pairs222 segments · mean detour 1.43, max. 45.91 · 100% of the volume in corridors{"filter": {"kind": "dominant"}, "style": {"frame_on_boundary": true, "max_labels": 40, "lang": "en"}}
milkflow regic_pe.json --title "" --filter dominant --frame boundary --labels 40 --lang endisparity, alpha = 0.05: 134 design pairs223 segments · mean detour 1.56, max. 34.56 · 100% of the volume in corridors{"filter": {"kind": "disparity", "alpha": 0.05}, "style": {"frame_on_boundary": true, "max_labels": 40, "lang": "en"}}
milkflow regic_pe.json --title "" --filter disparity --alpha 0.05 --frame boundary --labels 40 --lang enshare = 0.8: 299 design pairs238 segments · mean detour 1.15, max. 19.02 · 100% of the volume in corridors{"filter": {"kind": "share", "share": 0.8}, "style": {"frame_on_boundary": true, "max_labels": 40, "lang": "en"}}
milkflow regic_pe.json --title "" --filter share --share 0.8 --frame boundary --labels 40 --lang enA sparse filter with represent: "all". The dominant flow gives each place at most one design pair: the skeleton is nearly a tree (here 222 segments for 214 places). With represent: "all", all 1,092 pairs are then routed through that skeleton, and those that did not design it take long detours: mean detour 1.43 and largest 45.9, against 1.11 and 8.2 with top-k. The loads of the trunks are inflated by pairs that would not, in reality, go that way. With a sparse filter, use represent: "design": only the design pairs are drawn, the others are counted as filtered in the honesty line. When the largest detour is above 4 with a filter other than top-k and represent: "all", the spec itself warns, in meta.warnings: filter `dominant` with represent `all`: the largest stretch is 45.9 (mean 1.43), above 4; the pairs outside the design take long detours on a skeleton they did not shape; represent `design` draws only the design pairs
.
The urban hierarchy: the dominant flow, design pairs only
With the dominant flow and represent: "design", each municipality draws only its main link to a larger place, and what shows is the network of dependence: 181 dominant flows on 199 segments, with a largest detour of 1.98. The 33 places without a dominant flow are the tops of the hierarchy (those outside the state are among them because the data has no links leaving them); the largest, by arrivals: Recife, Caruaru, Petrolina, Juazeiro do Norte/CE, Juazeiro/BA, Jaboatão dos Guararapes, Salvador/BA, João Pessoa/PB, Paulo Afonso/BA, Maceió/AL, Campina Grande/PB, São Paulo/SP, …
dominant and represent: "all", above.199 segments · mean detour 1.04, max. 1.98 · 53% of the volume in corridors{"filter": {"kind": "dominant"}, "represent": "design", "style": {"frame_on_boundary": true, "max_labels": 40, "lang": "en"}}
milkflow regic_pe.json --title "" --filter dominant --represent design --frame boundary --labels 40 --lang enPlaces outside the state fall outside the frame (frame_on_boundary) and the segments towards them leave through the edge. 47% of the volume (the links that are not each place's main one) is left out of the figure and declared so in the honesty line. Source: IBGE, REGIC 2018; percentages converted into person-equivalents by the population of the origin (IBGE 2022).
What no filter guarantees
- Connectivity, coverage per place or a number of segments: coverage is measured afterwards (
place_coverage_min), not imposed. - Dominance ignores distance and internal flow: a place whose largest flow goes to a larger, distant place is attached to it.
- In the disparity filter,
alphais a knob, not a test level with a correction for multiple comparisons; the p-value of a place with very many links can reach 0. - There is no net flow. Replacing each couple of opposite pairs by their difference changes values, it is not a mask: it would need a fifth term in the accounting (the cancelled volume) and has no defined category in the lines mode. It was examined and left out.