@mark1russell7/highways 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +43 -2
  2. package/build/index.d.ts +1472 -63
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js +10007 -3406
  5. package/build/index.js.map +1 -1
  6. package/package.json +11 -2
  7. package/src/bench/exact/index.ts +72 -11
  8. package/src/bench/exact/optima-exact-v1-bounds.json +14409 -0
  9. package/src/bench/exact/optima-exact-v1.json +4809 -0
  10. package/src/bench/exact/solve.ts +129 -0
  11. package/src/bench/screen/activation.ts +3 -0
  12. package/src/bench/screen/bounds.ts +140 -0
  13. package/src/bench/screen/compare.ts +26 -0
  14. package/src/bench/screen/exact-set.ts +100 -0
  15. package/src/bench/screen/exercise.ts +290 -0
  16. package/src/bench/screen/forms.ts +14 -0
  17. package/src/bench/screen/gap.ts +316 -0
  18. package/src/bench/screen/hash.ts +7 -76
  19. package/src/bench/screen/index.ts +6 -0
  20. package/src/bench/screen/measures.ts +71 -1
  21. package/src/bench/screen/portfolio-pick.ts +20 -0
  22. package/src/bench/screen/screen.ts +50 -2
  23. package/src/bench/screen/set.ts +3 -2
  24. package/src/highways/areas/index.ts +160 -0
  25. package/src/highways/confluent/index.ts +154 -0
  26. package/src/highways/confluent/k23.test-util.ts +8 -0
  27. package/src/highways/consensus/index.ts +129 -0
  28. package/src/highways/crossbars/index.ts +184 -0
  29. package/src/highways/cubu/index.ts +26 -0
  30. package/src/highways/divided/index.ts +111 -0
  31. package/src/highways/fdeb/index.ts +193 -0
  32. package/src/highways/frechet/index.ts +232 -0
  33. package/src/highways/hierarchy/index.ts +140 -0
  34. package/src/highways/index.ts +64 -0
  35. package/src/highways/kdeeb/index.ts +355 -0
  36. package/src/highways/link-communities/index.ts +189 -0
  37. package/src/highways/mesh/index.ts +209 -0
  38. package/src/highways/mlseb/index.ts +204 -0
  39. package/src/highways/p-hub/index.ts +248 -0
  40. package/src/highways/power/index.ts +117 -0
  41. package/src/highways/resistance/index.ts +159 -0
  42. package/src/highways/sbeb/index.ts +303 -0
  43. package/src/highways/scale-space/index.ts +135 -0
  44. package/src/highways/spectral/index.ts +391 -0
  45. package/src/highways/territories/index.ts +150 -0
  46. package/src/highways/trace.ts +153 -0
  47. package/src/index.ts +1 -0
  48. package/src/portfolio/bands.ts +33 -0
  49. package/src/portfolio/fit.ts +29 -0
  50. package/src/portfolio/index.ts +6 -0
  51. package/src/portfolio/key.ts +98 -0
  52. package/src/portfolio/members.ts +171 -0
  53. package/src/portfolio/router.ts +133 -0
  54. package/src/portfolio/sets.ts +28 -0
  55. package/src/strategies/builtins.ts +222 -1
  56. package/src/strategies/schemas.ts +280 -1
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ExerciseEvidence, HashOptions, MeasureSpec, Member, MemberStatus, MemberTrace, OutputGroup, PickSpec, Portfolio, PortfolioKey, PortfolioLevel, PortfolioOptions, PortfolioPick, PortfolioTrace, RECORD_EPS, SelectCandidate, SelectLevel, Selection, Verdict, canonicalJson, compareMeasure, exercised, minEffectOf, outputGroups, outputHash, pickMoves, portfolio, selectBest, sha256Hex } from "@mark1russell7/layout-contract";
1
2
  /** A point in the plane. */
2
3
  export interface Point {
3
4
  readonly x: number;
@@ -3645,6 +3646,925 @@ export declare function candidateArcs(input: HighwayInput, generators: readonly
3645
3646
  * Each edge rides the arc that saves the most for it.
3646
3647
  */
3647
3648
  export declare function hubArcPlan(input: HighwayInput, o: Readonly<HubArcOptions>): HighwayPlan;
3649
+ /**
3650
+ * The plan that a post step changes. `none` is the empty plan: `follow` then routes each edge as the router `corners` does.
3651
+ * `shared-ways` and `corridors` are the plans of those highway strategies, with their defaults.
3652
+ */
3653
+ type HighwayBase = "none" | "shared-ways" | "corridors";
3654
+ /** The values of `HighwayBase`. */
3655
+ export declare const HIGHWAY_BASES: readonly HighwayBase[];
3656
+ /** This function gives the plan of a base. */
3657
+ export declare function basePlan(input: HighwayInput, base: HighwayBase): HighwayPlan;
3658
+ /** The side of the road that the traffic keeps to. */
3659
+ type TrafficRule = "right" | "left";
3660
+ /** The values of `TrafficRule`. */
3661
+ export declare const TRAFFIC_RULES: readonly TrafficRule[];
3662
+ /** The options of the highway strategy `divided` (HWY-011 of the notes). */
3663
+ interface DividedOptions extends Pick<WayOptions, "margin" | "k"> {
3664
+ /** The plan that the strategy divides. The default is `shared-ways`. */
3665
+ readonly from: HighwayBase;
3666
+ /** The side of the road of the traffic. With `right`, the edges of each direction keep to the right of the spine. The default is `right`. */
3667
+ readonly rule: TrafficRule;
3668
+ /** The gap between the two carriageways, in lanes. The default is 1. */
3669
+ readonly gap: number;
3670
+ /** The width of one lane, in units of the board. The default is 4. */
3671
+ readonly laneWidth: number;
3672
+ /** A highway divides only when each direction has this number of edges or more. The default is 2. */
3673
+ readonly minSize: number;
3674
+ }
3675
+ /** The default options of the strategy `divided`. */
3676
+ export declare const DIVIDED_DEFAULTS: Readonly<Required<Omit<DividedOptions, "margin" | "k">>>;
3677
+ /**
3678
+ * This function gives the polyline at the distance `offset` from `line`, with the same number of points. A positive offset is on the right of the line.
3679
+ * The y axis points down, so the right of the direction `(dx, dy)` is `(-dy, dx)`. Each inner point moves along the bisector of its two legs (a miter join).
3680
+ */
3681
+ export declare function offsetLine(line: readonly Point[], offset: number): Point[];
3682
+ /**
3683
+ * This function divides one highway into two carriageways, one for each direction (HWY-011, divided edge bundling of Selassie, Heller and Heer 2011).
3684
+ * Each carriageway is a copy of the spine at an offset to the side of its traffic. The offset is half the lanes of that side plus half the gap.
3685
+ * When an offset spine is not clear of the boxes, the function tries one half and one quarter of the offset. It gives `undefined` when none fits.
3686
+ */
3687
+ export declare function divideHighway(h: Highway, finder: WayFinder, o: Readonly<Omit<DividedOptions, "from" | "margin" | "k">>): Highway[] | undefined;
3688
+ /**
3689
+ * This function gives the highways of the plan `from`, with each highway of two-way traffic divided into two carriageways (HWY-011).
3690
+ * The edges of each direction get their own spine on the side of the rule `rule`. Thus the two directions do not cross in the lanes.
3691
+ * A highway with fewer than `minSize` edges in one direction, or without the room for the offsets, stays as it is.
3692
+ */
3693
+ export declare function dividedPlan(input: HighwayInput, o: Readonly<DividedOptions>): HighwayPlan;
3694
+ /** The trees of sections that the strategy `hierarchy` can use. */
3695
+ type HierarchyGroups = "quadtree" | "kd" | "cut";
3696
+ /** The values of `HierarchyGroups`. */
3697
+ export declare const HIERARCHY_GROUPS: readonly HierarchyGroups[];
3698
+ /** The options of the highway strategy `hierarchy` (HWY-001 of the notes). */
3699
+ interface HierarchyOptions extends Pick<WayOptions, "margin" | "k"> {
3700
+ /** The tree of sections. The default is `quadtree`. */
3701
+ readonly group: HierarchyGroups;
3702
+ /** A section with more nodes splits. The default is 8. */
3703
+ readonly cap: number;
3704
+ /** The pull of the hubs, from 0 to 1 (Holten 2006). The value 0 gives the straight line, and 1 goes through each hub. The default is 0.85. */
3705
+ readonly beta: number;
3706
+ /** The largest number of hubs on each side of the lowest common section. `Infinity` uses all of them. The default is `Infinity`. */
3707
+ readonly hubs: number;
3708
+ /** The side of the grid that the hubs snap to, in units of the board. The default is 8. */
3709
+ readonly snap: number;
3710
+ /** A highway has this number of edges or more. The default is 2. */
3711
+ readonly minSize: number;
3712
+ }
3713
+ /** The default options of the strategy `hierarchy`. */
3714
+ export declare const HIERARCHY_DEFAULTS: Readonly<Required<Omit<HierarchyOptions, "margin" | "k">>>;
3715
+ /**
3716
+ * This function gives the control points of one edge. They are the sections from the leaf of the source up to the lowest common section, then down to the target leaf.
3717
+ * The lowest common section is not in the chain (Holten 2006), so the edges do not all meet at the hub of the root.
3718
+ * `hubs` limits the sections on each side. The sections nearest to the common section stay.
3719
+ */
3720
+ export declare function controlChain(from: readonly Section[], to: readonly Section[], hubs: number): Section[];
3721
+ /**
3722
+ * This function gives the highways of the hierarchical edge bundling (HWY-001, Holten 2006).
3723
+ * The tree of sections gives a hub to each section. Each edge goes near the hubs of the sections between its two leaves.
3724
+ * The waypoint of a hub is `beta hub + (1 - beta) p`, with `p` the point of the straight line at the same share of the chain.
3725
+ * The waypoints snap to a grid of side `snap`, and the ways go through the corner graph. The stretches that `minSize` ways share become highways.
3726
+ */
3727
+ export declare function hierarchyPlan(input: HighwayInput, o: Readonly<HierarchyOptions>): HighwayPlan;
3728
+ /** The options of the highway strategy `fdeb` (HWY-002 with RULE-002 of the notes). */
3729
+ interface FdebOptions extends Pick<WayOptions, "margin" | "k"> {
3730
+ /** Two edges attract each other when their compatibility is this value or more. The default is 0.6. */
3731
+ readonly compatibility: number;
3732
+ /** The spring constant that keeps each edge smooth. The default is 0.1. */
3733
+ readonly spring: number;
3734
+ /** The number of cycles. Each cycle doubles the points of each edge and halves the step. The default is 5. */
3735
+ readonly cycles: number;
3736
+ /** The number of steps of the first cycle. Each later cycle has two thirds of the steps of the cycle before it. The default is 50. */
3737
+ readonly iterations: number;
3738
+ /** The weight of the push of the boxes (RULE-002). The value 0 turns it off. The default is 1. */
3739
+ readonly repulsion: number;
3740
+ /**
3741
+ * The stretch budget of each edge (RULE-002). An edge whose polyline is longer than this value times its straight line gets no pull.
3742
+ * `Infinity` sets no budget. The default is 1.25.
3743
+ */
3744
+ readonly pullLimit: number;
3745
+ /** The side of the grid that the points of the edges snap to after the cycles, in units of the board. The default is 8. */
3746
+ readonly snap: number;
3747
+ /** A highway has this number of edges or more. The default is 2. */
3748
+ readonly minSize: number;
3749
+ }
3750
+ /** The default options of the strategy `fdeb`. */
3751
+ export declare const FDEB_DEFAULTS: Readonly<Required<Omit<FdebOptions, "margin" | "k">>>;
3752
+ /**
3753
+ * This function gives the polylines of the force-directed edge bundling (HWY-002, Holten and van Wijk 2009), with the box field of RULE-002.
3754
+ * Each edge starts as the straight line between its two points out of the plugs. Each cycle doubles its points.
3755
+ * In each step, a point moves by `step` times the mean pull to the matching points of its partners. The springs to its two neighbours also move it.
3756
+ * The boxes push the points, and after each cycle a point in a box moves out of it. An edge over its stretch budget gets no pull in that step.
3757
+ */
3758
+ export declare function fdebLines(input: HighwayInput, finder: WayFinder, o: Readonly<FdebOptions>): Map<string, Point[]>;
3759
+ /**
3760
+ * This function gives the highways of the force-directed edge bundling (HWY-002 with RULE-002).
3761
+ * The points of the bundled polylines snap to a grid of side `snap`, so the points of one bundle come together.
3762
+ * Each edge then goes through its points along the corner graph, and the stretches that `minSize` edges share become highways.
3763
+ */
3764
+ export declare function fdebPlan(input: HighwayInput, o: Readonly<FdebOptions>): HighwayPlan;
3765
+ /** The options of the highway strategy `mesh` (HWY-004 of the notes). */
3766
+ interface MeshOptions extends Pick<WayOptions, "margin" | "k"> {
3767
+ /** The side of a cell of the mesh, in units of the boxes: the median of the smaller side of each box. The default is 4. */
3768
+ readonly cell: number;
3769
+ /** A cluster of crossings on one segment of the mesh has at most about this number of edges. The default is 8. */
3770
+ readonly capacity: number;
3771
+ /** Two clusters nearer than this value, in units of the boxes, become one. The default is 1. */
3772
+ readonly merge: number;
3773
+ /** The largest angle in degrees between a line and the main direction of a cell. A line with a larger angle does not cross the mesh there. The default is 45. */
3774
+ readonly angle: number;
3775
+ /** A highway has this number of edges or more. The default is 2. */
3776
+ readonly minSize: number;
3777
+ }
3778
+ /** The default options of the strategy `mesh`. */
3779
+ export declare const MESH_DEFAULTS: Readonly<Required<Omit<MeshOptions, "margin" | "k">>>;
3780
+ /** This function gives the median of the smaller side of each box of the graph, or 1 for a graph without boxes. */
3781
+ export declare function boxUnit(graph: Graph): number;
3782
+ /** This function gives the clusters of the values by a 1D k-means with `k` centres, then joins the centres nearer than `merge`. The result gives the centre of each value. */
3783
+ export declare function clusters1d(values: readonly number[], k: number, merge: number): number[];
3784
+ /**
3785
+ * This function gives the waypoints of the control mesh (HWY-004, GBEC of Cui, Zhou, Qu, Wong and Li 2008).
3786
+ * A grid of cells covers the board. The main direction of each cell is the peak of a histogram of the angles of the straight lines through it.
3787
+ * The segment of the mesh in a cell goes through its middle, across that direction. The crossings of the lines with the segment form clusters by a 1D k-means.
3788
+ * The centre of the cluster of each crossing is a waypoint of its edge. The waypoints of an edge are in the order of the edge.
3789
+ */
3790
+ export declare function meshWaypoints(input: HighwayInput, finder: WayFinder, o: Readonly<MeshOptions>): Map<string, Point[]>;
3791
+ /**
3792
+ * This function gives the highways of the control mesh (HWY-004). Each edge goes through the centres of its clusters on the mesh, along the corner graph.
3793
+ * The centres of one cluster are one point, so the edges of a cluster share the ways between them. The stretches that `minSize` ways share become highways.
3794
+ */
3795
+ export declare function meshPlan(input: HighwayInput, o: Readonly<MeshOptions>): HighwayPlan;
3796
+ /**
3797
+ * The way to compute the density from the sample points. `direct` adds a Gaussian at each sample point (KDEEB).
3798
+ * `separable` counts the points in the cells and blurs the counts along x, then along y (CUBu). `fft` blurs the counts with a product of Fourier transforms (FFTEB).
3799
+ */
3800
+ type DensityKernel = "direct" | "separable" | "fft";
3801
+ /** The values of `DensityKernel`. */
3802
+ export declare const DENSITY_KERNELS: readonly DensityKernel[];
3803
+ /** The lines that make the first density: the straight lines of the edges, or their first routes. */
3804
+ type DensitySource = "lines" | "routes";
3805
+ /** The options of the highway strategy `kdeeb` (RULE-028 with HWY-006 of the notes). */
3806
+ interface KdeebOptions extends Pick<WayOptions, "margin" | "k"> {
3807
+ /** The lines of the first density. The default is `lines`. */
3808
+ readonly source: DensitySource;
3809
+ /** The side of a cell of the density image, in units of the board. The default is 8. A large board gets larger cells, up to 512 cells on a side. */
3810
+ readonly cell: number;
3811
+ /** The width of the kernel at the first step, in units of the board. The default is 24. */
3812
+ readonly bandwidth: number;
3813
+ /** Each step multiplies the width of the kernel by this value. The default is 0.7. */
3814
+ readonly decay: number;
3815
+ /** The number of steps. The default is 10. */
3816
+ readonly steps: number;
3817
+ /** The share of the Laplacian smoothing of each polyline after each step, from 0 to 1. The default is 0.5. */
3818
+ readonly smoothing: number;
3819
+ /** With this option, the density is 0 in the boxes, so no ridge forms over a box (RULE-028). The default is `true`. */
3820
+ readonly mask: boolean;
3821
+ /** The side of the grid that the points of the edges snap to after the steps, in units of the board. The default is 8. */
3822
+ readonly snap: number;
3823
+ /** A highway has this number of edges or more. The default is 2. */
3824
+ readonly minSize: number;
3825
+ }
3826
+ /** The default options of the strategy `kdeeb`. */
3827
+ export declare const KDEEB_DEFAULTS: Readonly<Required<Omit<KdeebOptions, "margin" | "k">>>;
3828
+ /** The settings of the advection that the strategies `kdeeb` and `cubu` share. */
3829
+ interface AdvectionSettings {
3830
+ /** The way to compute the density. */
3831
+ readonly kernel: DensityKernel;
3832
+ /** The spacing of the sample points after each step, in units of the board. The value 0 keeps the points where they are. */
3833
+ readonly resample: number;
3834
+ }
3835
+ /** A grid of cells over the board: its size, the side of a cell, and the place of its first cell. */
3836
+ interface DensityGrid {
3837
+ readonly w: number;
3838
+ readonly h: number;
3839
+ readonly cell: number;
3840
+ readonly x0: number;
3841
+ readonly y0: number;
3842
+ }
3843
+ /** This function gives the fast Fourier transform of a row of `n` complex values in place, with `n` a power of 2. `inverse` gives the inverse without the division by `n`. */
3844
+ export declare function fft(re: Float64Array, im: Float64Array, inverse?: boolean): void;
3845
+ /** This function gives the density of the points on the grid with the kernel `kernel` of the width `bandwidth` in units of the board. */
3846
+ export declare function pointDensity(points: readonly Point[], g: DensityGrid, bandwidth: number, kernel: DensityKernel): Float64Array;
3847
+ /**
3848
+ * This function gives the polylines of the density bundling (KDEEB, Hurter, Ersoy and Telea 2012). The ends of each polyline stay.
3849
+ * In each step, the sample points of all edges make a density. Each inner point moves `h / 4` up the gradient of the density, with `h` the width of the kernel.
3850
+ * The width then shrinks by `decay`, so the edges gather into ridges. A Laplacian smoothing keeps each polyline smooth.
3851
+ * With `mask`, the density is 0 in the boxes (RULE-028), and a point in a box moves out of it.
3852
+ */
3853
+ export declare function kdeebLines(input: HighwayInput, finder: WayFinder, o: Readonly<KdeebOptions>, settings: Readonly<AdvectionSettings>): Map<string, Point[]>;
3854
+ /** This function gives the highways of the bundled polylines of `kdeebLines`. The points snap to a grid of side `snap`, and the ways go through the corner graph. */
3855
+ export declare function densityPlan(input: HighwayInput, o: Readonly<KdeebOptions>, settings: Readonly<AdvectionSettings>, key: string): HighwayPlan;
3856
+ /**
3857
+ * This function gives the highways of the density bundling with a mask of the free space (RULE-028 with HWY-006).
3858
+ * The kernel is direct: each sample point adds a Gaussian. The final ridges of the polylines become the highways.
3859
+ */
3860
+ export declare function kdeebPlan(input: HighwayInput, o: Readonly<KdeebOptions>): HighwayPlan;
3861
+ /** The options of the highway strategy `cubu` (HWY-007 of the notes). */
3862
+ interface CubuOptions extends KdeebOptions {
3863
+ /** The way to compute the density: `separable` (CUBu) or `fft` (FFTEB). The default is `separable`. */
3864
+ readonly kernel: Exclude<DensityKernel, "direct">;
3865
+ /** The spacing of the sample points after each step, in units of the board. The value 0 keeps the points. The default is 8. */
3866
+ readonly resample: number;
3867
+ }
3868
+ /** The default options of the strategy `cubu`. */
3869
+ export declare const CUBU_DEFAULTS: Readonly<Required<Omit<CubuOptions, "margin" | "k">>>;
3870
+ /**
3871
+ * This function gives the highways of the fast density bundling (HWY-007: CUBu of van der Zwan, Codreanu and Telea 2016, and FFTEB of Lhuillier, Hurter and Telea 2017).
3872
+ * The steps are those of `kdeeb`, with the mask of the boxes. The density comes from the counts of the cells, blurred by a separable kernel or by a Fourier transform.
3873
+ * The sample points of each edge are spaced again after each step.
3874
+ */
3875
+ export declare function cubuPlan(input: HighwayInput, o: Readonly<CubuOptions>): HighwayPlan;
3876
+ /** The local fit of the moving least squares: a line, or a parabola in the frame of the line. */
3877
+ type MlsFit = "line" | "parabola";
3878
+ /** The values of `MlsFit`. */
3879
+ export declare const MLS_FITS: readonly MlsFit[];
3880
+ /** The options of the highway strategy `mlseb` (HWY-008 of the notes). */
3881
+ interface MlsebOptions extends Pick<WayOptions, "margin" | "k"> {
3882
+ /** The first lines of the edges: their straight lines, or their first routes. The default is `lines`. */
3883
+ readonly source: DensitySource;
3884
+ /** The radius of the fit at the first step, as a multiple of `boardUnit`: the median short side of the boxes. The default is 2. */
3885
+ readonly radius: number;
3886
+ /** Each step multiplies the radius by this value. The default is 0.8. */
3887
+ readonly decay: number;
3888
+ /** The number of steps. The default is 6. */
3889
+ readonly steps: number;
3890
+ /** The local fit. The default is `line`. */
3891
+ readonly fit: MlsFit;
3892
+ /** The weight of the angle, from 0 to 1. With 1, a sample at a right angle to the point has no weight. The default is 1. */
3893
+ readonly angleWeight: number;
3894
+ /** The spacing of the sample points of each edge, in units of the board. The default is 8. */
3895
+ readonly spacing: number;
3896
+ /** The side of the grid that the points of the edges snap to after the steps, in units of the board. The default is 8. */
3897
+ readonly snap: number;
3898
+ /** A highway has this number of edges or more. The default is 2. */
3899
+ readonly minSize: number;
3900
+ }
3901
+ /** The default options of the strategy `mlseb`. */
3902
+ export declare const MLSEB_DEFAULTS: Readonly<Required<Omit<MlsebOptions, "margin" | "k">>>;
3903
+ /** One sample point of an edge, with the unit tangent of its edge there. */
3904
+ interface Sample {
3905
+ readonly p: Point;
3906
+ readonly tx: number;
3907
+ readonly ty: number;
3908
+ }
3909
+ /**
3910
+ * This function gives the point of the moving least squares fit at the point `p`. The weight of a sample `q` is `exp(-|q-p|^2 / r^2)`.
3911
+ * The angle term multiplies it by `1 - a + a |cos|`, with `cos` the cosine of the angle between the two tangents.
3912
+ * The fit `line` gives the projection of `p` on the weighted line of the samples. The fit `parabola` fits `s = c0 + c1 t + c2 t^2` in the frame of that line.
3913
+ * Without weight, the function gives `p`.
3914
+ */
3915
+ export declare function mlsPoint(p: Point, t: {
3916
+ tx: number;
3917
+ ty: number;
3918
+ }, near: readonly Sample[], r: number, angleWeight: number, fit: MlsFit): Point;
3919
+ /**
3920
+ * This function gives the polylines of the moving least squares bundling (MLSEB, Wu, Zeng, Zhu and Yu 2017). The ends of each polyline stay.
3921
+ * In each step, each inner point moves to the local fit of the samples of all edges within the radius. Then the radius shrinks by `decay`.
3922
+ * A move is at most the radius. A point in a box moves out of it.
3923
+ */
3924
+ export declare function mlsebLines(input: HighwayInput, finder: WayFinder, o: Readonly<MlsebOptions>): Map<string, Point[]>;
3925
+ /**
3926
+ * This function gives the highways of the moving least squares bundling (HWY-008). The points of `mlsebLines` snap to a grid of side `snap`.
3927
+ * The ways go through the corner graph, and each stretch that `minSize` ways share is a highway.
3928
+ */
3929
+ export declare function mlsebPlan(input: HighwayInput, o: Readonly<MlsebOptions>): HighwayPlan;
3930
+ /** The clusterer that gives the groups of edges: QuickBundles (HWY-026) with its defaults, or the collection of each edge. */
3931
+ type SkeletonGroups = "quickbundles" | "keys";
3932
+ /** The values of `SkeletonGroups`. */
3933
+ export declare const SKELETON_GROUPS: readonly SkeletonGroups[];
3934
+ /** The point that each sample point moves toward: the nearest point of the skeleton of its group, or of the mean polyline of its group. */
3935
+ type SkeletonTarget = "skeleton" | "mean";
3936
+ /** The values of `SkeletonTarget`. */
3937
+ export declare const SKELETON_TARGETS: readonly SkeletonTarget[];
3938
+ /** The options of the highway strategy `sbeb` (HWY-009 of the notes). */
3939
+ interface SbebOptions extends Pick<WayOptions, "margin" | "k"> {
3940
+ /** The clusterer of the groups. The default is `quickbundles`. */
3941
+ readonly group: SkeletonGroups;
3942
+ /** The first lines of the edges: their straight lines, or their first routes. The default is `lines`. */
3943
+ readonly source: DensitySource;
3944
+ /** The radius of the shape of a group, as a multiple of `boardUnit`. The default is 1.5. */
3945
+ readonly radius: number;
3946
+ /** The share of the distance to the target that a point moves in one step, from 0 to 1. The default is 0.5. */
3947
+ readonly attraction: number;
3948
+ /** The number of steps. The default is 4. */
3949
+ readonly steps: number;
3950
+ /** The share of the Laplacian smoothing of each polyline after each step, from 0 to 1. The default is 0.5. */
3951
+ readonly smoothing: number;
3952
+ /** The target of the points. The default is `skeleton`. */
3953
+ readonly target: SkeletonTarget;
3954
+ /** The side of a cell of the image of the shape, in units of the board. A large shape gets larger cells, up to 256 cells on a side. The default is 4. */
3955
+ readonly cell: number;
3956
+ /** The side of the grid that the points of the edges snap to after the steps, in units of the board. The default is 8. */
3957
+ readonly snap: number;
3958
+ /** A group with this number of edges or more moves, and a highway has this number of edges or more. The default is 2. */
3959
+ readonly minSize: number;
3960
+ }
3961
+ /** The default options of the strategy `sbeb`. */
3962
+ export declare const SBEB_DEFAULTS: Readonly<Required<Omit<SbebOptions, "margin" | "k">>>;
3963
+ /** This function gives the group of each edge: the clusters of QuickBundles, or the collection of the edge. An edge without a collection has no group with `keys`. */
3964
+ export declare function skeletonGroups(input: HighwayInput, group: SkeletonGroups): Map<string, EdgeGroup>;
3965
+ /** This function gives the first line of each edge. The line goes from a point at `margin` out of the source plug to a point at `margin` out of the target plug. */
3966
+ export declare function firstLines(input: HighwayInput, finder: WayFinder, source: DensitySource, spacing: number): Map<string, Point[]>;
3967
+ /** The image of the shape of a group and its skeleton. */
3968
+ interface ShapeSkeleton {
3969
+ readonly grid: DensityGrid;
3970
+ /** The distance of each cell to the nearest cell outside the shape, in cells. A cell outside the shape has 0. */
3971
+ readonly depth: Float64Array;
3972
+ /** The value is 1 for each cell of the skeleton. */
3973
+ readonly skeleton: Uint8Array;
3974
+ }
3975
+ /**
3976
+ * This function gives the shape of a group and its skeleton (its medial axis). The shape is the union of the disks of radius `radius` along the lines, minus the boxes.
3977
+ * The depth is a chamfer distance transform with the steps 1 and √2. A cell is on the skeleton when two conditions are true.
3978
+ * Its depth is half of `radius` or more. Its depth is a ridge along one of the four pairs of opposite neighbours.
3979
+ * A ridge is not lower than the two neighbours, and it is higher than one of them.
3980
+ */
3981
+ export declare function shapeSkeleton(lines: readonly (readonly Point[])[], finder: WayFinder, radius: number, cell: number): ShapeSkeleton;
3982
+ /** This function gives the middle of the skeleton cell nearest to `p`, within `reach` in units of the board, or `undefined`. */
3983
+ export declare function nearestSkeleton(s: ShapeSkeleton, p: Point, reach: number): Point | undefined;
3984
+ /** This function gives the mean polyline of lines in one direction, with `k` points. */
3985
+ export declare function meanLine(lines: readonly (readonly Point[])[], k: number): Point[];
3986
+ /** This function gives the point of a polyline nearest to `p`. */
3987
+ export declare function nearestOnLine(line: readonly Point[], p: Point): Point;
3988
+ /** This function gives the groups with `min` edges or more, as lists of edges. The groups are in the order of their first edges. */
3989
+ export declare function bigGroups(groups: ReadonlyMap<string, EdgeGroup>, min: number): {
3990
+ key: string;
3991
+ edges: {
3992
+ edge: string;
3993
+ flip: boolean;
3994
+ }[];
3995
+ }[];
3996
+ /**
3997
+ * This function gives the polylines of the skeleton-based edge bundling (SBEB, Ersoy, Hurter, Paulovich, Cantareiro and Telea 2011). The ends of each polyline stay.
3998
+ * In each step, each group of `minSize` edges or more draws its shape, and each inner point moves the share `attraction` toward its target.
3999
+ * The share falls to 0 at the distance `2 radius`. A Laplacian smoothing keeps each polyline smooth, and a point in a box moves out of it.
4000
+ * The edges outside such a group do not move.
4001
+ */
4002
+ export declare function sbebLines(input: HighwayInput, finder: WayFinder, o: Readonly<SbebOptions>): Map<string, Point[]>;
4003
+ /**
4004
+ * This function gives the highways of the skeleton-based edge bundling (HWY-009). The points of `sbebLines` snap to a grid of side `snap`.
4005
+ * The ways go through the corner graph, and each stretch that `minSize` ways share is a highway.
4006
+ */
4007
+ export declare function sbebPlan(input: HighwayInput, o: Readonly<SbebOptions>): HighwayPlan;
4008
+ /** The rule of the half width of an area: the spread of the edges of the group, or the number of its lanes. */
4009
+ type AreaWidth = "spread" | "count";
4010
+ /** The values of `AreaWidth`. */
4011
+ export declare const AREA_WIDTHS: readonly AreaWidth[];
4012
+ /** The options of the highway strategy `areas` (HWY-010 of the notes). */
4013
+ interface AreaOptions extends Pick<WayOptions, "margin" | "k"> {
4014
+ /** The clusterer of the groups. The default is `quickbundles`. */
4015
+ readonly group: SkeletonGroups;
4016
+ /** The lines of the edges that make the shape: their straight lines, or their first routes. The default is `lines`. */
4017
+ readonly source: DensitySource;
4018
+ /** The radius of the shape of a group, as a multiple of `boardUnit`. The default is 1.5. */
4019
+ readonly radius: number;
4020
+ /** The rule of the half width of the area. The default is `spread`. */
4021
+ readonly width: AreaWidth;
4022
+ /** The width of one lane for the rule `count`, in units of the board. The default is 4. */
4023
+ readonly laneWidth: number;
4024
+ /** The side of a cell of the image of the shape, in units of the board. The default is 4. */
4025
+ readonly cell: number;
4026
+ /** A highway has this number of edges or more. The default is 2. */
4027
+ readonly minSize: number;
4028
+ }
4029
+ /** The default options of the strategy `areas`. */
4030
+ export declare const AREA_DEFAULTS: Readonly<Required<Omit<AreaOptions, "margin" | "k">>>;
4031
+ /**
4032
+ * This function gives the longest path of the largest part of a skeleton, as the middles of its cells. The neighbours of a cell are its 8 neighbours.
4033
+ * The function finds the cell farthest from a first cell, then the cell farthest from that cell. A skeleton without cells gives an empty list.
4034
+ */
4035
+ export declare function skeletonPath(s: ShapeSkeleton): Point[];
4036
+ /**
4037
+ * This function gives the highways of the image-based edge bundles (HWY-010, Telea and Ersoy 2010). Each group of edges is one area with one spine.
4038
+ * The spine goes through the corner graph between the two ends of the longest path of the skeleton of the shape of the group.
4039
+ * The area is the skeleton path with a half width. With `spread`, the half width is the 90th percentile of the distances of the points to the path.
4040
+ * With `count`, it is the number of lanes times half of `laneWidth`. The half width is at least the margin.
4041
+ * An edge joins the spine where its line first goes into the area. It leaves the spine where its line last comes out of the area.
4042
+ */
4043
+ export declare function areaPlan(input: HighwayInput, o: Readonly<AreaOptions>): HighwayPlan;
4044
+ /** The edges that one group can hold: the edges of one collection, or each edge. */
4045
+ type GroupScope = "collection" | "all";
4046
+ /** The values of `GroupScope`. */
4047
+ export declare const GROUP_SCOPES: readonly GroupScope[];
4048
+ /** The options of the highway strategy `confluent` (HWY-013 of the notes). */
4049
+ interface ConfluentOptions extends Pick<WayOptions, "margin" | "k"> {
4050
+ /** A biclique `K(A, B)` becomes a track when `|A| |B|` is this value or more. The default is 4. */
4051
+ readonly minBiclique: number;
4052
+ /** The edges of one track. With `collection`, a track holds the edges of one collection, and an edge without a collection is on no track. The default is `all`. */
4053
+ readonly scope: GroupScope;
4054
+ /** The spine of each track. The default is `trunk`: one trunk from the merge junction to the split junction. */
4055
+ readonly spine: GroupSpine;
4056
+ /** An edge rides the trunk only when each of its legs is this share of the trunk or shorter. `Infinity` sets no limit. The default is 1. */
4057
+ readonly legMax: number;
4058
+ }
4059
+ /** The default options of the strategy `confluent`. */
4060
+ export declare const CONFLUENT_DEFAULTS: Readonly<Required<Omit<ConfluentOptions, "margin" | "k">>>;
4061
+ /** The edges between pairs of nodes of one scope: for each node, its neighbours and the edges to each of them. */
4062
+ interface NodeLinks {
4063
+ /** The key of the scope. */
4064
+ readonly key: string;
4065
+ /** For each node, the edges to each neighbour, by the id of the neighbour. */
4066
+ readonly links: Map<string, Map<string, string[]>>;
4067
+ }
4068
+ /** This function gives the links of each scope. A loop (an edge from a node to itself) is not a link. The order of the maps follows the order of the edges. */
4069
+ export declare function nodeLinks(graph: Graph, scope: GroupScope): NodeLinks[];
4070
+ /** A biclique: the two sets of nodes, with a link from each node of `a` to each node of `b`. */
4071
+ interface Biclique {
4072
+ readonly a: readonly string[];
4073
+ readonly b: readonly string[];
4074
+ }
4075
+ /**
4076
+ * This function gives the bicliques of a greedy search (HWY-013). Each search starts at one node `x` with `A = {x}` and `B` its neighbours.
4077
+ * It then adds to `A` the node that gives the largest `|A| |B|`, with `B` cut to the common neighbours, while the product grows.
4078
+ * The best biclique of all starts with `|A| |B| >= min` becomes a track, its links go away, and the search repeats.
4079
+ * The nodes of `A` and `B` are apart. The largest set is `b`.
4080
+ */
4081
+ export declare function greedyBicliques(links: Map<string, Map<string, string[]>>, min: number): Biclique[];
4082
+ /**
4083
+ * This function gives the group of each edge of a set of bicliques. The edges of one biclique are one group, with the key `<prefix><scope>/<index>`.
4084
+ * An edge from a node of `b` to a node of `a` has `flip`. Thus each trunk goes from the side `a` to the side `b`.
4085
+ */
4086
+ export declare function bicliqueGroups(graph: Graph, scope: NodeLinks, bicliques: readonly Biclique[], prefix: string, into: Map<string, EdgeGroup>): void;
4087
+ /**
4088
+ * This function gives the highways of the confluent drawing (HWY-013, Dickerson, Eppstein, Goodrich and Meng 2005).
4089
+ * Each biclique `K(A, B)` of the greedy search is one track. The track merges the edges near the side `A` and splits them near the side `B`.
4090
+ * The junctions are the Weber points of the ends, as in the spine `trunk` of `groupedPlan`.
4091
+ */
4092
+ export declare function confluentPlan(input: HighwayInput, o: Readonly<ConfluentOptions>): HighwayPlan;
4093
+ /** The rule of a module: the nodes with the same neighbours (`exact`), or with near neighbours by the Jaccard index (`near`). */
4094
+ type ModuleRule = "exact" | "near";
4095
+ /** The values of `ModuleRule`. */
4096
+ export declare const MODULE_RULES: readonly ModuleRule[];
4097
+ /** The options of the highway strategy `power` (HWY-014 of the notes). */
4098
+ interface PowerOptions extends Pick<WayOptions, "margin" | "k"> {
4099
+ /** The rule of the modules. The default is `exact`. */
4100
+ readonly modules: ModuleRule;
4101
+ /** With the rule `near`, a node joins a module at this Jaccard index or more with the first node of the module. The default is 0.8. */
4102
+ readonly jaccard: number;
4103
+ /** A power edge saves the number of its edges less 1. It becomes a highway when it saves this number of edges or more. The default is 2. */
4104
+ readonly minSaved: number;
4105
+ /** The edges of one power edge. With `collection`, a power edge holds the edges of one collection. The default is `all`. */
4106
+ readonly scope: GroupScope;
4107
+ /** The spine of each power edge. The default is `trunk`. */
4108
+ readonly spine: GroupSpine;
4109
+ /** An edge rides the trunk only when each of its legs is this share of the trunk or shorter. `Infinity` sets no limit. The default is 1. */
4110
+ readonly legMax: number;
4111
+ }
4112
+ /** The default options of the strategy `power`. */
4113
+ export declare const POWER_DEFAULTS: Readonly<Required<Omit<PowerOptions, "margin" | "k">>>;
4114
+ /** This function gives the Jaccard index of two sets: the size of their common part over the size of their union. Two empty sets give 1. */
4115
+ export declare function jaccardIndex(a: ReadonlySet<string>, b: ReadonlySet<string>): number;
4116
+ /**
4117
+ * This function gives the module of each node. With `exact`, the nodes with the same set of neighbours are one module.
4118
+ * With `near`, the nodes go in the order of their degree, the largest first. A node joins the first module whose first node has a Jaccard index of `jaccard` or more with it.
4119
+ * The function gives the modules as lists of nodes, each in the order of the ids.
4120
+ */
4121
+ export declare function modulesOf(links: ReadonlyMap<string, ReadonlyMap<string, readonly string[]>>, rule: ModuleRule, jaccard: number): string[][];
4122
+ /**
4123
+ * This function gives the highways of the edge compression with modules and power graphs (HWY-014, Dwyer, Henry Riche, Marriott and Mears 2013).
4124
+ * The edges between two modules are one power edge. With modules of the rule `exact`, each node of one module links to each node of the other.
4125
+ * A power edge that saves `minSaved` edges or more is one highway from module to module.
4126
+ * Its trunk goes between the Weber points of the two ends.
4127
+ * The search does not nest modules, so it finds no power edge inside a power edge.
4128
+ */
4129
+ export declare function powerPlan(input: HighwayInput, o: Readonly<PowerOptions>): HighwayPlan;
4130
+ /** The options of the highway strategy `crossbars` (HWY-022 of the notes). */
4131
+ interface CrossbarOptions extends Pick<WayOptions, "margin" | "k"> {
4132
+ /** The plan that gets the bundled crossings. Only the edges outside its highways can be on a crossbar. The default is `shared-ways`. */
4133
+ readonly from: HighwayBase;
4134
+ /** Two segments are parallel when the angle between them is this value or less, in degrees. The default is 15. */
4135
+ readonly tolerance: number;
4136
+ /** Each side of a crossbar has this number of edges or more. The default is 2. */
4137
+ readonly minBar: number;
4138
+ /** The crossings of one crossbar are this distance or nearer to its first crossing, as a multiple of `boardUnit`. The default is 3. */
4139
+ readonly reach: number;
4140
+ }
4141
+ /** The default options of the strategy `crossbars`. */
4142
+ export declare const CROSSBAR_DEFAULTS: Readonly<Required<Omit<CrossbarOptions, "margin" | "k">>>;
4143
+ /** One crossing of two routes: the edges, the point and the unit directions of the two segments there. */
4144
+ interface RouteCrossing {
4145
+ readonly e: string;
4146
+ readonly f: string;
4147
+ readonly p: Point;
4148
+ readonly de: Point;
4149
+ readonly df: Point;
4150
+ }
4151
+ /** This function gives each crossing of two routes of the list, in the order of the list. */
4152
+ export declare function routeCrossings(routes: readonly {
4153
+ readonly edge: string;
4154
+ readonly points: readonly Point[];
4155
+ }[]): RouteCrossing[];
4156
+ /** A crossbar: two sets of edges, with a crossing of each edge of `p` with each edge of `q` near one place. */
4157
+ interface Crossbar {
4158
+ readonly p: readonly string[];
4159
+ readonly q: readonly string[];
4160
+ /** The mean point of the crossings of the crossbar. */
4161
+ readonly at: Point;
4162
+ /** The mean direction of the side `p`, and of the side `q`. */
4163
+ readonly dp: Point;
4164
+ readonly dq: Point;
4165
+ }
4166
+ /**
4167
+ * This function gives the crossbars of a greedy search (HWY-022, after Fink, Hershberger, Suri and Verbeek 2016).
4168
+ * The search starts at each crossing in order. It grows the two sides while each new edge crosses each edge of the other side near the start, at the same angles.
4169
+ * A crossbar with `minBar` edges or more on each side is kept. Each edge is on one crossbar at most.
4170
+ */
4171
+ export declare function greedyCrossbars(crossings: readonly RouteCrossing[], reach: number, tolDeg: number, minBar: number): Crossbar[];
4172
+ /**
4173
+ * This function gives the highways of the bundled crossings (HWY-022). The edges outside the highways of the plan `from` keep their routes after `follow`.
4174
+ * Each crossbar of those routes gives two highways, one for each side. Each spine is a line through the mean crossing, along the mean direction of its side.
4175
+ * It is `2 reach` long, and it goes through the corner graph. So each side crosses the other side at one place, as a bundle.
4176
+ * An edge joins the spine near the point of its route nearest to one end of the line. It leaves the spine near the other end.
4177
+ */
4178
+ export declare function crossbarPlan(input: HighwayInput, o: Readonly<CrossbarOptions>): HighwayPlan;
4179
+ /** The options of the highway strategy `frechet` (HWY-027 of the notes). */
4180
+ interface FrechetOptions extends Pick<WayOptions, "margin" | "k"> {
4181
+ /** Two parts of routes are one bundle when their discrete Fréchet distance is this value or less, as a multiple of `boardUnit`. The default is 1. */
4182
+ readonly eps: number;
4183
+ /** A bundle has this number of edges or more, with the reference edge. The default is 2. */
4184
+ readonly minSize: number;
4185
+ /** The reference part of a bundle is this length or longer, as a multiple of `boardUnit`. The default is 2. */
4186
+ readonly minLength: number;
4187
+ /** The distance between two samples of a route, as a multiple of `boardUnit`. The default is 0.5. */
4188
+ readonly step: number;
4189
+ /** A search starts at each sample of this number along each route. The default is 2. */
4190
+ readonly stride: number;
4191
+ }
4192
+ /** The default options of the strategy `frechet`. */
4193
+ export declare const FRECHET_DEFAULTS: Readonly<Required<Omit<FrechetOptions, "margin" | "k">>>;
4194
+ /** This function gives the points of a polyline at equal distances of `step` or less, with its first and its last point. */
4195
+ export declare function samplesOf(line: readonly Point[], step: number): Point[];
4196
+ /** The cells of one row of the free space that a monotone path reaches. Each cell is a sorted index of the other curve. */
4197
+ type Row = readonly number[];
4198
+ /**
4199
+ * This function gives the next row of the free space of the discrete Fréchet distance. The curve `q` has a free start and a free end.
4200
+ * A cell `(j, b)` is free when the distance of `p[j]` to `q[b]` is `eps` or less.
4201
+ * A path reaches a free cell from `(j - 1, b)`, `(j - 1, b - 1)` or `(j, b - 1)`.
4202
+ */
4203
+ export declare function nextRow(prev: Row, pj: Point, q: readonly Point[], eps: number): number[];
4204
+ /**
4205
+ * This function tells if a part of `q` has a discrete Fréchet distance of `eps` or less to the whole of `p`. The part of `q` is free to start and to end anywhere.
4206
+ * It uses the rows of `nextRow`.
4207
+ */
4208
+ export declare function partWithin(p: readonly Point[], q: readonly Point[], eps: number): boolean;
4209
+ /** One bundle of the search: the reference edge, the part of its samples, and the other edges with their sense. */
4210
+ interface FrechetBundle {
4211
+ readonly edge: string;
4212
+ readonly from: number;
4213
+ readonly to: number;
4214
+ readonly length: number;
4215
+ /** The other edges. `back` is true when the edge goes along the reference part in the reverse sense. */
4216
+ readonly members: readonly {
4217
+ readonly edge: string;
4218
+ readonly back: boolean;
4219
+ }[];
4220
+ }
4221
+ /**
4222
+ * This function gives the bundles of the search (HWY-027, after Buchin, Buchin, Gudmundsson, Löffler and Luo 2011, in a simple exact form).
4223
+ * For each reference route and each start sample (at each `stride`), it grows the reference part one sample at a time.
4224
+ * It keeps the other routes, in both senses, with a part at a discrete Fréchet distance of `eps` or less.
4225
+ * It stops when fewer than `minSize - 1` routes remain.
4226
+ * Each start gives the part with the best score: the number of edges times the length.
4227
+ * The search uses the discrete distance on samples only. It does not use the continuous distance or the full free space diagram.
4228
+ */
4229
+ export declare function frechetBundles(samples: ReadonlyMap<string, readonly Point[]>, eps: number, minSize: number, minLength: number, stride: number): FrechetBundle[];
4230
+ /**
4231
+ * This function gives the highways of the subtrajectory clusters of the first routes (HWY-027). The samples of each route leave out its two end points.
4232
+ * The bundles go in the order of their score, the best first. A bundle keeps the members whose part of the route is not on a bundle already.
4233
+ * The spine of a highway is the reference part. Each member rides the whole spine, in its own sense.
4234
+ */
4235
+ export declare function frechetPlan(input: HighwayInput, o: Readonly<FrechetOptions>): HighwayPlan;
4236
+ /** The options of the highway strategy `spectral` (HWY-029 of the note on highways). */
4237
+ interface SpectralOptions {
4238
+ /** Two edges are a pair of the graph only when their compatibility is this value or more. The default is 0.5. */
4239
+ readonly c0: number;
4240
+ /** The number of clusters of each part of the graph. The value 0 lets the largest eigengap choose it. The default is 0. */
4241
+ readonly clusters: number;
4242
+ /** The eigengap chooses at most this number of clusters in each part of the graph. The default is 16. */
4243
+ readonly kMax: number;
4244
+ /** A cluster with this number of edges or more gets highways. The default is 2. */
4245
+ readonly minSize: number;
4246
+ /** The spine of each cluster. The default is `trunk`: one trunk from one area to the other area. */
4247
+ readonly spine: GroupSpine;
4248
+ }
4249
+ /** The default options of the strategy `spectral`. */
4250
+ export declare const SPECTRAL_DEFAULTS: Readonly<SpectralOptions>;
4251
+ /** The ends of one edge of the board. */
4252
+ interface EdgeEnds {
4253
+ readonly edge: string;
4254
+ readonly s: Point;
4255
+ readonly t: Point;
4256
+ }
4257
+ /** This function gives the ends of each edge of the input: the points of its two plugs. */
4258
+ export declare function edgeEnds(input: HighwayInput): EdgeEnds[];
4259
+ /**
4260
+ * This function gives the eigenvalues and the eigenvectors of a symmetric matrix of `n` rows (the Householder steps and the QL steps of JAMA).
4261
+ * The values are in increasing order. The column `j` of `vectors` (the values `vectors[i * n + j]`) is the unit vector of the value `j`.
4262
+ */
4263
+ export declare function symmetricEigen(n: number, a: Float64Array): {
4264
+ values: Float64Array;
4265
+ vectors: Float64Array;
4266
+ };
4267
+ /**
4268
+ * This function puts the rows of a matrix of `n` rows and `k` columns into `k` clusters (the steps of Lloyd).
4269
+ * The first centre is row 0. Each next centre is the row farthest from the centres that exist. The result is the cluster of each row.
4270
+ */
4271
+ export declare function kMeans(n: number, k: number, rows: Float64Array, iterations?: number): Int32Array;
4272
+ /**
4273
+ * This function gives the spectral clusters of the points of a weight matrix (von Luxburg 2007, with the normalization of Ng, Jordan and Weiss).
4274
+ * Each connected part of the graph is one problem. `L_sym = I - D^-1/2 W D^-1/2`.
4275
+ * The number of clusters `k` of a part is `clusters`, or the place of the largest gap of the first `kMax + 1` eigenvalues.
4276
+ * The first `k` eigenvectors, with each row at the length 1, go into `kMeans`. The result is the cluster of each point, and -1 for a point with no pair.
4277
+ */
4278
+ export declare function spectralLabels(n: number, w: Float64Array, o: Readonly<Pick<SpectralOptions, "clusters" | "kMax">>): Int32Array;
4279
+ /** This function gives the matrix of the compatibility of the pairs of edges, with 0 for a pair below `c0`. Then a `scale` changes the value of each pair that stays. */
4280
+ export declare function compatibilityMatrix(ends: readonly EdgeEnds[], c0: number, scale?: (i: number, j: number) => number): Float64Array;
4281
+ /**
4282
+ * This function gives the edge groups of the clusters of the edges of one matrix. Each edge of a cluster gets `flip` when it goes opposite to the first edge of the cluster.
4283
+ * An edge with the label -1 gets no group.
4284
+ */
4285
+ export declare function labelGroups(ends: readonly EdgeEnds[], labels: Int32Array, prefix: string, groups: Map<string, EdgeGroup>): void;
4286
+ /** This function splits the edges into blocks of at most `BLOCK` edges, in the order of their sources. A small graph is one block. */
4287
+ export declare function edgeBlocks<T extends EdgeEnds>(ends: readonly T[]): T[][];
4288
+ /** This function gives the spectral clusters of the edges (HWY-029). A pair of edges is in the graph when its compatibility of FDEB is `c0` or more. */
4289
+ export declare function spectralClusters(input: HighwayInput, o: Readonly<SpectralOptions>): Map<string, EdgeGroup>;
4290
+ /**
4291
+ * This function gives the highways of the spectral clusters of the compatibility graph (HWY-029). The eigengap gives the number of highways of each part.
4292
+ * The clusters with `minSize` edges or more get highways.
4293
+ */
4294
+ export declare function spectralPlan(input: HighwayInput, o: Readonly<SpectralOptions>): HighwayPlan;
4295
+ /** The options of the highway strategy `resistance` (HWY-021 of the note on highways). */
4296
+ interface ResistanceOptions extends SpectralOptions {
4297
+ /** The number of random projections of the estimate of the resistance. The default is 16. */
4298
+ readonly projections: number;
4299
+ /** The weight of the resistance, from 0 to 1. A pair with `C >= c0` gets the weight `C (1 - weight R_e R_f)`. The default is 0.5. */
4300
+ readonly weight: number;
4301
+ /** With `true`, an edge with a resistance of 0.99 or more (a bridge) gets no pair. The default is `false`. */
4302
+ readonly sparsify: boolean;
4303
+ }
4304
+ /** The default options of the strategy `resistance`. */
4305
+ export declare const RESISTANCE_DEFAULTS: Readonly<ResistanceOptions>;
4306
+ /**
4307
+ * This function gives an estimate of the effective resistance of each edge of the graph (Spielman and Srivastava 2011).
4308
+ * It takes `k` random vectors `q` of the values `±1/√k` on the edges. It solves `L z = Bᵀ q` for each vector. Then `R(u, v) ≈ Σ (z_u - z_v)²`.
4309
+ * The value is from 0 to 1. A loop and an edge with an unknown node get 0. Parallel edges share the current, so each gets a lower value.
4310
+ */
4311
+ export declare function edgeResistance(graph: Graph, projections: number): Map<string, number>;
4312
+ /**
4313
+ * This function gives the clusters of the edges with the compatibility scaled by the resistance (HWY-021).
4314
+ * The compatibility of a pair is `C (1 - weight R_e R_f)`. A pair of two bridges thus gets a lower value. Then the spectral clusters of `spectral` apply.
4315
+ */
4316
+ export declare function resistanceClusters(input: HighwayInput, o: Readonly<ResistanceOptions>): Map<string, EdgeGroup>;
4317
+ /**
4318
+ * This function gives the highways of the spectral clusters of the compatibility graph with the weights of the effective resistance (HWY-021).
4319
+ * The clusters with `minSize` edges or more get highways.
4320
+ */
4321
+ export declare function resistancePlan(input: HighwayInput, o: Readonly<ResistanceOptions>): HighwayPlan;
4322
+ /** The options of the highway strategy `link-communities` (HWY-030 of the note on highways). */
4323
+ interface LinkCommunityOptions {
4324
+ /** The cut of the tree of the edges. The value 0 cuts at the best partition density. A value above 0 keeps the joins with this similarity or more. The default is 0. */
4325
+ readonly threshold: number;
4326
+ /** A community with this number of edges or more gets highways, after the check of the geometry. The default is 2. */
4327
+ readonly minSize: number;
4328
+ /** The largest distance of an end of an edge to the Weber point of its end of the community, in units of the board. The default is 6. */
4329
+ readonly spread: number;
4330
+ /** The spine of each community. The default is `shared`. */
4331
+ readonly spine: GroupSpine;
4332
+ }
4333
+ /** The default options of the strategy `link-communities`. */
4334
+ export declare const LINK_COMMUNITY_DEFAULTS: Readonly<LinkCommunityOptions>;
4335
+ /** The ends of one edge as node indices. */
4336
+ interface LinkEdge {
4337
+ readonly u: number;
4338
+ readonly v: number;
4339
+ }
4340
+ /**
4341
+ * This function gives the link communities of the edges: the single linkage of the edges by their similarity.
4342
+ * With `threshold` 0, the cut is at the level of the best partition density `D = (2/M) Σ m_c (m_c - n_c + 1) / ((n_c - 2)(n_c - 1))`.
4343
+ * When the best `D` is above 0, the first level with it applies. When it is 0 (a forest), the last level applies.
4344
+ * The result is the community of each edge, as the index of an edge of the community. A loop is alone.
4345
+ */
4346
+ export declare function linkCommunities(n: number, edges: readonly LinkEdge[], threshold: number): Int32Array;
4347
+ /**
4348
+ * This function gives the edge groups of the link communities (HWY-030). The hub of a community is its node with the most edges.
4349
+ * Each edge goes from its end at the hub, or else in the direction of the hub edges. The check of the geometry removes each edge with an end
4350
+ * farther than `spread` units from the Weber point of that end of the community. A community with fewer than `minSize` edges after the check gets no group.
4351
+ */
4352
+ export declare function linkCommunityGroups(input: HighwayInput, o: Readonly<LinkCommunityOptions>): Map<string, EdgeGroup>;
4353
+ /** This function gives the highways of the link communities of the line graph (HWY-030). Each community that passes the check of the geometry gets highways. */
4354
+ export declare function linkCommunityPlan(input: HighwayInput, o: Readonly<LinkCommunityOptions>): HighwayPlan;
4355
+ /** The characteristic points of the territories: the plugs, the bends of the first routes, or both. */
4356
+ type TerritoryPoints = "plugs" | "bends" | "both";
4357
+ /** The values of `TerritoryPoints`. */
4358
+ export declare const TERRITORY_POINTS: readonly TerritoryPoints[];
4359
+ /** The options of the highway strategy `territories` (HWY-033 of the note on highways). */
4360
+ interface TerritoryOptions {
4361
+ /** The radius of a group of points, in units of the board. The default is 4. */
4362
+ readonly radius: number;
4363
+ /** A flow between two cells becomes a highway when this number of edges or more cross it. The default is 2. */
4364
+ readonly minSize: number;
4365
+ /** The characteristic points. The default is `both`. */
4366
+ readonly points: TerritoryPoints;
4367
+ }
4368
+ /** The default options of the strategy `territories`. */
4369
+ export declare const TERRITORY_DEFAULTS: Readonly<TerritoryOptions>;
4370
+ /**
4371
+ * This function puts points into groups of the radius `r` (Andrienko and Andrienko 2011). Each point joins the group with the nearest centre within `r`.
4372
+ * Else it starts a new group. The centre of a group is the mean of its points. A second pass puts each point into the group of its nearest centre.
4373
+ * The result is the centres of the groups that keep points.
4374
+ */
4375
+ export declare function pointGroups(points: readonly Point[], r: number): Point[];
4376
+ /** This function gives the index of the centre nearest to `p`. The first of two equal centres wins. */
4377
+ export declare function nearestCentre(centres: readonly Point[], p: Point): number;
4378
+ /** One crossing of a route from the cell `from` into the cell `to`, at the share `at` of the length of the route. */
4379
+ interface CellStep {
4380
+ readonly from: number;
4381
+ readonly to: number;
4382
+ readonly at: number;
4383
+ }
4384
+ /**
4385
+ * This function gives the crossings of the cells of a polyline. The cells are the Voronoi cells of the centres.
4386
+ * It samples the polyline at the spacing `step`, and gives each change of the nearest centre.
4387
+ */
4388
+ export declare function cellSteps(line: readonly Point[], centres: readonly Point[], step: number): CellStep[];
4389
+ /**
4390
+ * This function gives the highways of the territories of the flows (HWY-033, Andrienko and Andrienko 2011).
4391
+ * The characteristic points form groups of the radius `radius`. The centres of the groups make Voronoi cells.
4392
+ * Each first route becomes a list of crossings between neighbour cells.
4393
+ *
4394
+ * A pair of cells with `minSize` crossings or more is a line from centre to centre. The edges that cross it snap to it. The centres of the cells are the interchanges.
4395
+ */
4396
+ export declare function territoryPlan(input: HighwayInput, o: Readonly<TerritoryOptions>): HighwayPlan;
4397
+ /** The linkage of the clusters of the vote matrix: `average` (the mean distance of the pairs) or `single` (the nearest pair). */
4398
+ type ConsensusLinkage = "average" | "single";
4399
+ /** The values of `ConsensusLinkage`. */
4400
+ export declare const CONSENSUS_LINKAGES: readonly ConsensusLinkage[];
4401
+ /** The options of the highway strategy `consensus` (HWY-035 of the note on highways). */
4402
+ interface ConsensusOptions {
4403
+ /** The finders that vote. The default is `corridors`, `quickbundles`, `wspd` and `road-classes`. */
4404
+ readonly members: readonly CandidateSource[];
4405
+ /** Two clusters join while their distance `1 - A` is below this value. The default is 0.5: more than half of the votes. */
4406
+ readonly cut: number;
4407
+ /** The linkage of the clusters. The default is `average`. */
4408
+ readonly linkage: ConsensusLinkage;
4409
+ /** A cluster with this number of edges or more gets highways. The default is 2. */
4410
+ readonly minSize: number;
4411
+ /** The spine of each cluster. The default is `shared`. */
4412
+ readonly spine: GroupSpine;
4413
+ }
4414
+ /** The default options of the strategy `consensus`. */
4415
+ export declare const CONSENSUS_DEFAULTS: Readonly<ConsensusOptions>;
4416
+ /**
4417
+ * This function gives the co-association matrix of the plans (Fred and Jain 2005). `A[e][f]` is the share of the plans with a highway that holds both `e` and `f`.
4418
+ * The edges are in the order of `edges`. An edge of no plan has no pair.
4419
+ */
4420
+ export declare function coAssociation(edges: readonly string[], plans: readonly HighwayPlan[]): Float64Array;
4421
+ /**
4422
+ * This function gives the clusters of the agglomerative linkage on the distance `1 - A`. Two clusters join while their distance is below `cut`.
4423
+ * The linkage `average` uses the mean of the distances of the pairs, and `single` the smallest distance.
4424
+ * The result is the cluster of each edge, and -1 for an edge that stays alone.
4425
+ */
4426
+ export declare function consensusLabels(n: number, a: Float64Array, cut: number, linkage: ConsensusLinkage): Int32Array;
4427
+ /** This function gives the edge groups of the consensus of the plans of the finders `members` (HWY-035). */
4428
+ export declare function consensusGroups(input: HighwayInput, o: Readonly<ConsensusOptions>): Map<string, EdgeGroup>;
4429
+ /**
4430
+ * This function gives the highways of the consensus of clusterings (HWY-035). Each finder of `members` votes for the pairs of edges that share one of its highways.
4431
+ * The clusters of the vote matrix with `minSize` edges or more get highways. A small edit changes few votes, so the clusters are stable.
4432
+ */
4433
+ export declare function consensusPlan(input: HighwayInput, o: Readonly<ConsensusOptions>): HighwayPlan;
4434
+ /** The allocation of the edges to the hubs: `single` (each node to its nearest hub) or `multiple` (each edge to its best pair of hubs). */
4435
+ type HubAllocation = "single" | "multiple";
4436
+ /** The values of `HubAllocation`. */
4437
+ export declare const HUB_ALLOCATIONS: readonly HubAllocation[];
4438
+ /** The candidate points of the hubs: the corners of the corner graph, or the centres of the cells of the tree of sections. */
4439
+ type HubCandidates = "corners" | "sections";
4440
+ /** The values of `HubCandidates`. */
4441
+ export declare const HUB_CANDIDATES: readonly HubCandidates[];
4442
+ /** The options of the highway strategy `p-hub` (HWY-041 of the note on highways). */
4443
+ interface PHubOptions {
4444
+ /** The number of hubs. The value 0 gives the root of the number of nodes, rounded. The default is 0. */
4445
+ readonly p: number;
4446
+ /** The cost of a length on a link between two hubs against a length off the links, from 0 to 1. The default is 0.5. */
4447
+ readonly alpha: number;
4448
+ /** The allocation of the edges to the hubs. The default is `single`. */
4449
+ readonly allocation: HubAllocation;
4450
+ /** The candidate points of the hubs. The default is `corners`. */
4451
+ readonly candidates: HubCandidates;
4452
+ /** An edge rides a link only when its way through the two hubs is this many times its first route or less. The default is 1.25. */
4453
+ readonly detour: number;
4454
+ /** The number of passes of the local search with one swap of a hub. The default is 1. */
4455
+ readonly swaps: number;
4456
+ /** A link with fewer edges than this number is not a highway. The default is 2. */
4457
+ readonly minSize: number;
4458
+ }
4459
+ /** The default options of the strategy `p-hub`. */
4460
+ export declare const P_HUB_DEFAULTS: Readonly<PHubOptions>;
4461
+ /** This function gives the candidate points of the hubs, at most `MAX_CANDIDATES`, without the copies. */
4462
+ export declare function hubCandidates(input: HighwayInput, candidates: HubCandidates): Point[];
4463
+ /**
4464
+ * This function chooses `p` points of `candidates` as the p-median of `points`. The greedy step adds the candidate that lowers the sum of the distances most.
4465
+ * Then at most 4 passes of swaps lower the sum more. The result is the indices of the chosen candidates.
4466
+ */
4467
+ export declare function pMedian(points: readonly Point[], candidates: readonly Point[], p: number): number[];
4468
+ /**
4469
+ * This function gives the highways of the hub location (HWY-041, the p-hub median of O'Kelly 1987). The p-median of the plugs chooses `p` hubs from the candidates.
4470
+ * Each swap pass changes one hub for one other candidate while the total cost falls. Each link between two hubs with `minSize` edges or more is a highway.
4471
+ * The edges that ride a link snap to it, from their first hub to their second hub.
4472
+ */
4473
+ export declare function pHubPlan(input: HighwayInput, o: Readonly<PHubOptions>): HighwayPlan;
4474
+ /** The line of each edge that QuickBundles compares: its first route, or the straight line between its plugs. */
4475
+ type BundleLine = "routes" | "lines";
4476
+ /** The order of the edges in the one pass: the order of the graph, or the longest line first. */
4477
+ type BundleOrder = "input" | "length";
4478
+ /** The options of the highway strategy `quickbundles` (HWY-026 of the note on highways). */
4479
+ interface QuickBundlesOptions {
4480
+ /** An edge joins a cluster when its distance to the centroid is this value or less, in units of the board. The default is 3. */
4481
+ readonly theta: number;
4482
+ /** The number of points of each line after the resampling. The default is 12. */
4483
+ readonly points: number;
4484
+ /** The line of each edge. The default is `routes`. */
4485
+ readonly line: BundleLine;
4486
+ /** The order of the edges. The default is `input`, so an added edge does not change the clusters before it. */
4487
+ readonly order: BundleOrder;
4488
+ /** A cluster with this number of edges or more gets highways. The default is 2. */
4489
+ readonly minSize: number;
4490
+ /** The spine of each cluster. The default is `shared`. */
4491
+ readonly spine: GroupSpine;
4492
+ }
4493
+ /** The default options of the strategy `quickbundles`. */
4494
+ export declare const QUICKBUNDLES_DEFAULTS: Readonly<QuickBundlesOptions>;
4495
+ /** This function gives `k` points at equal steps of length along a polyline, from its first point to its last point. */
4496
+ export declare function resample(line: readonly Point[], k: number): Point[];
4497
+ /**
4498
+ * This function gives the MDF distance of two lines with the same number of points. It is the mean distance of their points.
4499
+ * The function compares the points in the same direction and in the opposite direction, and keeps the smaller mean.
4500
+ * `flip` is `true` when the opposite direction is smaller.
4501
+ */
4502
+ export declare function mdf(p: readonly Point[], q: readonly Point[]): {
4503
+ d: number;
4504
+ flip: boolean;
4505
+ };
4506
+ /**
4507
+ * This function gives the clusters of QuickBundles (Garyfallidis 2012) as groups of edges.
4508
+ * In one pass, each edge joins the cluster with the nearest centroid when the MDF distance is `theta` units or less. Else it starts a cluster.
4509
+ * The centroid is the running mean of the lines of the cluster, each in the direction of the centroid.
4510
+ */
4511
+ export declare function quickBundles(input: HighwayInput, o: Readonly<QuickBundlesOptions>): Map<string, EdgeGroup>;
4512
+ /**
4513
+ * This function gives the highways of QuickBundles (HWY-026). The clusters of `quickBundles` with `minSize` edges or more get highways.
4514
+ * With the spine `shared`, the edges of each cluster share their ways through the corner graph. With `trunk`, each cluster gets one trunk.
4515
+ */
4516
+ export declare function quickBundlesPlan(input: HighwayInput, o: Readonly<QuickBundlesOptions>): HighwayPlan;
4517
+ /** The options of the highway strategy `scale-space` (HWY-053 of the note on highways). */
4518
+ interface ScaleSpaceOptions {
4519
+ /** The first scale, in units of the board. The default is 1.5. */
4520
+ readonly theta: number;
4521
+ /** The scale of each next scale is this value times the scale before it. The default is the root of 2. */
4522
+ readonly ratio: number;
4523
+ /** The number of scales. The default is 8. */
4524
+ readonly scales: number;
4525
+ /** The scale of the plan, from 0 (the first scale). With the defaults, the scale 2 is 3 units, as in the level 0 of `nested`. The default is 2. */
4526
+ readonly level: number;
4527
+ /** A cluster gets highways only when its persistence `ln(σ_death / σ_birth)` is this value or more. The default is 0.6: two steps of the root of 2. */
4528
+ readonly p0: number;
4529
+ /** The number of points of each line after the resampling. The default is 12. */
4530
+ readonly points: number;
4531
+ /** The line of each edge. The default is `routes`. */
4532
+ readonly line: BundleLine;
4533
+ /** A cluster with this number of edges or more gets highways. The default is 2. */
4534
+ readonly minSize: number;
4535
+ /** The spine of each cluster. The default is `shared`. */
4536
+ readonly spine: GroupSpine;
4537
+ }
4538
+ /** The default options of the strategy `scale-space`. */
4539
+ export declare const SCALE_SPACE_DEFAULTS: Readonly<ScaleSpaceOptions>;
4540
+ /** One cluster of one scale: its edges (as indices), and the scales of its birth and its death. */
4541
+ interface ScaleCluster {
4542
+ readonly members: readonly number[];
4543
+ /** The first scale of the cluster. A cluster of the first scale has the birth 0. */
4544
+ readonly birth: number;
4545
+ /** The first scale where the cluster joins a larger one. A cluster that lives past the last scale has the death `scales`. */
4546
+ readonly death: number;
4547
+ }
4548
+ /**
4549
+ * This function gives the clusters of the single linkage of `n` items at each scale. The distance `d(i, j)` of each pair is in `pairs`.
4550
+ * At the scale `s`, two items with a distance of `limits[s]` or less are in one cluster. Thus each cluster of a scale is in one cluster of each larger scale.
4551
+ * The result has the clusters of each scale with 2 items or more, with their birth and their death.
4552
+ */
4553
+ export declare function scaleClusters(n: number, pairs: readonly {
4554
+ i: number;
4555
+ j: number;
4556
+ d: number;
4557
+ }[], limits: readonly number[]): ScaleCluster[][];
4558
+ /**
4559
+ * This function gives the groups of the edges at the scale `level` that persist (HWY-053). The scale `s` is `theta × ratio^s` units of the board.
4560
+ * A cluster of the level gets a group when its persistence `(death - birth) × ln(ratio)` is `p0` or more. Each edge of a group gets `flip` against the first edge of the group.
4561
+ */
4562
+ export declare function scaleSpaceGroups(input: HighwayInput, o: Readonly<ScaleSpaceOptions>): Map<string, EdgeGroup>;
4563
+ /**
4564
+ * This function gives the highways of one scale of the scale space with persistence (HWY-053). Only the clusters that live over `p0` of the log scale get highways.
4565
+ * A short-lived cluster is noise, so a zoom level shows only the stable structure.
4566
+ */
4567
+ export declare function scaleSpacePlan(input: HighwayInput, o: Readonly<ScaleSpaceOptions>): HighwayPlan;
3648
4568
  /** The lines that make the density: the straight lines of the edges, or their first routes. */
3649
4569
  type RidgeSource = "lines" | "routes";
3650
4570
  /** The options of the highway strategy `ridges` (HWY-032 of the note on highways). */
@@ -3772,15 +4692,6 @@ type KeysOptions = Omit<TrunksOptions, "name" | "maxNodes">;
3772
4692
  * Each trunk and each run becomes one highway. The function does not change the router: it reads its bundles and its runs.
3773
4693
  */
3774
4694
  export declare function keysPlan(input: HighwayInput, options: KeysOptions): HighwayPlan;
3775
- /**
3776
- * The plan that a post step changes. `none` is the empty plan: `follow` then routes each edge as the router `corners` does.
3777
- * `shared-ways` and `corridors` are the plans of those highway strategies, with their defaults.
3778
- */
3779
- type HighwayBase = "none" | "shared-ways" | "corridors";
3780
- /** The values of `HighwayBase`. */
3781
- export declare const HIGHWAY_BASES: readonly HighwayBase[];
3782
- /** This function gives the plan of a base. */
3783
- export declare function basePlan(input: HighwayInput, base: HighwayBase): HighwayPlan;
3784
4695
  /** The options of the highway strategy `level-links` (HWY-056 with WILD-034 of the notes). */
3785
4696
  interface LevelHighwayOptions {
3786
4697
  /** The plan of the edges that do not ride a level link. The default is `shared-ways`. */
@@ -3888,49 +4799,6 @@ export declare function odGroups(input: HighwayInput, o: Readonly<OdCellOptions>
3888
4799
  * The terminals are the Weber points of the plugs in each cell. An edge with a leg longer than `legMax` times the span goes alone.
3889
4800
  */
3890
4801
  export declare function odCellPlan(input: HighwayInput, o: Readonly<OdCellOptions>): HighwayPlan;
3891
- /** The line of each edge that QuickBundles compares: its first route, or the straight line between its plugs. */
3892
- type BundleLine = "routes" | "lines";
3893
- /** The order of the edges in the one pass: the order of the graph, or the longest line first. */
3894
- type BundleOrder = "input" | "length";
3895
- /** The options of the highway strategy `quickbundles` (HWY-026 of the note on highways). */
3896
- interface QuickBundlesOptions {
3897
- /** An edge joins a cluster when its distance to the centroid is this value or less, in units of the board. The default is 3. */
3898
- readonly theta: number;
3899
- /** The number of points of each line after the resampling. The default is 12. */
3900
- readonly points: number;
3901
- /** The line of each edge. The default is `routes`. */
3902
- readonly line: BundleLine;
3903
- /** The order of the edges. The default is `input`, so an added edge does not change the clusters before it. */
3904
- readonly order: BundleOrder;
3905
- /** A cluster with this number of edges or more gets highways. The default is 2. */
3906
- readonly minSize: number;
3907
- /** The spine of each cluster. The default is `shared`. */
3908
- readonly spine: GroupSpine;
3909
- }
3910
- /** The default options of the strategy `quickbundles`. */
3911
- export declare const QUICKBUNDLES_DEFAULTS: Readonly<QuickBundlesOptions>;
3912
- /** This function gives `k` points at equal steps of length along a polyline, from its first point to its last point. */
3913
- export declare function resample(line: readonly Point[], k: number): Point[];
3914
- /**
3915
- * This function gives the MDF distance of two lines with the same number of points. It is the mean distance of their points.
3916
- * The function compares the points in the same direction and in the opposite direction, and keeps the smaller mean.
3917
- * `flip` is `true` when the opposite direction is smaller.
3918
- */
3919
- export declare function mdf(p: readonly Point[], q: readonly Point[]): {
3920
- d: number;
3921
- flip: boolean;
3922
- };
3923
- /**
3924
- * This function gives the clusters of QuickBundles (Garyfallidis 2012) as groups of edges.
3925
- * In one pass, each edge joins the cluster with the nearest centroid when the MDF distance is `theta` units or less. Else it starts a cluster.
3926
- * The centroid is the running mean of the lines of the cluster, each in the direction of the centroid.
3927
- */
3928
- export declare function quickBundles(input: HighwayInput, o: Readonly<QuickBundlesOptions>): Map<string, EdgeGroup>;
3929
- /**
3930
- * This function gives the highways of QuickBundles (HWY-026). The clusters of `quickBundles` with `minSize` edges or more get highways.
3931
- * With the spine `shared`, the edges of each cluster share their ways through the corner graph. With `trunk`, each cluster gets one trunk.
3932
- */
3933
- export declare function quickBundlesPlan(input: HighwayInput, o: Readonly<QuickBundlesOptions>): HighwayPlan;
3934
4802
  /** The options of the highway strategy `nested` (HWY-052 of the note on highways). */
3935
4803
  interface NestedOptions {
3936
4804
  /** The scale of the closest level, in units of the board. An edge joins a cluster when its distance to the centroid is this value or less. The default is 3. */
@@ -4442,6 +5310,26 @@ export declare const highwayStrategies: {
4442
5310
  readonly ridges: Strategy<"highway", RidgeOptions>;
4443
5311
  readonly hdbscan: Strategy<"highway", HdbscanOptions>;
4444
5312
  readonly "hub-arcs": Strategy<"highway", HubArcOptions>;
5313
+ readonly divided: Strategy<"highway", DividedOptions>;
5314
+ readonly hierarchy: Strategy<"highway", HierarchyOptions>;
5315
+ readonly fdeb: Strategy<"highway", FdebOptions>;
5316
+ readonly mesh: Strategy<"highway", MeshOptions>;
5317
+ readonly kdeeb: Strategy<"highway", KdeebOptions>;
5318
+ readonly cubu: Strategy<"highway", CubuOptions>;
5319
+ readonly mlseb: Strategy<"highway", MlsebOptions>;
5320
+ readonly sbeb: Strategy<"highway", SbebOptions>;
5321
+ readonly areas: Strategy<"highway", AreaOptions>;
5322
+ readonly confluent: Strategy<"highway", ConfluentOptions>;
5323
+ readonly power: Strategy<"highway", PowerOptions>;
5324
+ readonly crossbars: Strategy<"highway", CrossbarOptions>;
5325
+ readonly frechet: Strategy<"highway", FrechetOptions>;
5326
+ readonly spectral: Strategy<"highway", SpectralOptions>;
5327
+ readonly resistance: Strategy<"highway", ResistanceOptions>;
5328
+ readonly "link-communities": Strategy<"highway", LinkCommunityOptions>;
5329
+ readonly territories: Strategy<"highway", TerritoryOptions>;
5330
+ readonly consensus: Strategy<"highway", ConsensusOptions>;
5331
+ readonly "p-hub": Strategy<"highway", PHubOptions>;
5332
+ readonly "scale-space": Strategy<"highway", ScaleSpaceOptions>;
4445
5333
  readonly "corridors+breakeven": Strategy<"highway", CorridorOptions & BreakEvenOptions>;
4446
5334
  readonly "corridors+stretch": Strategy<"highway", CorridorOptions & StretchOptions>;
4447
5335
  readonly "corridors+ambiguity": Strategy<"highway", CorridorOptions & AmbiguityGuardOptions>;
@@ -4526,18 +5414,12 @@ export interface StepComparison {
4526
5414
  * The same graph and the same options give the same measures. Only the times change.
4527
5415
  */
4528
5416
  export declare function compareStep(step: CompareStep, graph: Graph, options?: CompareOptions): StepComparison;
4529
- /** This function gives the bytes of a string in UTF-8. */
5417
+ /** This function gives the bytes of a string in UTF-8. The contract does not export its own `utf8`, so the core keeps this function. */
4530
5418
  export declare function utf8(text: string): Uint8Array;
4531
- /** This function gives the SHA-256 digest of a string, as 64 lowercase hex characters. It encodes the string in UTF-8. */
4532
- export declare function sha256Hex(text: string): string;
4533
- /**
4534
- * This function writes a value as canonical JSON: the keys of each object in sorted order, and no whitespace.
4535
- * It drops a key whose value is `undefined`, as `JSON.stringify` does.
4536
- */
4537
- export declare function canonicalJson(value: unknown): string;
4538
5419
  /**
4539
5420
  * This function gives the hash of a JSON document: the first 16 hex characters of the SHA-256 of its canonical JSON.
4540
5421
  * The document does not include its own field `hash`. The function removes that field before it calculates the hash.
5422
+ * The `documentHash` of the contract puts each number on a grid first, so it is not equal to this function. The hashes of the corpus files use this function.
4541
5423
  */
4542
5424
  export declare function documentHash(value: object): string;
4543
5425
  /** This function gives the 32-bit FNV-1a hash of the UTF-8 bytes of a text, as an unsigned integer. */
@@ -4546,7 +5428,7 @@ export declare function fnv1a32(text: string): number;
4546
5428
  export declare function stepSeed(seed: number, step: string): number;
4547
5429
  /** This function gives the generator `mulberry32` for a seed. Each call gives the next number from 0 to below 1. */
4548
5430
  export declare function mulberry32(seed: number): () => number;
4549
- /** This function rounds a number to 3 decimals, as the files of a corpus keep it. The value `-0` becomes `0`. */
5431
+ /** This function rounds a number to 3 decimals (a step of `RECORD_EPS`), as the files of a corpus keep it. The value `-0` becomes `0`. */
4550
5432
  export declare function round3(value: number): number;
4551
5433
  /** The side of a port in an input file. The router calls the same sides `north`, `east`, `south` and `west`. */
4552
5434
  export type LayoutSide = "top" | "right" | "bottom" | "left";
@@ -4738,6 +5620,19 @@ export interface LayoutRecord {
4738
5620
  readonly commit?: string;
4739
5621
  /** The reason when the strategy did not run, for example an input over its `maxNodes`. Then the record has no measures. */
4740
5622
  readonly skipped?: string;
5623
+ /**
5624
+ * The first 16 hex characters of the SHA-256 of the output in the highways form (ACTIVATION). `resultHash` gives it for a router.
5625
+ * Two records with the same hash have the same output, at the precision `RECORD_EPS`.
5626
+ */
5627
+ readonly outputHash?: string;
5628
+ /** The facts of the stages of the run. The trace measures `move.<name>` count the own move of the strategy (ACTIVATION). */
5629
+ readonly trace?: readonly RecordTrace[];
5630
+ }
5631
+ /** The facts of one stage of a run, as the `StageTrace` of the contract: its id, its time and its trace measures. */
5632
+ export interface RecordTrace {
5633
+ readonly id: string;
5634
+ readonly ms?: number;
5635
+ readonly measures?: Readonly<Record<string, number>>;
4741
5636
  }
4742
5637
  /** The comparison of a prediction. Without it, `<=` applies to a measure where lower is better, and `>=` to the other measures. */
4743
5638
  export type PredictionOp = "<" | "<=" | "=" | ">=" | ">";
@@ -4797,6 +5692,21 @@ export declare function parseLines<T>(text: string): T[];
4797
5692
  * A function becomes the text `function:<name>`, and a number that is not finite becomes its text.
4798
5693
  */
4799
5694
  export declare function jsonSafe(value: unknown): unknown;
5695
+ /**
5696
+ * The smallest change of a measure that counts as better or worse (WIN-RES).
5697
+ * A number is an absolute change. `{ rel }` is a share of the larger of the two absolute values.
5698
+ * The threshold is not less than `RECORD_EPS` at any time.
5699
+ */
5700
+ export type MinEffect = NonNullable<MeasureSpec["minEffect"]>;
5701
+ /** The result of a compare of a candidate with a baseline on one measure. A tie is not a win. It is the `Verdict` of the contract. */
5702
+ export type MeasureCompare = Verdict;
5703
+ /** The part of a measure that a compare reads: the better side and the minimum effect. */
5704
+ export type CompareSpec = Pick<MeasureSpec, "direction" | "minEffect">;
5705
+ /**
5706
+ * This function applies the wave rule to the compares of one board, for example of `B1` and of the `B3` q95.
5707
+ * The board is a win only when no compare is `worse` and one or more compares are `better`. Thus a board of ties is not a win.
5708
+ */
5709
+ export declare function boardWins(compares: readonly MeasureCompare[]): boolean;
4800
5710
  /**
4801
5711
  * One measure of a record. `key` is the key of the measure in the values of `runSuite` and `compareStep`.
4802
5712
  * `name` is the name of the measure in a record of the form `layout-record/1`.
@@ -4815,13 +5725,32 @@ export interface MeasureInfo {
4815
5725
  * Then two values compare only on the same input. The value is `false` when the measure scores the routes or the curves for a fixed placement.
4816
5726
  */
4817
5727
  readonly placementDependent: boolean;
5728
+ /**
5729
+ * The smallest change that counts as better or worse in `compareMeasure` (WIN-RES). `MIN_EFFECTS` gives it by the unit, with its reason.
5730
+ * A measure without this field has the threshold `RECORD_EPS`.
5731
+ */
5732
+ readonly minEffect?: MinEffect;
5733
+ }
5734
+ /** One rule of `MIN_EFFECTS`: the units, the minimum effect of a measure with one of these units, and the reason. */
5735
+ export interface MinEffectRule {
5736
+ readonly units: readonly string[];
5737
+ /** The minimum effect. The value `undefined` gives the threshold `RECORD_EPS`. */
5738
+ readonly minEffect: MinEffect | undefined;
5739
+ readonly reason: string;
4818
5740
  }
5741
+ /**
5742
+ * The minimum effect of each measure of `MEASURES`, by the unit of the measure (WIN-RES).
5743
+ * Each unit of `MEASURES` is in one rule. The test of the module checks it.
5744
+ */
5745
+ export declare const MIN_EFFECTS: readonly MinEffectRule[];
4819
5746
  /**
4820
5747
  * The measures of the records of the stage `route`, with the placement dependence of each one.
4821
5748
  * A joint harness that moves the boxes and routes the edges reads `placementDependent`.
4822
5749
  * It compares a measure with the value `true` only between runs on the same input.
4823
5750
  */
4824
5751
  export declare const MEASURES: readonly MeasureInfo[];
5752
+ /** This function gives the spec of a compare of a measure: its better side and its minimum effect. */
5753
+ export declare function compareSpec(info: MeasureInfo): CompareSpec;
4825
5754
  /** This function gives the measure of a key of `runSuite` or `compareStep`, or `undefined` for a key that is not in `MEASURES`. */
4826
5755
  export declare function measureByKey(key: string): MeasureInfo | undefined;
4827
5756
  /** This function gives the measure of a name of a record, or `undefined` for a name that is not in `MEASURES`. */
@@ -4857,7 +5786,7 @@ export interface ScreenSet {
4857
5786
  * This set does not change. The tests compare it with the files in `corpus/screen-v1`.
4858
5787
  */
4859
5788
  export declare const SCREEN_V1: ScreenSet;
4860
- /** The screen sets by id. */
5789
+ /** The screen sets by id: `screen-v1`, the small boards with a known optimum `exact-v1` (MEAS2), and the larger boards with bounds `exact-v1-bounds` (EXACT-BOUNDS). */
4861
5790
  export declare const SCREEN_SETS: Readonly<Record<string, ScreenSet>>;
4862
5791
  /** This function gives the id of the member `seed` of a family of a set: `<set>/<family>/s<seed>`. */
4863
5792
  export declare function inputId(set: string, family: string, seed: number): string;
@@ -4883,6 +5812,257 @@ export interface LayoutCorpus {
4883
5812
  }
4884
5813
  /** This function gives the manifest of a list of inputs. The inputs of one generator, version and parameters share one spec. */
4885
5814
  export declare function corpusManifest(corpus: string, inputs: readonly LayoutInput[]): LayoutCorpus;
5815
+ /**
5816
+ * This function gives the output hash of a result of a router, in the highways form.
5817
+ * The form holds the routes in the order of the edge ids, and the levels, the bundles and the runs as the router gives them.
5818
+ * Each number goes to the grid `RECORD_EPS`, as `round3` does.
5819
+ */
5820
+ export declare function resultHash(result: Result): string;
5821
+ /** This function gives the highways form of a result of a router: the value that `resultHash` hashes. */
5822
+ export declare function resultForm(result: Result): object;
5823
+ /** This function gives the output hash of the curves of the step `curve`, in the order of the edge ids. */
5824
+ export declare function curvesHash(edges: readonly string[], curves: readonly (readonly CurveSegment[])[]): string;
5825
+ /**
5826
+ * The name of the own move of each built-in highway finder. The trace of a record names the count `move.<name>`.
5827
+ * The count is the number of highways of the plan with 2 edges or more. A finder without an entry counts `move.highway`.
5828
+ */
5829
+ export declare const MOVE_NAMES: Readonly<Record<string, string>>;
5830
+ /**
5831
+ * The highway strategies that change the plan of another strategy (`from`). Their own move is a change of that plan, so they count no move.
5832
+ * The output against the plan `from` tells if they ran.
5833
+ */
5834
+ export declare const PLAN_CHANGERS: readonly string[];
5835
+ /**
5836
+ * This function gives the built-in highway strategy of a name: the strategy itself, or the strategy of a variant, for example `power` for `power-near`.
5837
+ * It gives `undefined` for a gate (a name with `+`) and for a name of another step.
5838
+ */
5839
+ export declare function finderOf(name: string): string | undefined;
5840
+ /**
5841
+ * This function gives the count of the own move of a highway strategy on its plan, for example `{ "move.powerEdge": 3 }`.
5842
+ * It gives `undefined` for a gate and for a strategy of `PLAN_CHANGERS`.
5843
+ */
5844
+ export declare function planMoves(name: string, plan: HighwayPlan): Record<string, number> | undefined;
5845
+ /** A function that gives the own move counts of a strategy on a graph, or `undefined` for a strategy without a count. */
5846
+ export type MoveCounter = (strategy: string, graph: Graph) => Readonly<Record<string, number>> | undefined;
5847
+ /** This function gives a `MoveCounter` for highway strategies, by the names of the records. It makes the plan of the strategy again. */
5848
+ export declare function highwayMoves(strategies: Readonly<Record<string, Strategy<"highway", object>>>): MoveCounter;
5849
+ /**
5850
+ * This function gives the base of a strategy for the fallback test: the strategy that it falls back to or extends.
5851
+ * - A gate `X+G` and a wrapped router `X+W` have the base `X`.
5852
+ * - A highway finder of a module (`hw:power`, `w3e:power-near`) has the base `hw:none`, the empty plan.
5853
+ * - A plan changer has the base of its plan `from`: `hw:shared-ways`, or `hw:corridors` and `hw:none` for a name that ends with `-corridors` and `-none`.
5854
+ * - An option of a router (`shared-cap-3`, `shared-all-p3`, `trunks-tree-bf02`, `corners-side`) has the base `shared`, `shared-all`, `trunks` or `corners`.
5855
+ * The function gives `undefined` when the base is not in `known`.
5856
+ */
5857
+ export declare function activationBase(name: string, known: ReadonlySet<string>): string | undefined;
5858
+ /** The activation of one strategy over the decision inputs of a screen. */
5859
+ export interface ActivationRow {
5860
+ readonly strategy: string;
5861
+ /** The base of the fallback test, or `undefined` when the strategy has none. */
5862
+ readonly base?: string;
5863
+ /** The decision inputs where the strategy ran. */
5864
+ readonly inputs: number;
5865
+ /** The decision inputs where a move count is above 0. */
5866
+ readonly moved: readonly string[];
5867
+ /** The decision inputs where the output differs from the output of the base. */
5868
+ readonly differs: readonly string[];
5869
+ /** The sum of each move count over the decision inputs. */
5870
+ readonly moves: Readonly<Record<string, number>>;
5871
+ readonly verdict: "exercised" | "not-exercised";
5872
+ /** The id of the output group of the strategy on the decision inputs. */
5873
+ readonly group: string;
5874
+ }
5875
+ /** The groups of the strategies with equal output on each input of one cell (a family of boards). They are diagnostics only. */
5876
+ export interface CellGroups {
5877
+ readonly cell: string;
5878
+ readonly groups: readonly OutputGroup[];
5879
+ }
5880
+ /** The activation report of a screen. */
5881
+ export interface ActivationReport {
5882
+ /** The decision inputs, in sorted order. */
5883
+ readonly inputs: readonly string[];
5884
+ readonly rows: readonly ActivationRow[];
5885
+ /** The output groups with more than one strategy: equal output hashes on each decision input. */
5886
+ readonly groups: readonly OutputGroup[];
5887
+ /** The cell groups with more than one strategy, for each family of the decision inputs. */
5888
+ readonly cells: readonly CellGroups[];
5889
+ }
5890
+ /** This function gives the family of an input id, for example `small-clustered` for `screen-v1/small-clustered/s0`. */
5891
+ export declare function familyOf(input: string): string;
5892
+ /** This function gives the move counts of a record, from its trace. */
5893
+ export declare function recordMoves(record: LayoutRecord): Record<string, number>;
5894
+ /**
5895
+ * This function gives the activation report of the records of a screen.
5896
+ * A strategy is exercised when a move count is above 0 on a decision input.
5897
+ * It is also exercised when its output differs from the output of its base on a decision input.
5898
+ * The decision inputs are the inputs of the families `families`, or each input. `bases` gives the base of each strategy, or `activationBase` gives it.
5899
+ */
5900
+ export declare function activationReport(records: readonly LayoutRecord[], options?: {
5901
+ readonly families?: readonly string[];
5902
+ readonly bases?: Readonly<Record<string, string>>;
5903
+ }): ActivationReport;
5904
+ /** This function writes the activation report as Markdown: the strategies that are not exercised, and the output groups. */
5905
+ export declare function formatActivation(report: ActivationReport, candidates?: ReadonlySet<string>): string;
5906
+ /** The rule of the exact model: `collection` lets only the edges of one collection share a link, and `all` lets each edge share a link. */
5907
+ export type GapRule = "collection" | "all";
5908
+ /** The rules of the gap closed, in the order of the records. */
5909
+ export declare const GAP_RULES: readonly GapRule[];
5910
+ /**
5911
+ * A view of the gap closed: one rule, or `chosen`. The view `chosen` takes a rule for each run.
5912
+ * It takes `all` when a shared segment of the run holds edges of two collections. Else it takes `collection`.
5913
+ */
5914
+ export type GapView = GapRule | "chosen";
5915
+ /** The views of the gap closed, in the order of the tables. */
5916
+ export declare const GAP_VIEWS: readonly GapView[];
5917
+ /** The stretch caps of the exact optima, from small to large. */
5918
+ export declare const GAP_CAPS: readonly number[];
5919
+ /** The baseline of each rule: the router `shared` for `collection`, and the plan `shared-ways-all` after `follow` for `all`. */
5920
+ export declare const GAP_BASELINES: Readonly<Record<GapRule, string>>;
5921
+ /** The parameters of the paired bootstrap of the gap closed, from `docs/PROMOTION.md`. */
5922
+ export declare const GAP_BOOTSTRAP: {
5923
+ readonly runs: number;
5924
+ readonly level: number;
5925
+ readonly seed: number;
5926
+ };
5927
+ /** The optimum of the exact model on one input, for one rule and one stretch cap. The file of the optima of a set holds one for each. */
5928
+ export interface ExactOptimum {
5929
+ /** The id of the input. */
5930
+ readonly input: string;
5931
+ /** The hash of the input file. The screen uses the optimum only when the hash matches. */
5932
+ readonly hash: string;
5933
+ /** The class of the input: its family in the set. */
5934
+ readonly class: string;
5935
+ readonly nodes: number;
5936
+ readonly edges: number;
5937
+ readonly rule: GapRule;
5938
+ readonly cap: number;
5939
+ /** The status of HiGHS: `optimal`, `time-limit` or another status. */
5940
+ readonly status: string;
5941
+ /** This value is `true` when HiGHS proved the optimum within the time limit. */
5942
+ readonly proven: boolean;
5943
+ /** The objective of the best solution, the dual bound and the relative MIP gap. Each one is `null` when HiGHS gives none. */
5944
+ readonly objective: number | null;
5945
+ readonly bound: number | null;
5946
+ readonly mipGap: number | null;
5947
+ /** The time of the solve, in seconds. */
5948
+ readonly seconds: number;
5949
+ /** The number of binary variables of the model. */
5950
+ readonly binaries: number;
5951
+ /** The ink saved (B1) of the routes of the best plan after `follow`. The gap closed uses this value. */
5952
+ readonly b1: number | null;
5953
+ /** The ink saved of the model itself, without `follow`. */
5954
+ readonly modelB1: number | null;
5955
+ /** The largest bundle stretch (B3) of the routes of the best plan, against the routes of `corners`. */
5956
+ readonly b3max: number | null;
5957
+ /** The number of highways of the best plan. */
5958
+ readonly highways: number;
5959
+ }
5960
+ /** The file of the optima of a set (`exact-optima/1`). Later screens read it and do not solve again. */
5961
+ export interface ExactOptimaFile {
5962
+ readonly schema: "exact-optima/1";
5963
+ readonly set: string;
5964
+ /** The time limit of each solve, in seconds. */
5965
+ readonly seconds: number;
5966
+ /** The commit of the code and the CI run of the solves. */
5967
+ readonly commit?: string;
5968
+ readonly run?: string;
5969
+ readonly optima: readonly ExactOptimum[];
5970
+ }
5971
+ /** This function gives the file of the optima of a set, with the rows in the order of the input, the rule and the cap. */
5972
+ export declare function optimaFile(set: string, rows: readonly ExactOptimum[], at: {
5973
+ readonly seconds: number;
5974
+ readonly commit?: string;
5975
+ readonly run?: string;
5976
+ }): ExactOptimaFile;
5977
+ /** This function gives the key of an optimum in a map: the input, the rule and the cap. */
5978
+ export declare function optimumKey(input: string, rule: GapRule, cap: number): string;
5979
+ /** This function gives the smallest cap that is at least the stretch, or `undefined` when the stretch is above the largest cap. */
5980
+ export declare function gapCap(stretch: number, caps?: readonly number[]): number | undefined;
5981
+ /**
5982
+ * This function gives the gap closed: `(b1 - base) / (optimum - base)`.
5983
+ * It gives `undefined` when the denominator is 0 or less, because then the baseline is at the optimum or above it.
5984
+ */
5985
+ export declare function gapClosed(b1: number, base: number, optimum: number): number | undefined;
5986
+ /**
5987
+ * This function gives the largest bundle stretch of routes against base routes: the max of `L(r_e) / L(r*_e)` over the edges, as B3 counts them.
5988
+ * An edge without a base route, or with a base route of 1 unit or less, does not count. Without such an edge, the value is 1.
5989
+ */
5990
+ export declare function maxStretch(routes: readonly Route[], base: readonly Route[]): number;
5991
+ /** The highway strategy `shared-ways-all`: the plan of the router `shared` without a rule. It is the baseline of the rule `all`. */
5992
+ export declare const sharedWaysAll: Strategy<"highway", object>;
5993
+ /** This function gives the B1 of the baseline of each rule on a graph. */
5994
+ export declare function gapBaselines(graph: Graph): Record<GapRule, number>;
5995
+ /** A median with its paired bootstrap interval. */
5996
+ export interface BootstrapMedian {
5997
+ readonly median: number;
5998
+ readonly lo: number;
5999
+ readonly hi: number;
6000
+ }
6001
+ /**
6002
+ * This function gives the median of the values and its bootstrap interval: `runs` samples of the values with replacement, from the seed `seed`.
6003
+ * The interval is the central `level` share of the medians of the samples. Each value is the paired value of one input, so the bootstrap is paired.
6004
+ */
6005
+ export declare function bootstrapMedian(values: readonly number[], o?: {
6006
+ readonly runs?: number;
6007
+ readonly level?: number;
6008
+ readonly seed?: number;
6009
+ }): BootstrapMedian;
6010
+ /** The gap closed of one strategy and one view over the inputs of a screen. */
6011
+ export interface GapSummary {
6012
+ readonly strategy: string;
6013
+ readonly rule: GapView;
6014
+ /** The number of runs, and the number of runs with a value. A run has no value above the largest cap, or without a proven optimum. */
6015
+ readonly runs: number;
6016
+ readonly values: number;
6017
+ /** The median over the inputs with a value, and its paired bootstrap interval. */
6018
+ readonly median: number;
6019
+ readonly lo: number;
6020
+ readonly hi: number;
6021
+ /** The median of each class, by the family of the input. */
6022
+ readonly byClass: Readonly<Record<string, number>>;
6023
+ /** The number of values at each cap, by the cap. */
6024
+ readonly caps: Readonly<Record<string, number>>;
6025
+ /** The number of runs with some ink saved (B1 above 0): the runs where the strategy builds a shared segment. */
6026
+ readonly builds: number;
6027
+ /** The number of runs where a shared segment holds edges of two collections. */
6028
+ readonly mixed: number;
6029
+ }
6030
+ /** The names of the measures of the gap closed in a record, for a view. */
6031
+ export declare function gapNames(view: GapView): {
6032
+ readonly gap: string;
6033
+ readonly cap: string;
6034
+ };
6035
+ /**
6036
+ * This function gives the gap closed of each strategy and view over records.
6037
+ * It sorts them by the view and then by the median, from high to low.
6038
+ * A strategy with a value on fewer than half of its runs comes after the others, because its median shows only a few inputs.
6039
+ */
6040
+ export declare function summarizeGap(records: readonly {
6041
+ readonly strategy: string;
6042
+ readonly input: string;
6043
+ readonly skipped?: string;
6044
+ readonly measures: Readonly<Record<string, number>>;
6045
+ }[]): GapSummary[];
6046
+ /** This function writes the gap closed as Markdown: one table for each view, sorted by the median. */
6047
+ export declare function formatGap(rows: readonly GapSummary[]): string;
6048
+ /** This function gives the count of the shared segments of a result (the runs and the bundles) that hold edges of two collections or more. */
6049
+ export declare function mixedSegments(graph: Graph, result: Result): number;
6050
+ /** This function tells if a shared segment of a result (a run or a bundle) holds edges of two collections. */
6051
+ export declare function mixesCollections(graph: Graph, result: Result): boolean;
6052
+ /**
6053
+ * This function gives the gap measures of the result of one run on an input with optima, by the keys of `MEASURES`.
6054
+ * `B3.max` is the largest stretch against the routes of `corners`. `gap.stretch` is the largest stretch as the exact model counts it (`exactStretch`).
6055
+ * The cap is the smallest cap at or above `gap.stretch`, so both sides of the gap have the same stretch limit.
6056
+ *
6057
+ * `gap.<rule>` is the gap closed at the cap `gap.cap.<rule>`. `gap` is the gap closed of the rule of the run.
6058
+ * That rule is `all` when `gap.mixed` is 1, else `collection`.
6059
+ * A rule has no value above the largest cap or without a proven optimum at the cap.
6060
+ * It also has no value when the hash of the optimum is not the hash of the input.
6061
+ */
6062
+ export declare function gapValues(input: {
6063
+ readonly id: string;
6064
+ readonly hash: string;
6065
+ }, graph: Graph, result: Result, corners: readonly Route[], baselines: Readonly<Record<GapRule, number>>, optima: ReadonlyMap<string, ExactOptimum>): Record<string, number>;
4886
6066
  /**
4887
6067
  * The steps of the screen: the steps of `compareStep` and the step `highway`.
4888
6068
  * The screen of the step `highway` routes the plan of each strategy with `follow`, and measures the routes as the routes of a router.
@@ -4945,6 +6125,16 @@ export interface ScreenOptions {
4945
6125
  readonly commit?: string;
4946
6126
  /** The predictions of the run. Each record names the first prediction with its strategy, its set and its input. */
4947
6127
  readonly predictions?: readonly LayoutPrediction[];
6128
+ /**
6129
+ * The exact optima of the inputs, from the file of the optima of a set (MEAS2). The steps `router` and `highway` read them.
6130
+ * Each run on an input with optima gets the largest B3 and the gap closed of each rule (B10). The summary then gets the gap table.
6131
+ */
6132
+ readonly optima?: readonly ExactOptimum[];
6133
+ /**
6134
+ * This function gives the own move counts of a strategy on an input (ACTIVATION), for example `{ "move.powerEdge": 3 }`.
6135
+ * Each record of a strategy with counts gets them as the trace measures of its step. The default is no counts.
6136
+ */
6137
+ readonly moves?: MoveCounter;
4948
6138
  /** This function gets one line of progress for each input. */
4949
6139
  readonly log?: (line: string) => void;
4950
6140
  }
@@ -4998,6 +6188,8 @@ export interface ScreenSummary {
4998
6188
  /** The strategies with a break over the floor, without a run or with two different outputs of one input. They do not enter the front. */
4999
6189
  readonly excluded: readonly string[];
5000
6190
  readonly predictions: readonly PredictionCheck[];
6191
+ /** The gap closed of each strategy and rule, when the screen has optima. */
6192
+ readonly gap?: readonly GapSummary[];
5001
6193
  }
5002
6194
  /** The result of `screen`: one record for each strategy and input, and the summary. */
5003
6195
  export interface ScreenReport {
@@ -5033,6 +6225,48 @@ export interface RectScatteredParams {
5033
6225
  * The steps are `container`, `obstacles` and `boxes`. Each step has its own generator from `stepSeed`.
5034
6226
  */
5035
6227
  export declare function rectScattered(seed: number, params: RectScatteredParams, set?: string): LayoutInput;
6228
+ /** The board classes of the small boards with a known optimum (MEAS2). */
6229
+ export type ExactClass = "uniform" | "clustered" | "hubs" | "fanout";
6230
+ /** The board classes of `EXACT_V1`, in the order of the set. */
6231
+ export declare const EXACT_CLASSES: readonly ExactClass[];
6232
+ /** The edges of each node of a small board with a known optimum. */
6233
+ export declare const EXACT_EDGES_PER_NODE = 1.5;
6234
+ /** This function gives the seed of the fixture of the member `k` of a class: `100 × (the index of the class + 1) + k`. */
6235
+ export declare function exactSeed(cls: ExactClass, k: number): number;
6236
+ /** This function gives the generator of a small board: the generator `fixture` with the kind of the class, `nodes` and the seed of `exactSeed`. */
6237
+ export declare function exactGenerator(cls: ExactClass, nodes: number, k: number): LayoutGenerator;
6238
+ /** This function makes the small board of a class with `nodes` nodes and the member `k`. The same values always give the same graph. */
6239
+ export declare function exactBoard(cls: ExactClass, nodes: number, k: number): Graph;
6240
+ /**
6241
+ * This function gives a family of small boards of one class. The member `k` has `sizes[k mod sizes.length]` nodes.
6242
+ * The count of the cell is `10`, because each board has fewer than 100 nodes.
6243
+ */
6244
+ export declare function exactFamily(cls: ExactClass, sizes: readonly number[], seeds: number): ScreenFamily;
6245
+ /**
6246
+ * The node counts of the boards of `EXACT_V1`. The member `k` of each class has `EXACT_V1_SIZES[k mod length]` nodes.
6247
+ * The size ladder of MEAS2 (CI run 40613531631) proved each optimum at 10 nodes within 300 s, for each class, both rules and the cap 1.5.
6248
+ * At 14 nodes, 4 of 24 solves stopped at the time limit.
6249
+ */
6250
+ export declare const EXACT_V1_SIZES: readonly number[];
6251
+ /** The number of seeds of each class of `EXACT_V1`. It is `cellMin` of the promotion rule. */
6252
+ export declare const EXACT_V1_SEEDS = 10;
6253
+ /**
6254
+ * The screen set `exact-v1` (MEAS2): small boards of made-up data with a known optimum of the exact model.
6255
+ * It has 4 classes of 10 seeds. The file `optima-exact-v1.json` of `bench/exact` keeps the optimum of each input, each rule and each cap.
6256
+ * This set does not change. The tests compare it with the files in `corpus/exact-v1`.
6257
+ */
6258
+ export declare const EXACT_V1: ScreenSet;
6259
+ /** The node counts of the boards of `EXACT_V1_BOUNDS`. HiGHS proves few optima at these sizes within 300 s, so the set keeps bounds (EXACT-BOUNDS). */
6260
+ export declare const EXACT_V1_BOUNDS_SIZES: readonly number[];
6261
+ /** This function gives the name of the family of a class at a size in `EXACT_V1_BOUNDS`: `<class>-n<nodes>`. */
6262
+ export declare function boundsFamilyName(cls: ExactClass, nodes: number): string;
6263
+ /**
6264
+ * The screen set `exact-v1-bounds` (EXACT-BOUNDS): the boards of the classes of `exact-v1` at 18, 24 and 40 nodes, with 10 seeds each.
6265
+ * Each family is one class at one size. The member `k` uses the seed `exactSeed(class, k)`, as in `exact-v1`.
6266
+ * The file `optima-exact-v1-bounds.json` of `bench/exact` keeps the best bound and the best solution of each input, each rule and each cap.
6267
+ * This set does not change. The tests compare it with the files in `corpus/exact-v1-bounds`.
6268
+ */
6269
+ export declare const EXACT_V1_BOUNDS: ScreenSet;
5036
6270
  /** The options of `follow`. */
5037
6271
  interface FollowOptions extends WayOptions {
5038
6272
  /**
@@ -5109,6 +6343,41 @@ interface SharedStretchOptions {
5109
6343
  * The `seq` of each member follows the order of the stretches along the way.
5110
6344
  */
5111
6345
  export declare function sharedStretches(ways: readonly KeyedWay[], o: Readonly<SharedStretchOptions>): HighwayPlan;
6346
+ /** The options of `tracePlan`. */
6347
+ interface TraceOptions {
6348
+ /** The side of the grid that the waypoints snap to, in units of the board. The value 0 keeps each waypoint where it is. */
6349
+ readonly snap: number;
6350
+ /** A highway has this number of edges or more. The value is 2 or more. */
6351
+ readonly minSize: number;
6352
+ /** The key of the ways. Only the ways with one key share a highway. */
6353
+ readonly key: string;
6354
+ }
6355
+ /**
6356
+ * This function moves a point out of each box, made larger by `pad`. A point in a box moves to the nearest side of that box.
6357
+ * The function tries four times, so a point between two near boxes can stay in a box.
6358
+ */
6359
+ export declare function outOfBoxes(obstacles: Obstacles, p: Point, pad: number): Point;
6360
+ /**
6361
+ * This function gives the push of the boxes on a point. Each box nearer than `reach` adds a unit vector away from it, times `(reach - d) / reach`.
6362
+ * The value `d` is the distance from the point to the box. It is the gradient of a field that is 0 at the distance `reach` from each box.
6363
+ */
6364
+ export declare function boxPush(obstacles: Obstacles, p: Point, reach: number): Point;
6365
+ /** This function gives points at equal steps of `step` or a little less along a polyline, without its two ends. A polyline without length gives no point. */
6366
+ export declare function innerPoints(line: readonly Point[], step: number): Point[];
6367
+ /**
6368
+ * This function gives the way of one edge through its waypoints. The way starts at `a` and ends at `b`.
6369
+ * Each waypoint snaps to the grid of side `snap`. A waypoint in a box moves to the nearest corner of the corner graph.
6370
+ * From each waypoint to the next one, the way is a straight line when that line is clear. Otherwise it goes through the corner graph.
6371
+ * A waypoint that the graph does not reach is not on the way. When the way cannot reach `b`, the function gives the way of the corner graph from `a` to `b`.
6372
+ */
6373
+ export declare function waypointWay(finder: WayFinder, a: Point, b: Point, waypoints: readonly Point[], snap: number): Point[] | undefined;
6374
+ /**
6375
+ * This function gives the highways of the waypoints of each edge. The ways go through the corner graph, so they stay out of the boxes.
6376
+ * Each edge goes from the point at `margin` from its source plug, through its waypoints, to the point at `margin` from its target plug.
6377
+ * Each stretch that `minSize` ways or more share is one highway, with the needless corners removed.
6378
+ * An edge without waypoints takes its way of the corner graph.
6379
+ */
6380
+ export declare function tracePlan(input: HighwayInput, finder: WayFinder, waypoints: ReadonlyMap<string, readonly Point[]>, o: Readonly<TraceOptions>): HighwayPlan;
5112
6381
  /**
5113
6382
  * This function gives the graph with its edges in the stable order of WILD-053: by the FNV-1a hash of the id, then by the id.
5114
6383
  * The nodes and the edges do not change. Two orders of the same edges give the same graph.
@@ -5217,5 +6486,145 @@ export declare function withRepair(router: Router, options?: RepairOptions): Rou
5217
6486
  * The new strategy has the name `<name>+repair`, and the options and the schema of `strategy`. The strategy `strategy` does not change.
5218
6487
  */
5219
6488
  export declare function repairStrategy<O extends object>(strategy: Strategy<"router", O>, repair?: RepairOptions): Strategy<"router", O>;
5220
- export type { AmbiguityGuardOptions, ArcOptions, ArcSource, BreakEvenOptions, BundleLine, BundleOrder, CandidateSource, ClothoidOptions, CornersOptions, CorridorOptions, CurveSpace, CutObjective, CutOptions, DensityImage, DiffusionOptions, EdgeDistance, EdgeGroup, EdgeLengths, EdgePathOptions, EdgePlugs, FieldEnd, FlowClusterOptions, FlowFieldOptions, FollowOptions, Gate, GroupSpine, GroupedOptions, GrowthOptions, GrowthOrder, HdbscanOptions, Highway, HighwayBase, HighwayInput, HighwayMember, HighwayOptions, HighwayPlan, HoughOptions, HoughPeak, HubArcOptions, HysteresisOptions, JogStyle, KdAxis, KdLine, KdOptions, KeyOptions, KeyedWay, KeysOptions, LaneCurve, LanesOptions, LevelHighwayOptions, Linkage, MeetOptions, MingleOptions, NestedOptions, NodeKey, OdCellOptions, PathStep, QuickBundlesOptions, Ridge, RidgeOptions, RidgeSource, RoadClassOptions, RoomBends, RoundedOptions, RouteSegment, SectionsOptions, SelectOptions, ShareCost, ShareMerge, ShareOrder, SharedOptions, SharedStretchOptions, SharedWaysOptions, SmoothOptions, SnapLine, SnapMember, SnapOptions, SoftKeyOptions, SpiralNode, SpiralOptions, SplineOptions, SplitCell, StableIdOptions, StretchOptions, StubEnds, StubOptions, TraclusOptions, TrunkFan, TrunkSplit, TrunksOptions, WeiszfeldOptions, WspdOptions, Zip, ZipLimits, ZipperOptions };
6489
+ /** The rule of the caller. Under `collection`, a shared segment holds edges of one collection only. Under `all`, collections can mix. */
6490
+ export type PortfolioRule = "collection" | "all";
6491
+ /** The stretch caps of the portfolio router: the caps of the gap closed (B10). */
6492
+ export type PortfolioCap = 1.1 | 1.25 | 1.5;
6493
+ /** The rules of the portfolio router. */
6494
+ export declare const PORTFOLIO_RULES: readonly PortfolioRule[];
6495
+ /** The caps of the portfolio router. */
6496
+ export declare const PORTFOLIO_CAPS: readonly PortfolioCap[];
6497
+ /** The sizes of the sets of the portfolio router, without the base. */
6498
+ export declare const PORTFOLIO_KS_API: readonly (3 | 5 | 8)[];
6499
+ /** One size band of the inputs. Each band has its own greedy sets. */
6500
+ export interface PortfolioBand {
6501
+ readonly id: string;
6502
+ /** The largest node count of the band. An input with more nodes than the last band uses the last band. */
6503
+ readonly maxNodes: number;
6504
+ }
6505
+ /** The size bands: up to 12 nodes, 13 to 24 nodes, and 25 to 40 nodes. An input above 40 nodes uses the band `n25-40`. */
6506
+ export declare const PORTFOLIO_BANDS: readonly PortfolioBand[];
6507
+ /** This function gives the band of a node count: the first band whose `maxNodes` is the count or more, else the last band. */
6508
+ export declare function portfolioBand(nodes: number, bands?: readonly PortfolioBand[]): PortfolioBand;
6509
+ /**
6510
+ * The fit of each rule, cap and size band, by the key `<rule>|<cap>|<band>`: the members of the default of the portfolio router, in their order.
6511
+ * Each member has a node limit: it runs only on an input with that many nodes or fewer. The limits keep the model time at or below 40 ms.
6512
+ * The base `shared` is not in a fit: the portfolio always runs it first.
6513
+ */
6514
+ export declare const PORTFOLIO_FIT: Readonly<Record<`${PortfolioRule}|${PortfolioCap}|${string}`, readonly (readonly [string, number])[]>>;
6515
+ /** The id of the B1 level of the key of the portfolio router. */
6516
+ export declare const PORTFOLIO_B1 = "B1";
6517
+ /** This function gives the spec of the B1 level: higher is better, with the `minEffect` of the row `B1.inkSaved` of the table `MEASURES`. */
6518
+ export declare function portfolioB1Spec(): CompareSpec;
6519
+ /** The facts of one output that the guard reads. The router takes them from the output, and the script `portfolio.ts` from a record. */
6520
+ export interface PortfolioFacts {
6521
+ /** The count of the breaks of each hard rule. */
6522
+ readonly hard: Readonly<Record<string, number>>;
6523
+ /** The count of the edges with a stretch above each cap, by the cap. The largest stretch of a record gives 1 or 0. */
6524
+ readonly over: (cap: number) => number;
6525
+ /** The count of the shared segments that hold edges of two collections. */
6526
+ readonly mixed: number;
6527
+ }
6528
+ /**
6529
+ * This function gives the count of the breaks of the guard of an output against the base, with the rule `rule` and the cap `cap`.
6530
+ * The count is the sum of three parts:
6531
+ * - for each hard rule, the breaks above the breaks of the base
6532
+ * - the edges with a stretch above the cap
6533
+ * - under the rule `collection`, the mixed segments.
6534
+ * An output passes the guard when the count is 0.
6535
+ */
6536
+ export declare function guardBreaks(facts: PortfolioFacts, base: PortfolioFacts | undefined, rule: PortfolioRule, cap: number): number;
6537
+ /**
6538
+ * This function gives the function of the facts of the outputs on the graph `graph`. It builds the network of the stretch one time for the graph.
6539
+ * The hard rules are the rules of `checkProperties`. The stretch is the stretch of the exact model, as the records of the gap screen give it.
6540
+ */
6541
+ export declare function portfolioFacts(graph: Graph): (result: Result) => PortfolioFacts;
6542
+ /**
6543
+ * This function gives the key of the portfolio router on the graph `graph`, with the rule `rule` and the cap `cap`.
6544
+ * - `hard` is `guardBreaks` against the output of the base. `base` gives that output after the base runs. The output of the base has 0 breaks.
6545
+ * Before the base runs, or when the base throws, a member has its own breaks of the hard rules.
6546
+ * - The one level `B1` is the ink saved (higher is better), with the `minEffect` of the table `MEASURES`.
6547
+ * - The hash is `resultHash`.
6548
+ * The winner is the first member with the most B1 of the members with 0 breaks (`selectBest`). The base has 0 breaks, so a member that fails the guard does not win.
6549
+ */
6550
+ export declare function portfolioKey(graph: Graph, rule: PortfolioRule, cap: PortfolioCap, base?: () => Result | undefined): PortfolioKey<Graph, Result>;
6551
+ /** The name of a built-in highway strategy. */
6552
+ type HighwayName = keyof typeof highwayStrategies;
6553
+ /**
6554
+ * The form of one member:
6555
+ * - `["shared", options]`, `["trunks", options]` or `["corners", options]`: the router with the options. `shared` and `trunks` use the rule `byCollection`.
6556
+ * - `["highway", name]`: the built-in highway strategy `name`, or `shared-ways-all`, with `follow`.
6557
+ * - `["gate", name, gate, budget?]`: the built-in highway strategy with the gate `stretch`, `breakeven` or `ambiguity`. `budget` sets the budget of the gate `stretch`.
6558
+ * - `["plan", name, options]`: the plan of the built-in highway strategy `name` with other options.
6559
+ */
6560
+ export type MemberForm = readonly ["shared", Omit<SharedOptions, "name" | "rule">] | readonly ["trunks", Omit<TrunksOptions, "name" | "rule">] | readonly ["corners", Omit<CornersOptions, "name">] | readonly ["highway", HighwayName | "shared-ways-all"] | readonly ["gate", HighwayName, "stretch" | "breakeven" | "ambiguity", number?] | readonly ["plan", HighwayName, Readonly<Record<string, unknown>>];
6561
+ /** The forms of the members, by the names of the records. `shared` is the base. The greedy sets of `sets.ts` name only these members. */
6562
+ export declare const MEMBER_FORMS: Readonly<Record<string, MemberForm>>;
6563
+ /** This function gives the router strategy of a member form, with the name `name`. */
6564
+ export declare function memberStrategy(name: string, form: MemberForm): Strategy<"router", object>;
6565
+ /** This function gives the member with the name `name`, or `undefined` for a name without a form in `MEMBER_FORMS`. */
6566
+ export declare function portfolioMember(name: string): Strategy<"router", object> | undefined;
6567
+ /** The options of the portfolio router. */
6568
+ export interface PortfolioRouterOptions {
6569
+ /** The rule of the caller. Under `collection` (the default), a shared segment must hold edges of one collection only. Under `all`, collections can mix. */
6570
+ readonly rule?: PortfolioRule;
6571
+ /** The stretch cap of the caller: 1.1, 1.25 or 1.5 (the default). An output with an edge above the cap does not win. The base is the fallback output. */
6572
+ readonly cap?: PortfolioCap;
6573
+ /**
6574
+ * The count of members after the base: 3, 5 or 8. Without `k` (the default), the router runs the fit of `fit.ts`.
6575
+ * The fit gives a member count for each rule, cap and band, and a node limit for each member. Thus the default is deterministic.
6576
+ */
6577
+ readonly k?: 3 | 5 | 8;
6578
+ /**
6579
+ * A time limit of the pick in milliseconds, as a ceiling that the caller sets. The base always runs. The combinator cuts the members that start after the limit.
6580
+ * A cut by the budget makes the output depend on the speed of the machine. Then the trace has `deterministic: false`.
6581
+ */
6582
+ readonly budgetMs?: number;
6583
+ /** The largest count of members that run, with the base. */
6584
+ readonly maxMembers?: number;
6585
+ /** The clock in milliseconds. The default is `performance.now`. */
6586
+ readonly now?: () => number;
6587
+ }
6588
+ /** The base member of each portfolio: the router `shared` with the rule `byCollection`. It is the fallback output above the cap. */
6589
+ export declare const PORTFOLIO_BASE_MEMBER = "shared";
6590
+ /** The result of the portfolio router: the output of the winner, the winner, the trace of the pick, the move counts and the band. */
6591
+ export interface PortfolioRoute {
6592
+ readonly result: Result;
6593
+ readonly winner: string;
6594
+ readonly trace: PortfolioTrace;
6595
+ /** The move count of the pick (ACTIVATION): `{ "move.pick": 1 }` when the winner is not the base and has another output. */
6596
+ readonly moves: Readonly<Record<string, number>>;
6597
+ /** The size band of the input, from its node count. */
6598
+ readonly band: string;
6599
+ /** The names of the members, in their order. */
6600
+ readonly members: readonly string[];
6601
+ }
6602
+ /** This function gives the name of the portfolio router with the options `options`: `portfolio-<rule>-<cap>-k<k>`, or `portfolio-<rule>-<cap>-fit` without `k`. */
6603
+ export declare function portfolioName(options?: PortfolioRouterOptions): string;
6604
+ /**
6605
+ * This function gives the names of the members for an input with `nodes` nodes. The base comes first.
6606
+ * - With `k`, the first `k` names of the set of the band follow.
6607
+ * - Without `k`, the members of the fit of the band follow, each only when `nodes` is at or below its node limit.
6608
+ */
6609
+ export declare function portfolioMembers(nodes: number, options?: PortfolioRouterOptions): string[];
6610
+ /**
6611
+ * This function routes the graph `graph` with the portfolio of its size band, rule and cap. The base runs first, then the members in their order.
6612
+ * The key is `portfolioKey`: a member wins only when it passes the guard against the base. Of those members, the winner has the most ink saved.
6613
+ * A tie within the `minEffect` of B1 goes to the first member (`selectBest`). A member that throws does not win.
6614
+ * The result carries the trace of the pick and the move count `move.pick`.
6615
+ */
6616
+ export declare function routePortfolio(graph: Graph, options?: PortfolioRouterOptions): PortfolioRoute;
6617
+ /** This function gives a router that routes each graph with `routePortfolio` and the options `options`. Its name is `portfolioName(options)`. */
6618
+ export declare function portfolioRouter(options?: PortfolioRouterOptions): Router;
6619
+ /**
6620
+ * The portfolio router as a router strategy. It is not in the registry `STRATEGIES`, so the benchmark and the site do not race it by default.
6621
+ * A caller adds it to a registry of its own, or calls `routePortfolio` for the trace.
6622
+ */
6623
+ export declare const portfolioStrategy: Strategy<"router", PortfolioRouterOptions>;
6624
+ /**
6625
+ * The greedy set of each rule, cap and size band, by the key `<rule>|<cap>|<band>`. The set of k strategies is the first k names.
6626
+ * Each set comes from the train seeds (0 to 4) of its band. The base `shared` is not in a set: the portfolio always runs it first.
6627
+ */
6628
+ export declare const PORTFOLIO_SETS: Readonly<Record<`${PortfolioRule}|${PortfolioCap}|${string}`, readonly string[]>>;
6629
+ export { type AdvectionSettings, type AmbiguityGuardOptions, type ArcOptions, type ArcSource, type AreaOptions, type AreaWidth, type Biclique, type BreakEvenOptions, type BundleLine, type BundleOrder, type CandidateSource, type CellStep, type ClothoidOptions, type ConfluentOptions, type ConsensusLinkage, type ConsensusOptions, type CornersOptions, type CorridorOptions, type Crossbar, type CrossbarOptions, type CubuOptions, type CurveSpace, type CutObjective, type CutOptions, type DensityGrid, type DensityImage, type DensityKernel, type DensitySource, type DiffusionOptions, type DividedOptions, type EdgeDistance, type EdgeEnds, type EdgeGroup, type EdgeLengths, type EdgePathOptions, type EdgePlugs, type ExerciseEvidence, type FdebOptions, type FieldEnd, type FlowClusterOptions, type FlowFieldOptions, type FollowOptions, type FrechetBundle, type FrechetOptions, type Gate, type GroupScope, type GroupSpine, type GroupedOptions, type GrowthOptions, type GrowthOrder, type HashOptions, type HdbscanOptions, type HierarchyGroups, type HierarchyOptions, type Highway, type HighwayBase, type HighwayInput, type HighwayMember, type HighwayOptions, type HighwayPlan, type HoughOptions, type HoughPeak, type HubAllocation, type HubArcOptions, type HubCandidates, type HysteresisOptions, type JogStyle, type KdAxis, type KdLine, type KdOptions, type KdeebOptions, type KeyOptions, type KeyedWay, type KeysOptions, type LaneCurve, type LanesOptions, type LevelHighwayOptions, type LinkCommunityOptions, type LinkEdge, type Linkage, type MeetOptions, type Member, type MemberStatus, type MemberTrace, type MeshOptions, type MingleOptions, type MlsFit, type MlsebOptions, type ModuleRule, type NestedOptions, type NodeKey, type NodeLinks, type OdCellOptions, type OutputGroup, type PHubOptions, type PathStep, type PickSpec, type Portfolio, type PortfolioKey, type PortfolioLevel, type PortfolioOptions, type PortfolioPick, type PortfolioTrace, type PowerOptions, type QuickBundlesOptions, RECORD_EPS, type ResistanceOptions, type Ridge, type RidgeOptions, type RidgeSource, type RoadClassOptions, type RoomBends, type RoundedOptions, type RouteCrossing, type RouteSegment, type SbebOptions, type ScaleCluster, type ScaleSpaceOptions, type SectionsOptions, type SelectCandidate, type SelectLevel, type SelectOptions, type Selection, type ShapeSkeleton, type ShareCost, type ShareMerge, type ShareOrder, type SharedOptions, type SharedStretchOptions, type SharedWaysOptions, type SkeletonGroups, type SkeletonTarget, type SmoothOptions, type SnapLine, type SnapMember, type SnapOptions, type SoftKeyOptions, type SpectralOptions, type SpiralNode, type SpiralOptions, type SplineOptions, type SplitCell, type StableIdOptions, type StretchOptions, type StubEnds, type StubOptions, type TerritoryOptions, type TerritoryPoints, type TraceOptions, type TraclusOptions, type TrafficRule, type TrunkFan, type TrunkSplit, type TrunksOptions, type WeiszfeldOptions, type WspdOptions, type Zip, type ZipLimits, type ZipperOptions, canonicalJson, compareMeasure, exercised, minEffectOf, outputGroups, outputHash, pickMoves, portfolio, selectBest, sha256Hex };
5221
6630
  //# sourceMappingURL=index.d.ts.map