@mark1russell7/highways 0.9.4 → 0.9.6

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.
package/build/index.d.ts CHANGED
@@ -98,6 +98,13 @@ export interface Port {
98
98
  * A plug with `along` needs a `side` and has no `at`. `resolvePorts` throws a `RangeError` for a bad value.
99
99
  */
100
100
  readonly along?: number;
101
+ /**
102
+ * This interval of the side holds a free plug of the port (PORT-RANGE). Its values go from 0 to 1, as the values of `along`.
103
+ * Each plug rule and `fixPorts` keep the plug in this interval, and keep the order and the gap of the rule.
104
+ * When the interval is too short for the gap, the gap shrinks evenly. A fixed plug does not read the range.
105
+ * `resolvePorts` throws a `RangeError` for a bad range.
106
+ */
107
+ readonly range?: readonly [number, number];
101
108
  }
102
109
  /** A node: a box that routes must not go through. */
103
110
  export interface Node {
@@ -210,12 +217,15 @@ export declare function nodeIndex(g: Graph): Map<string, Node>;
210
217
  * A plug with `at` gives `at`. A plug with `side` and `along` gives the point of `portPoint` of `@mark1russell7/layout-contract`.
211
218
  */
212
219
  export declare function portOffset(box: Box, port: Port): Point | undefined;
213
- /** This function throws a `RangeError` when the `along` of a plug is bad: not finite, outside 0 to 1, without `side` or with `at`. */
220
+ /**
221
+ * This function throws a `RangeError` when the `along` of a plug is bad: not finite, outside 0 to 1, without `side` or with `at`.
222
+ * It also throws a `RangeError` for a bad `range` of a plug. A bad range has a value that is not finite or is outside 0 to 1, or a start after its end.
223
+ */
214
224
  export declare function checkPort(node: Node, port: Port): void;
215
225
  /**
216
226
  * This function checks the plugs of a graph, and gives each plug with `side` and `along` a fixed `at`. The plug keeps its `side`.
217
227
  * Each router calls it at the start of `route`, so all routers agree. A graph without `along` comes back as the same object.
218
- * It throws a `RangeError` for a bad `along` (`checkPort`).
228
+ * It throws a `RangeError` for a bad `along` or a bad `range` (`checkPort`).
219
229
  */
220
230
  export declare function resolvePorts(graph: Graph): Graph;
221
231
  /** This function gives the absolute place of a fixed plug, or `undefined` for a free plug or no plug. A plug with `side` and `along` is fixed. */
@@ -395,7 +405,7 @@ export declare function sideToward(box: Box, toward: Point): Side;
395
405
  export declare function pointOnSide(box: Box, side: Side, toward: Point, inset?: number): Point;
396
406
  /**
397
407
  * This function places the plug of one end of an edge. A fixed plug stays at its point. A plug with a side stays on that side.
398
- * The router places a free plug on the side that faces `toward`.
408
+ * The router places a free plug on the side that faces `toward`. A free plug of a port with a `range` stays in that range (`clampToRange`).
399
409
  */
400
410
  export declare function placePlug(node: Node, end: End, toward: Point): Plug;
401
411
  /** The options of the inflection rule. */
@@ -1914,6 +1924,8 @@ interface SharedSearch {
1914
1924
  seq: Point[];
1915
1925
  ids: number[];
1916
1926
  } | undefined;
1927
+ /** This function gives the free space across the link from corner `i` to corner `j` (`channelWidth`). The router keeps each width that it finds. */
1928
+ width(i: number, j: number): number;
1917
1929
  }
1918
1930
  /**
1919
1931
  * The hooks of a router that `shared` runs (WILD-023, RULE-021). The router `shared` itself has no hooks.
@@ -1983,6 +1995,147 @@ export declare function annealingRouter(options: Partial<AnnealingOptions> & {
1983
1995
  * A screen module or a consumer adds it to a registry.
1984
1996
  */
1985
1997
  export declare const annealingStrategy: Strategy<"router", AnnealingOptions>;
1998
+ /** The options of the router `canals` (NAT-004: canalization feeder trees to hubs). */
1999
+ interface CanalOptions {
2000
+ /** The exponent `mu` of the flux in the growth of a conductance, from 1 to 3 in steps of 0.5. A value above 1 gives a tree. The default is 2. */
2001
+ readonly mu: number;
2002
+ /** The largest number of updates of the conductances, from 30 to 150. The updates stop when the ways do not change for 3 updates. The default is 60. */
2003
+ readonly steps: number;
2004
+ /** The decay `r` of a conductance, from 0.5 to 2. The default is 1. */
2005
+ readonly decay: number;
2006
+ /** A hub has this number of edges of one key or more, from 2 to 8. The default is 3. */
2007
+ readonly minMembers: number;
2008
+ }
2009
+ /** The default options of the router `canals`. */
2010
+ export declare const CANAL_DEFAULTS: Readonly<CanalOptions>;
2011
+ /** The declarations of the options of the router `canals` (NAT-004). */
2012
+ export declare const CANAL_SCHEMA: OptionSchema<CanalOptions>;
2013
+ /**
2014
+ * This function gives `x^mu` for `x` from 0 to 1 and `mu` in steps of 0.5, with only `*` and `Math.sqrt`.
2015
+ * These operations are exact to the last bit on each platform, so a decision does not depend on the engine.
2016
+ */
2017
+ export declare function halfPower(x: number, mu: number): number;
2018
+ /** A hub: a node, the key of its edges, and the ways of those edges. */
2019
+ interface CanalHub {
2020
+ readonly node: string;
2021
+ readonly key: string;
2022
+ readonly ways: readonly Way[];
2023
+ }
2024
+ /**
2025
+ * This function gives the hubs of the ways. In each key, the node with the most ends is a hub when it has `minMembers` edges or more.
2026
+ * Its edges leave the key, and the next hub of the key comes from the edges that stay. A tie goes to the smaller node id.
2027
+ * An edge with no key is in no hub.
2028
+ */
2029
+ export declare function canalHubs(ways: readonly Way[], minMembers: number): CanalHub[];
2030
+ /**
2031
+ * This function grows a feeder tree to each hub (NAT-004, after the canalization of Sachs 1981 and Mitchison 1980).
2032
+ * Each member edge is a source of one unit of flux, and the hub is the sink. The flux of a link is the share of the members whose ways use it.
2033
+ * At each update, each conductance changes by `DT × (flux^mu - decay × D)`, and each member finds its way again with the cost `d / (1 + GAIN × D)`.
2034
+ * A link that another way of the key uses costs half, as in `shared`.
2035
+ * With `mu` above 1, a link with more flux grows faster, so the ways gather into one tree. The updates stop after `steps`, or when no way changes for 3 updates.
2036
+ */
2037
+ export declare function canalWays(ways: readonly Way[], search: SharedSearch, options?: Partial<CanalOptions>): void;
2038
+ /**
2039
+ * This function makes the router `canals` (NAT-004). It is the router `shared`, then the feeder trees of `canalWays` to the hubs of each key.
2040
+ * The runs and the bundles come from the ways after the trees.
2041
+ */
2042
+ export declare function canalRouter(options: Partial<CanalOptions> & {
2043
+ readonly name: string;
2044
+ readonly rule?: GroupRule;
2045
+ readonly maxNodes?: number;
2046
+ }): Router;
2047
+ /**
2048
+ * The router strategy `canals` (NAT-004), with the rule `byCollection` of `shared`. It is not a built-in router, so the benchmark and the hashes of `ROUTERS` do not change.
2049
+ * A screen module or a consumer adds it to a registry.
2050
+ */
2051
+ export declare const canalStrategy: Strategy<"router", CanalOptions>;
2052
+ /** The options of the router `adam` (RULE-020: Adam with a seeded sample of pairs). */
2053
+ interface AdamOptions {
2054
+ /** The first step size `eta0`, in units of `clearance`, from 0.01 to 1. The step size falls to a tenth of it at the last step. The default is 0.1. */
2055
+ readonly eta: number;
2056
+ /** The number of other legs that each leg samples at each step, from 4 to 32. The default is 8. */
2057
+ readonly samples: number;
2058
+ /** The number of steps: the budget of the search, from 100 to 2000. The default is 200. */
2059
+ readonly steps: number;
2060
+ /** The seed of the samples, a whole number from 0. The same seed gives the same routes. The default is 1. */
2061
+ readonly seed: number;
2062
+ /** A leg nearer than this distance to another leg or to a box gets a push, from 4 to 32. The default is 8. */
2063
+ readonly clearance: number;
2064
+ }
2065
+ /** The default options of the router `adam`. */
2066
+ export declare const ADAM_DEFAULTS: Readonly<AdamOptions>;
2067
+ /** The declarations of the options of the router `adam` (RULE-020). */
2068
+ export declare const ADAM_SCHEMA: OptionSchema<AdamOptions>;
2069
+ /**
2070
+ * This function moves the free legs of the routes of `result` with Adam (RULE-020, after Kingma and Ba 2015, and the SGD layouts of Zheng, Pawar and Goodman 2019).
2071
+ * A leg is free when its two points are inside its route, and no other route, run or trunk holds them. The variable of a leg is a shift along its normal.
2072
+ * The energy of a leg is `Σ (1 - d / c)²` over a seeded sample of `samples` other legs nearer than `c`. The near boxes add the same term times 4.
2073
+ * A term `0.05 × (t / c)²` holds each leg near its first place. The step size falls from `eta` to a tenth of it, with only `+`, `*` and `/`.
2074
+ * A moved route goes back to its first points when it has more crossings than before, or a break of a hard rule.
2075
+ * When the output still has more crossings than the routes of `shared`, it is the routes of `shared`.
2076
+ */
2077
+ export declare function adamRoutes(input: Graph, result: Result, options?: Partial<AdamOptions>): Result;
2078
+ /**
2079
+ * This function makes the router `adam` (RULE-020). It is the router `shared`, then the steps of Adam of `adamRoutes`.
2080
+ * The runs and the bundles of `shared` stay, because no point of a run or of a trunk moves.
2081
+ */
2082
+ export declare function adamRouter(options: Partial<AdamOptions> & {
2083
+ readonly name: string;
2084
+ readonly rule?: GroupRule;
2085
+ readonly maxNodes?: number;
2086
+ }): Router;
2087
+ /**
2088
+ * The router strategy `adam` (RULE-020), with the rule `byCollection` of `shared`. It is not a built-in router, so the benchmark and the hashes of `ROUTERS` do not change.
2089
+ * A screen module or a consumer adds it to a registry.
2090
+ */
2091
+ export declare const adamStrategy: Strategy<"router", AdamOptions>;
2092
+ /** The options of the router `reroute` (RULE-044: a corner graph with the prices of the rules, and rounds of rip-up and reroute). */
2093
+ interface RerouteOptions {
2094
+ /** The price of a link in a narrow channel, from 0 to 2. The default is 1. */
2095
+ readonly alpha: number;
2096
+ /** The price of each edge of another key on a link, from 0 to 2. The default is 0.5. */
2097
+ readonly beta: number;
2098
+ /** The discount of a link that an edge of the same key uses, from 0 to 2. The default is 0.5. */
2099
+ readonly gamma: number;
2100
+ /** The price of a turn, in units of `clearance`, from 0 to 2. The default is 0.25. */
2101
+ readonly tau: number;
2102
+ /** The number of rounds of rip-up and reroute, from 1 to 5. The default is 2. */
2103
+ readonly rounds: number;
2104
+ /** The share of the edges that each round rips up: the edges with the largest price over their direct length, from 0.05 to 0.3. The default is 0.15. */
2105
+ readonly q: number;
2106
+ /** A channel narrower than this width gets the price `alpha`, from 4 to 64. The default is 16. */
2107
+ readonly clearance: number;
2108
+ }
2109
+ /** The default options of the router `reroute`. */
2110
+ export declare const REROUTE_DEFAULTS: Readonly<RerouteOptions>;
2111
+ /** The declarations of the options of the router `reroute` (RULE-044). */
2112
+ export declare const REROUTE_SCHEMA: OptionSchema<RerouteOptions>;
2113
+ /** This function gives the number of turns of a way: the points where the direction changes by more than 1 degree. */
2114
+ export declare function turnsOf(seq: readonly Point[]): number;
2115
+ /**
2116
+ * This function rips up and reroutes the ways of `shared` (RULE-044, after the rip-up and reroute of PathFinder, McMurchie 1995).
2117
+ * The price factor of a link is `max(0.05, 1 + alpha × narrow + beta × others - gamma × same)`.
2118
+ * `narrow` is `max(0, 1 - width / clearance)`. `others` counts the edges of the other keys on the link.
2119
+ * `same` is 1 when an edge of the same key uses the link.
2120
+ * The price of a way is the sum of the price factor times the length of each link, plus `tau × clearance` for each turn.
2121
+ * Each round takes the share `q` of the ways with the largest price over their direct length. Each one gets a new search with the prices of the links.
2122
+ * The new way stays only when its price is lower. The search has no state for the turns, so only the comparison reads `tau`.
2123
+ */
2124
+ export declare function rerouteWays(ways: readonly Way[], search: SharedSearch, options?: Partial<RerouteOptions>): void;
2125
+ /**
2126
+ * This function makes the router `reroute` (RULE-044). It is the router `shared`, then the rounds of rip-up and reroute of `rerouteWays`.
2127
+ * The runs and the bundles come from the ways after the rounds.
2128
+ */
2129
+ export declare function rerouteRouter(options: Partial<RerouteOptions> & {
2130
+ readonly name: string;
2131
+ readonly rule?: GroupRule;
2132
+ readonly maxNodes?: number;
2133
+ }): Router;
2134
+ /**
2135
+ * The router strategy `reroute` (RULE-044), with the rule `byCollection` of `shared`. It is not a built-in router, so the benchmark and the hashes of `ROUTERS` do not change.
2136
+ * A screen module or a consumer adds it to a registry.
2137
+ */
2138
+ export declare const rerouteStrategy: Strategy<"router", RerouteOptions>;
1986
2139
  /** The edges that go first: the edges with few good ways (`tight`), or the edges with many good ways (`loose`). */
1987
2140
  type TightFirst = "tight" | "loose";
1988
2141
  /** The values of `TightFirst`. */
@@ -2275,6 +2428,92 @@ export declare const SPREAD_DEFAULTS: Required<SpreadOptions>;
2275
2428
  * The output has one entry for each edge with two known nodes, in the order of the edges.
2276
2429
  */
2277
2430
  export declare function spreadEnds(input: PlugInput, options?: SpreadOptions): PlugPair[];
2431
+ /**
2432
+ * The order and the places of the plugs of one wall in the strategy `leaders` (EDA-041).
2433
+ * With `po`, the sort key of a far end in front of the wall is its place on the axis along the wall.
2434
+ * With `opo`, the plugs of a wall go at even places in the order of the keys of `spread`.
2435
+ */
2436
+ export type WallLeader = "po" | "opo";
2437
+ /**
2438
+ * This function does the work of `spreadEnds`, and of the strategy `leaders` with the argument `leader`.
2439
+ * Without `leader`, it gives the plugs of `spread`.
2440
+ */
2441
+ export declare function spreadWith(input: PlugInput, options?: SpreadOptions, leader?: WallLeader): PlugPair[];
2442
+ /** The options of the plug strategy `assign`. */
2443
+ export interface AssignOptions {
2444
+ /** The least gap between two plugs of one wall. When the room of the wall is too small for all its plugs, the gap shrinks evenly. The default is 8. */
2445
+ readonly plugGap?: number;
2446
+ /** The distance from a plug to a corner of its box, or a quarter of the wall when the wall is short. The default is 6. */
2447
+ readonly inset?: number;
2448
+ }
2449
+ /** The defaults of the plug strategy `assign`. */
2450
+ export declare const ASSIGN_DEFAULTS: Required<AssignOptions>;
2451
+ /** One end of a wall for `assignWall`. The places are on the axis along the wall. */
2452
+ export interface WallEnd {
2453
+ /** The start of the interval of the end. */
2454
+ readonly lo: number;
2455
+ /** The end of the interval of the end. */
2456
+ readonly hi: number;
2457
+ /** The place of the plug that faces the far end. The plan moves the plugs the least distance from these places. */
2458
+ readonly ideal: number;
2459
+ /** The sort key of the far end. Plugs in the order of the keys do not cross at the wall. */
2460
+ readonly key: number;
2461
+ }
2462
+ /** The plan of one wall: the place of each plug, and the ends with their plug in their interval. */
2463
+ export interface WallPlan {
2464
+ /** The place of the plug of each end, in the order of the ends. */
2465
+ readonly at: number[];
2466
+ /** For each end, `true` when its plug is in its interval. */
2467
+ readonly anchored: boolean[];
2468
+ /** The gap of the wall: the option `gap`, or less when the room of the wall is too short for all its plugs. */
2469
+ readonly gap: number;
2470
+ }
2471
+ /**
2472
+ * This function gives the plan of one wall (PLUG-ASSIGN). Each end has an interval on the axis along the wall. The plugs keep at least `gap` between two of them,
2473
+ * and between a plug and a fixed plug at a place of `fixed`. When the room is too short for all the plugs, the gap shrinks evenly. The plan has three goals, in this order:
2474
+ * 1. the most ends with their plug in their interval (exact).
2475
+ * 2. no crossing at the wall: the order of the keys, when that order lets the count of goal 1.
2476
+ * 3. the least sum of the squares of the moves from the ideal places, for the order and the ends of goals 1 and 2.
2477
+ *
2478
+ * An end that cannot get a plug in its interval still gets a plug in the room. When the order of the keys loses ends, the plugs swap their places
2479
+ * to come nearer to that order, while each end keeps its interval.
2480
+ */
2481
+ export declare function assignWall(ends: readonly WallEnd[], room: readonly [number, number], gap: number, fixed?: readonly number[]): WallPlan;
2482
+ /**
2483
+ * This function gives the plugs of the plug strategy `assign` (PLUG-ASSIGN). A fixed plug stays at its point, and a plug with a side stays on that side.
2484
+ * Each free plug goes on the side that faces the other end (`sideToward`). Each end of a wall has an interval: the range of its port, or the room of the wall.
2485
+ * Then `assignWall` places the plugs of each wall, with at least `plugGap` between two of them. The ends of one port share one plug.
2486
+ *
2487
+ * The output has one entry for each edge with two known nodes, in the order of the edges.
2488
+ */
2489
+ export declare function assignEnds(input: PlugInput, options?: AssignOptions): PlugPair[];
2490
+ /**
2491
+ * The type of leader of a plug. With `s`, the order of a wall is the order of the angles of the far ends, as in `spread`.
2492
+ * With `po`, the stub leaves along the normal and turns once, so the order is the order of the far ends along the wall.
2493
+ * With `opo`, the plugs of a wall go at even places, in the order of the angles.
2494
+ */
2495
+ export type LeaderType = "s" | "po" | "opo";
2496
+ /** The values of `LeaderType`. */
2497
+ export declare const LEADER_TYPES: readonly LeaderType[];
2498
+ /** The options of the plug strategy `leaders`. */
2499
+ export interface LeaderOptions {
2500
+ /** The type of leader. The default is `po`. */
2501
+ readonly leader: LeaderType;
2502
+ /** The least gap between two plugs of one wall, from 2 to 8. The default is 8. */
2503
+ readonly slotSpacing: number;
2504
+ /** The distance from a plug to a corner of its box, or a quarter of the wall when the wall is short. The default is 6. */
2505
+ readonly inset: number;
2506
+ /** The number of passes that sort each wall again by the new places of the far ends, from 0 to 4. The default is 2. */
2507
+ readonly rounds: number;
2508
+ }
2509
+ /** The defaults of the plug strategy `leaders`. */
2510
+ export declare const LEADER_DEFAULTS: Readonly<LeaderOptions>;
2511
+ /**
2512
+ * This function gives the plugs of the plug strategy `leaders` (EDA-041, after Bekos 2007). A fixed plug stays at its point, and a plug with a side stays on that side.
2513
+ * Each free plug goes on the side that faces the other end. The plugs of each wall keep at least `slotSpacing` between two of them.
2514
+ * The type of leader sets their order and their places. The output has one entry for each edge with two known nodes, in the order of the edges.
2515
+ */
2516
+ export declare function leaderEnds(input: PlugInput, options?: Partial<LeaderOptions>): PlugPair[];
2278
2517
  /** The options of `fixPorts`. */
2279
2518
  export interface FixPortsOptions {
2280
2519
  /** The options of the plug rule. The rule gets its `defaults` for each option that this object does not give. */
@@ -2288,6 +2527,11 @@ export interface FixPortsOptions {
2288
2527
  * The default is `false`: such an end stays free.
2289
2528
  */
2290
2529
  readonly newPorts?: boolean;
2530
+ /**
2531
+ * The plugs of ports with a `range` (PORT-RANGE). With `keep`, a plug out of its range moves into it, and the new plugs of its side keep their order.
2532
+ * With `rule`, each plug stays where the rule puts it. The default is `keep`, but `rule` for the rule `assign`: its plugs out of their ranges are on purpose.
2533
+ */
2534
+ readonly ranges?: "keep" | "rule";
2291
2535
  }
2292
2536
  /**
2293
2537
  * This function runs the plug rule. It gives each free port a fixed `at` and a `side` from the plugs of the rule.
@@ -2296,6 +2540,7 @@ export interface FixPortsOptions {
2296
2540
  *
2297
2541
  * The rule sees the graph of `corners`: the plugs of `resolvePorts`, without the inner edges of the frames.
2298
2542
  * The rule is a strategy of the step `plugs`, or the name of one in the registry.
2543
+ * A new fixed port with a `range` is in its range (PORT-RANGE). When the rule gives a plug out of the range, the new plugs of that side move into their ranges.
2299
2544
  * The output is a new graph. The function does not change the input.
2300
2545
  */
2301
2546
  export declare function fixPorts(graph: Graph, rule: Strategy<"plugs"> | string, options?: FixPortsOptions): Graph;
@@ -2398,6 +2643,40 @@ export declare function venationLinks(items: readonly LevelItem[], direct: reado
2398
2643
  * In each level with groups, the links take their ways along a closed venation backbone (`venationLinks`). The last level stays as in `depths`.
2399
2644
  */
2400
2645
  export declare function venationLevels(input: LevelInput, options: Readonly<VenationOptions>): Level[];
2646
+ /** The growth of the width of a stroke with the number of its edges. */
2647
+ export type WidthScale = "linear" | "sqrt" | "log";
2648
+ /** The values of `WidthScale`. */
2649
+ export declare const WIDTH_SCALES: readonly WidthScale[];
2650
+ /** The options of the level strategy `detail`: the options of `depths`, and the limits of the collapse. */
2651
+ export interface DetailOptions extends DepthLevelOptions {
2652
+ /** Two parallel legs closer than this number of pixels on the screen become one stroke, from 0.5 to 4. The default is 3. */
2653
+ readonly pxMin: number;
2654
+ /** A stroke holds this number of edges or more, from 2 to 5. The default is 2. */
2655
+ readonly minCount: number;
2656
+ /** The width of a stroke of one edge, in pixels, from 1 to 4. The default is 1.5. A renderer reads it with `detailWidth`. */
2657
+ readonly w0: number;
2658
+ /** The growth of the width of a stroke with its count. The default is `log`. */
2659
+ readonly widthScale: WidthScale;
2660
+ }
2661
+ /** The default options of the level strategy `detail`. */
2662
+ export declare const DETAIL_DEFAULTS: Readonly<DetailOptions>;
2663
+ /**
2664
+ * This function gives the width of a stroke of `count` edges, in pixels (WILD-016). With `log`, it is `w0 × (1 + log2(count))`.
2665
+ * With `sqrt`, it is `w0 × sqrt(count)`. With `linear`, it is `w0 × count`.
2666
+ */
2667
+ export declare function detailWidth(count: number, o?: Pick<DetailOptions, "w0" | "widthScale">): number;
2668
+ /**
2669
+ * This function collapses the legs of the links of one level that are closer than `tol` (WILD-016, EDA-038).
2670
+ * The legs of each axis go in clusters along the axis across it. The leg with the largest count of a cluster is its stroke, and each other leg moves onto it.
2671
+ * A cluster needs two legs whose projections overlap, and a count of `minCount` or more. A move that puts a leg through the box of an item does not happen.
2672
+ */
2673
+ export declare function collapseLinks(items: readonly LevelItem[], links: readonly LevelLink[], tol: number, minCount: number): LevelLink[];
2674
+ /**
2675
+ * This function gives the zoom levels of the level strategy `detail` (WILD-016 with EDA-038). The levels and their items are the levels of `depths`.
2676
+ * A level with groups first shows at the scale `itemAt / size`, with `size` its median item (`pickLevel`). At that scale, `pxMin` pixels are `pxMin × size / itemAt` units.
2677
+ * The links of the level collapse their legs that are closer than that length (`collapseLinks`). The last level stays as in `depths`.
2678
+ */
2679
+ export declare function detailLevels(input: LevelInput, options: Readonly<DetailOptions>): Level[];
2401
2680
  /** One setting of the portfolio: a name and the options of the pipeline. */
2402
2681
  export interface PortfolioSetting {
2403
2682
  readonly name: string;
@@ -2444,6 +2723,226 @@ export declare function rankShares(values: readonly number[], lowerIsBetter: boo
2444
2723
  * The measures are the crossings (R1), the median detour (R5) and the ink saved (B1). The least score wins, and a tie goes to the earlier setting.
2445
2724
  */
2446
2725
  export declare function boardPortfolio(graph: Graph, list: readonly PortfolioSetting[], o: Readonly<BoardPortfolioOptions>, now?: () => number): BoardPortfolioRun;
2726
+ /** One rule of the curriculum: the crossings (R1), the lane separation (R12) or the crossing angle (R2). */
2727
+ export type CurriculumRule = "R1" | "R12" | "R2";
2728
+ /** The order in which the curriculum adds its rules. */
2729
+ export type CurriculumOrder = "R1-R12-R2" | "R12-R1-R2" | "R1-R2-R12";
2730
+ /** The values of `CurriculumOrder`. */
2731
+ export declare const CURRICULUM_ORDERS: readonly CurriculumOrder[];
2732
+ /** The options of the whole strategy `curriculum` (RULE-048). */
2733
+ export interface CurriculumOptions {
2734
+ /** The order in which the stages add the rules. The default is `R1-R12-R2`. */
2735
+ readonly order: CurriculumOrder;
2736
+ /** The number of passes over the edges in each stage, from 1 to 3. The default is 1. */
2737
+ readonly passes: number;
2738
+ /** The number of settings in the pool of routes, from the start of its list, from 2 to 3. The default is 3. */
2739
+ readonly settings: number;
2740
+ /** A new route has a detour of at most this value, or of its old route, from 1.5 to 4. The default is 2. */
2741
+ readonly detour: number;
2742
+ }
2743
+ /** The default options of the strategy `curriculum`. */
2744
+ export declare const CURRICULUM_DEFAULTS: Readonly<CurriculumOptions>;
2745
+ /**
2746
+ * This function gives the arc sine of `x` in radians, from -1 to 1. It is the algorithm of fdlibm, with only `+`, `*`, `/` and `Math.sqrt`.
2747
+ * These operations are exact to the last bit on each platform, so the result does not depend on the engine.
2748
+ */
2749
+ export declare function arcsin(x: number): number;
2750
+ /**
2751
+ * This function gives the costs of the rules between two routes. R1 is the number of crossings.
2752
+ * R2 is the sum of `1 - θ / 90` over the crossings. θ is the crossing angle in degrees.
2753
+ * R12 is the overlap of the legs of `a` and `b` that are within 5 degrees of parallel. The two legs are nearer than 4 units.
2754
+ */
2755
+ export declare function pairCosts(a: readonly Point[], b: readonly Point[]): Record<CurriculumRule, number>;
2756
+ /**
2757
+ * This function runs the whole strategy `curriculum` (RULE-048, after curriculum learning, Bengio 2009). The record has no energy solver yet (RULE-019).
2758
+ * Thus a pool of routes of fixed settings takes its place. Each edge can take its route from any setting of the pool.
2759
+ * The first answer is the first setting. Each stage adds one rule, in the order `order`. A pass of a stage visits the edges, the worst first.
2760
+ * An edge takes the route of the pool with the least cost of the new rule. That cost is lower, and the earlier rules do not get worse.
2761
+ * A route with a break of a hard rule is not in the pool. The output has the routes alone, with no runs, bundles or levels.
2762
+ */
2763
+ export declare function curriculum(graph: Graph, list: readonly PortfolioSetting[], options?: Partial<CurriculumOptions>): WholeOutput;
2764
+ /** The features of one route, in order: crossings (R1), angle cost (R2), lane overlap (R12) over 20, detour minus 1 (R5), and bends over 2. */
2765
+ export declare const PREFERENCE_FEATURES: readonly string[];
2766
+ /**
2767
+ * The weights of the made-up panel that labels the made-up pairs, in the order of `PREFERENCE_FEATURES`.
2768
+ * The order comes from the studies of the readers of graphs: the crossings count most, then the bends and the length, then the angle (Purchase 1997, Ware, Purchase, Colpoys and McGill 2002).
2769
+ * The numbers are made up. They do not come from the screen or from a board.
2770
+ */
2771
+ export declare const PREFERENCE_PANEL: readonly number[];
2772
+ /** The options of the fit of the preferences. */
2773
+ export interface PreferenceFit {
2774
+ /** The weight of the L2 term of the fit, from 0 to 1. The default is 0.01. */
2775
+ readonly l2: number;
2776
+ /** The seed of the made-up pairs. The default is 1. */
2777
+ readonly seed: number;
2778
+ /** The number of made-up pairs, from 50 to 1000. The default is 200. */
2779
+ readonly pairs: number;
2780
+ }
2781
+ /** The options of the whole strategy `preferences` (RULE-038). */
2782
+ export interface PreferenceOptions {
2783
+ /** The weight of the L2 term of the fit, from 0 to 1. The default is 0.01. */
2784
+ readonly l2: number;
2785
+ /** The number of passes over the edges, from 1 to 3. The default is 1. */
2786
+ readonly passes: number;
2787
+ /** The number of settings in the pool of routes, from the start of its list, from 2 to 3. The default is 3. */
2788
+ readonly settings: number;
2789
+ /** A new route has a detour of at most this value, or of its old route, from 1.5 to 4. The default is 2. */
2790
+ readonly detour: number;
2791
+ }
2792
+ /** The default options of the strategy `preferences`. */
2793
+ export declare const PREFERENCE_DEFAULTS: Readonly<PreferenceOptions>;
2794
+ /** One made-up pair: the features of two routes, and 1 when the panel prefers the first one. */
2795
+ export interface PreferencePair {
2796
+ readonly a: readonly number[];
2797
+ readonly b: readonly number[];
2798
+ readonly first: 0 | 1;
2799
+ }
2800
+ /** The result of the fit: the weights, the agreement with held-out pairs, and the source of the pairs. */
2801
+ export interface PreferenceModel {
2802
+ readonly weights: readonly number[];
2803
+ /** The share of 50 held-out made-up pairs where the weights agree with the panel. */
2804
+ readonly agreement: number;
2805
+ readonly source: string;
2806
+ }
2807
+ /**
2808
+ * This function gives a smooth step from 0 to 1, a stand-in for the logistic function with only `+`, `*`, `/` and `Math.abs`.
2809
+ * It is `0.5 + 0.5 z / (1 + |z|)`. These operations are exact to the last bit on each platform.
2810
+ */
2811
+ export declare function softStep(z: number): number;
2812
+ /**
2813
+ * This function gives `count` made-up pairs, with the labels of the made-up panel `PREFERENCE_PANEL` and a noise.
2814
+ * The pairs come from the seed alone. They do not come from a board.
2815
+ */
2816
+ export declare function madeUpPairs(count: number, seed: number): PreferencePair[];
2817
+ /** This function gives the share of the pairs where the weights `w` prefer the same route as the panel. */
2818
+ export declare function agreementOf(w: readonly number[], pairs: readonly PreferencePair[]): number;
2819
+ /**
2820
+ * This function fits the weights of the rules to made-up pairs (RULE-038, a Bradley-Terry model, after Bradley and Terry 1952).
2821
+ * The probability that a reader prefers `a` to `b` is `softStep(u(a) - u(b))`, with `u(x) = -w · f(x)`. The fit takes 400 steps of the gradient of the score.
2822
+ * An L2 term `l2 × |w|²` keeps the weights small. A weight below 0 becomes 0. The weights are scaled so that their sum is the number of features.
2823
+ * The held-out pairs come from the seed plus 7919. The pairs do not come from the screen or from a board.
2824
+ */
2825
+ export declare function fitPreferences(options?: Partial<PreferenceFit>): PreferenceModel;
2826
+ /**
2827
+ * This function runs the whole strategy `preferences` (RULE-038). It fits the weights of the rules to made-up pairs (`fitPreferences`).
2828
+ * Each edge can take its route from any setting of the pool. The first answer is the first setting.
2829
+ * A pass visits the edges in order. An edge takes the route of the pool with the least weighted cost, when that cost is lower than the cost of its route.
2830
+ * The cost is the weighted sum of the features of the route against the routes of the other edges. A route with a break of a hard rule is not in the pool.
2831
+ * The output has the routes alone, with no runs, bundles or levels.
2832
+ */
2833
+ export declare function preferences(graph: Graph, list: readonly PortfolioSetting[], options?: Partial<PreferenceOptions>): WholeOutput;
2834
+ /** The search of the whole strategy `fireflies`: the firefly algorithm, or the artificial bee colony. */
2835
+ export type SwarmSearch = "firefly" | "bees";
2836
+ /** The values of `SwarmSearch`. */
2837
+ export declare const SWARM_SEARCHES: readonly SwarmSearch[];
2838
+ /** The options of the whole strategy `fireflies` (NAT-047). */
2839
+ export interface FireflyOptions {
2840
+ /** The search. The default is `firefly`. */
2841
+ readonly search: SwarmSearch;
2842
+ /** The budget: the largest number of different settings that the search routes, from 4 to 40. The default is 12. */
2843
+ readonly budget: number;
2844
+ /** The number of fireflies or food sources, from 4 to 20. The default is 6. */
2845
+ readonly colony: number;
2846
+ /** The absorption `gamma` of the light of a firefly, from 0.01 to 10. The default is 1. */
2847
+ readonly gamma: number;
2848
+ /** The size `alpha` of the random step of a firefly, as a share of the range, from 0.01 to 0.5. The default is 0.2. */
2849
+ readonly alpha: number;
2850
+ /** The number of tries with no gain, after which a scout bee leaves a food source, from 10 to 100. The default is 10. */
2851
+ readonly limit: number;
2852
+ /** The seed of the search, a whole number from 0. The same seed gives the same routes. The default is 1. */
2853
+ readonly seed: number;
2854
+ }
2855
+ /** The default options of the strategy `fireflies`. */
2856
+ export declare const FIREFLY_DEFAULTS: Readonly<FireflyOptions>;
2857
+ /**
2858
+ * This function gives the attraction of a firefly at the distance `r`: `BETA0 / (1 + u + u² / 2)` with `u = gamma × r²`.
2859
+ * It is a rational stand-in for `BETA0 × exp(-u)`, with only `+`, `*` and `/`, so it is exact to the last bit on each platform.
2860
+ */
2861
+ export declare function attraction(gamma: number, r2: number): number;
2862
+ /** One setting of the router `shared`: the option `discount` and the option `margin`. */
2863
+ export interface SwarmSetting {
2864
+ readonly discount: number;
2865
+ readonly margin: number;
2866
+ }
2867
+ /** This function gives the setting of a point of the unit square, on the grid of the search. */
2868
+ export declare function settingAt(x: number, y: number): SwarmSetting;
2869
+ /** One setting that the search routed: its score and its output. A setting with a break of a hard rule has the score `Infinity`. */
2870
+ export interface SwarmEntry {
2871
+ readonly setting: SwarmSetting;
2872
+ readonly score: number;
2873
+ readonly output: WholeOutput;
2874
+ }
2875
+ /** The result of `fireflies`: the output, the best setting and each setting that the search routed, in order. */
2876
+ export interface SwarmRun {
2877
+ readonly output: WholeOutput;
2878
+ readonly best: SwarmSetting;
2879
+ readonly entries: readonly SwarmEntry[];
2880
+ }
2881
+ /**
2882
+ * This function gives the score of an output on its board. A lower score is better.
2883
+ * The score is `crossings / edges + (median detour - 1) - ink saved`. A break of a hard rule gives `Infinity`.
2884
+ */
2885
+ export declare function swarmScore(output: WholeOutput): number;
2886
+ /**
2887
+ * This function runs the whole strategy `fireflies` (NAT-047, after the firefly algorithm of Yang 2008 and the bee colony of Karaboga 2005).
2888
+ * It searches the options `discount` and `margin` of the router `router` on the board, on a grid of 20 × 8 settings.
2889
+ * The first firefly or food source is the default setting, so the score of the output is not worse than the score of the default.
2890
+ * A firefly moves toward each brighter one by `attraction(gamma, r²)` of the distance, plus a seeded step of size `alpha`.
2891
+ * A bee tries `v = x + phi (x - x_k)` in one dimension, and a scout takes a new seeded place after `limit` tries with no gain.
2892
+ * The search stops after `budget` different settings, or after 60 rounds. It reads only the board and the outputs of its own settings.
2893
+ */
2894
+ export declare function fireflies(graph: Graph, router: Strategy<"router">, options?: Partial<FireflyOptions>): SwarmRun;
2895
+ /** The value of the loads of the edges of a board that the pick reads: the median, the quantile 0.95 or the mean. */
2896
+ export type TracingQuantile = "q50" | "q95" | "mean";
2897
+ /** The values of `TracingQuantile`. */
2898
+ export declare const TRACING_QUANTILES: readonly TracingQuantile[];
2899
+ /** The weights of the places to choose on the way of one edge (WILD-057). */
2900
+ export interface TracingWeights {
2901
+ /** The weight of a crossing, from 0 to 4. The default is 1. */
2902
+ readonly crossing: number;
2903
+ /** The weight of a merge or a split where the edge is not an outer lane, from 0 to 4. The default is 2. */
2904
+ readonly merge: number;
2905
+ /** The weight of a bend, from 0 to 4. The default is 0.5. */
2906
+ readonly bend: number;
2907
+ }
2908
+ /** The default weights of the tracing load, as the record gives them. */
2909
+ export declare const TRACING_WEIGHTS: Readonly<TracingWeights>;
2910
+ /** The options of the whole strategy `tracing` (WILD-057). */
2911
+ export interface TracingOptions extends TracingWeights {
2912
+ /** The number of settings that the strategy tries, from the start of its list, from 1 to 12. The default is 4. */
2913
+ readonly settings: number;
2914
+ /** The value of the loads that the pick reads. The default is `q95`. */
2915
+ readonly quantile: TracingQuantile;
2916
+ }
2917
+ /** The default options of the strategy `tracing`. */
2918
+ export declare const TRACING_DEFAULTS: Readonly<TracingOptions>;
2919
+ /**
2920
+ * This function gives the tracing load of each edge of a result (WILD-057, after the tracing tasks of Ware, Purchase, Colpoys and McGill 2002).
2921
+ * The load is `T(e) = crossing × crossings + merge × (merges and splits where e is not an outer lane) + bend × bends`.
2922
+ * A shared run where the edge is not an outer lane gives one merge and one split. Such a bundle gives one split.
2923
+ * A bend is a turn of more than 1 degree. The measure is W4 of MEAS3.
2924
+ */
2925
+ export declare function tracingLoads(result: Result, weights?: Partial<TracingWeights>): Map<string, number>;
2926
+ /** This function gives a value of a list of loads: the median, the quantile 0.95 by the nearest rank, or the mean. An empty list gives 0. */
2927
+ export declare function tracingValue(loads: Iterable<number>, quantile: TracingQuantile): number;
2928
+ /** The tracing loads of one setting on the board: the value that the pick reads, and the median for a tie. */
2929
+ export interface TracingEntry {
2930
+ readonly name: string;
2931
+ readonly value: number;
2932
+ readonly median: number;
2933
+ }
2934
+ /** The result of `tracing`: the output, the name of the pick and the loads of each setting with no break of a hard rule. */
2935
+ export interface TracingRun {
2936
+ readonly output: WholeOutput;
2937
+ readonly pick: string;
2938
+ readonly entries: readonly TracingEntry[];
2939
+ }
2940
+ /**
2941
+ * This function runs the whole strategy `tracing` (WILD-057). It runs the first `settings` settings of `list` on the board.
2942
+ * A setting with a break of a hard rule, or above its node limit, does not count. The setting with the least tracing load wins.
2943
+ * A tie goes to the least median load, then to the earlier setting. It reads only the board and the outputs of its own settings.
2944
+ */
2945
+ export declare function tracing(graph: Graph, list: readonly PortfolioSetting[], options?: Partial<TracingOptions>): TracingRun;
2447
2946
  /** A broken hard rule. A correct router has none. */
2448
2947
  export interface Violation {
2449
2948
  readonly rule: "complete" | "ends-at-plugs" | "fixed-plugs" | "no-pass-through" | "counts-sum" | "link-ends" | "bundle-trunk" | "run-shared";
@@ -5517,6 +6016,58 @@ export declare function kneeOf(trees: readonly Pick<KneeTree, "ink" | "paths">[]
5517
6016
  * The stretches of the tree that two edges or more share become highways.
5518
6017
  */
5519
6018
  export declare function kneePlan(input: HighwayInput, o: Readonly<KneeOptions>): HighwayPlan;
6019
+ /** The end of a ride that the price moves: the exit, the entry, or both by half. */
6020
+ type BalanceEnd = "exit" | "entry" | "both";
6021
+ /** The values of `BalanceEnd`. */
6022
+ export declare const BALANCE_ENDS: readonly BalanceEnd[];
6023
+ /** The options of the highway strategy `balance` (EDA-017). */
6024
+ interface BalanceOptions {
6025
+ /** The target of the stretch of an edge: its route on the plan over its route alone, from 1.1 to 2. The default is 1.2. */
6026
+ readonly tau: number;
6027
+ /** The number of updates of the prices, from 5 to 30. The default is 5. */
6028
+ readonly iterations: number;
6029
+ /** The end of a ride that the price moves. The default is `exit`. */
6030
+ readonly end: BalanceEnd;
6031
+ /** The plan that the strategy balances. The default is `shared-ways`. */
6032
+ readonly from: HighwayBase;
6033
+ }
6034
+ /** The default options of the strategy `balance`. */
6035
+ export declare const BALANCE_DEFAULTS: Readonly<BalanceOptions>;
6036
+ /**
6037
+ * This function gives the plan of the highway strategy `balance` (EDA-017, after the Lagrange relaxation of the stretch).
6038
+ * The stretch of an edge is its route on the plan over its route alone, as the gate `stretch` measures it.
6039
+ * At each update, an edge with a stretch above `tau` adds `stretch - tau` to its price. Each of its rides keeps the share `1 - price` of its first length.
6040
+ * A ride shorter than the margin leaves the plan. The updates stop when no edge is above `tau`.
6041
+ */
6042
+ export declare function balancePlan(input: HighwayInput, options?: Partial<BalanceOptions>): HighwayPlan;
6043
+ /** This function balances the plan `first` of the graph, as `balancePlan` does. It reads all the options except `from`. */
6044
+ export declare function balanceOf(graph: Graph, first: HighwayPlan, options?: Partial<BalanceOptions>): HighwayPlan;
6045
+ /** The place of the header in the gap before the row: near the row, or near the feed node. */
6046
+ type ManifoldSide = "near" | "far";
6047
+ /** The values of `ManifoldSide`. */
6048
+ export declare const MANIFOLD_SIDES: readonly ManifoldSide[];
6049
+ /** The options of the highway strategy `manifolds` (WILD-036). */
6050
+ interface ManifoldOptions {
6051
+ /** A manifold has this number of taps or more, from 3 to 8. The default is 3. */
6052
+ readonly kMin: number;
6053
+ /** The nodes of one row have centers in a band of this many median box heights, from 0.5 to 2. The default is 1. */
6054
+ readonly band: number;
6055
+ /** The place of the header in the gap before the row. The default is `near`. */
6056
+ readonly side: ManifoldSide;
6057
+ /** A tap stays on the manifold only when its way is this many times the direct line or less, from 1 to 3. The default is 1.5. */
6058
+ readonly detour: number;
6059
+ /** The plan of the edges that are not on a manifold. The default is `shared-ways`. */
6060
+ readonly from: HighwayBase;
6061
+ }
6062
+ /** The default options of the strategy `manifolds`. */
6063
+ export declare const MANIFOLD_DEFAULTS: Readonly<ManifoldOptions>;
6064
+ /**
6065
+ * This function gives the plan of the highway strategy `manifolds` (WILD-036, after the headers of pipes and of bus bars).
6066
+ * A fan of `kMin` edges or more from one node to a row of nodes gets a straight header in the gap before the row.
6067
+ * Each edge of the fan joins the header at the feed point, in line with the center of the node. It leaves the header at its tap, in line with the center of its far node.
6068
+ * A tap whose way is more than `detour` times the direct line leaves the manifold. Each edge is on one manifold at most. The other edges keep the plan `from`.
6069
+ */
6070
+ export declare function manifoldPlan(input: HighwayInput, options?: Partial<ManifoldOptions>): HighwayPlan;
5520
6071
  /** The rule that splits the targets of a tip in two: by count, by weight, or at the widest gap of the angles. */
5521
6072
  type BronchialSplit = "count" | "weight" | "gap";
5522
6073
  /** The values of `BronchialSplit`. */
@@ -6310,6 +6861,53 @@ interface SidePlugOptions {
6310
6861
  /** The largest number of places that the search tries on each side. The default is 16. */
6311
6862
  readonly most?: number;
6312
6863
  }
6864
+ /** The edges that can join a trunk: only the edges with the key of the trunk, or each edge. */
6865
+ type SlotKeys = "same" | "any";
6866
+ /** The values of `SlotKeys`. */
6867
+ export declare const SLOT_KEYS: readonly SlotKeys[];
6868
+ /** The options of the highway strategy `slots` (RULE-047). */
6869
+ interface SlotOptions {
6870
+ /** The weight `k` of the pull, from 0.25 to 8. The default is 2. The name is not `k`, because `follow` reads `k` as an option of its ways. */
6871
+ readonly pull: number;
6872
+ /** The reach `r` of the pull, in units, from 8 to 64. A route point farther than this distance from a trunk gets no pull. The default is 24. */
6873
+ readonly reach: number;
6874
+ /** The distance between two lanes of a trunk, in units, from 2 to 8. The default is 4. */
6875
+ readonly laneSpacing: number;
6876
+ /** The largest stretch of a route after it joins a trunk: its new length over its first length, from 1.05 to 2. The default is 1.25. */
6877
+ readonly maxStretch: number;
6878
+ /** The edges that can join a trunk. The default is `same`. */
6879
+ readonly keys: SlotKeys;
6880
+ /** The plan that gives the trunks. The default is `shared-ways`. */
6881
+ readonly from: HighwayBase;
6882
+ }
6883
+ /** The default options of the strategy `slots`. */
6884
+ export declare const SLOT_DEFAULTS: Readonly<SlotOptions>;
6885
+ /** One possible join of an edge to a trunk: the trunk, the places on its spine, the pull and the detour. */
6886
+ interface SlotJoin {
6887
+ readonly highway: number;
6888
+ readonly on: number;
6889
+ readonly off: number;
6890
+ /** The pull energy that the join removes: `k × Σ w(d) × (d - slot)² × step / r²`, in units of length. */
6891
+ readonly pull: number;
6892
+ /** The length that the join adds to the route, as an estimate. */
6893
+ readonly detour: number;
6894
+ }
6895
+ /**
6896
+ * This function gives the best join of one route to the trunk `h`, or `undefined`.
6897
+ * The longest row of samples nearer than `reach` to the spine is the part of the route that the trunk pulls.
6898
+ * The slot of the new lane is at `laneSpacing × (lanes + 1) / 2` from the spine. The weight is `w(d) = max(0, 1 - d / r)`.
6899
+ */
6900
+ export declare function slotJoin(route: readonly Point[], h: Highway, index: number, o: Readonly<SlotOptions>): SlotJoin | undefined;
6901
+ /**
6902
+ * This function gives the plan of the highway strategy `slots` (RULE-047, after the pull of force-directed edge bundling, Holten and van Wijk 2009).
6903
+ * The trunks are the highways of the plan `from`. Each edge outside the plan gets a pull toward the slot of a new lane of a trunk near its first route.
6904
+ * The energy of the pull is `E = k Σ w(d_i) ‖x_i - slot_i‖²` over the samples of the route, with `w(d) = max(0, 1 - d / r)`.
6905
+ * The edge joins the trunk when the pull is larger than the length that the join adds, and the stretch stays under `maxStretch`.
6906
+ * The edge takes the trunk with the largest gain, on the outer lane. An edge that does not fit stays off the trunks.
6907
+ */
6908
+ export declare function slotPlan(input: HighwayInput, options?: Partial<SlotOptions>): HighwayPlan;
6909
+ /** This function adds the joins of `slotPlan` to the plan `first` of the graph. It reads all the options except `from`. A join that breaks a hard rule after `follow` leaves the plan. */
6910
+ export declare function slotsOf(graph: Graph, first: HighwayPlan, routes: ReadonlyMap<string, readonly Point[]>, options?: Partial<SlotOptions>): HighwayPlan;
6313
6911
  /** The options of a router strategy: the options of its router, without the name and the limit of the benchmark. */
6314
6912
  export type RouterPreset<O> = Omit<O, "name" | "maxNodes">;
6315
6913
  /** The built-in router strategies, in the order of the benchmark. They route as the routers of `ROUTERS`. */
@@ -6456,6 +7054,9 @@ export declare const highwayStrategies: {
6456
7054
  readonly interchanges: Strategy<"highway", InterchangeOptions>;
6457
7055
  readonly knee: Strategy<"highway", KneeOptions>;
6458
7056
  readonly bronchial: Strategy<"highway", BronchialOptions>;
7057
+ readonly balance: Strategy<"highway", BalanceOptions>;
7058
+ readonly manifolds: Strategy<"highway", ManifoldOptions>;
7059
+ readonly slots: Strategy<"highway", SlotOptions>;
6459
7060
  readonly "corridors+breakeven": Strategy<"highway", CorridorOptions & BreakEvenOptions>;
6460
7061
  readonly "corridors+stretch": Strategy<"highway", CorridorOptions & StretchOptions>;
6461
7062
  readonly "corridors+ambiguity": Strategy<"highway", CorridorOptions & AmbiguityGuardOptions>;
@@ -6468,17 +7069,25 @@ export declare const plugStrategies: {
6468
7069
  readonly side: Strategy<"plugs", SidePlugOptions>;
6469
7070
  readonly justify: Strategy<"plugs", JustifyOptions>;
6470
7071
  readonly spread: Strategy<"plugs", SpreadOptions>;
7072
+ readonly leaders: Strategy<"plugs", LeaderOptions>;
7073
+ readonly assign: Strategy<"plugs", AssignOptions>;
6471
7074
  };
6472
7075
  /** The built-in level rules: the strategies of the step `levels`. The router `sections` makes its zoom levels with its option `level`. */
6473
7076
  export declare const levelStrategies: {
6474
7077
  readonly depths: Strategy<"levels", DepthLevelOptions>;
6475
7078
  readonly venation: Strategy<"levels", VenationOptions>;
7079
+ readonly detail: Strategy<"levels", DetailOptions>;
6476
7080
  };
6477
7081
  /**
6478
7082
  * The fixed list of settings of the whole strategy `board-portfolio` (WILD-045), in order. The option `settings` takes the first ones.
6479
7083
  * The list holds routers and highway strategies with their defaults. It comes from the catalog of the strategies, not from a fit to the screen.
6480
7084
  */
6481
7085
  export declare const BOARD_PORTFOLIO_SETTINGS: readonly PortfolioSetting[];
7086
+ /**
7087
+ * The pool of routes of the whole strategy `curriculum` (RULE-048), in order: the routers of the base of the screen. The first one gives the first answer.
7088
+ * The option `settings` takes the first ones.
7089
+ */
7090
+ export declare const CURRICULUM_POOL: readonly PortfolioSetting[];
6482
7091
  /**
6483
7092
  * The built-in whole strategies: the strategies of the step `whole`. The strategy `pipeline` runs one strategy of each step, as the demo of the site does.
6484
7093
  * Without options, it routes the graph with the router `corners`.
@@ -6486,6 +7095,10 @@ export declare const BOARD_PORTFOLIO_SETTINGS: readonly PortfolioSetting[];
6486
7095
  export declare const wholeStrategies: {
6487
7096
  readonly pipeline: Strategy<"whole", PipelineOptions>;
6488
7097
  readonly "board-portfolio": Strategy<"whole", BoardPortfolioOptions>;
7098
+ readonly curriculum: Strategy<"whole", CurriculumOptions>;
7099
+ readonly preferences: Strategy<"whole", PreferenceOptions>;
7100
+ readonly fireflies: Strategy<"whole", FireflyOptions>;
7101
+ readonly tracing: Strategy<"whole", TracingOptions>;
6489
7102
  };
6490
7103
  /** The built-in strategies of each step, in order. A consumer adds its own: `createRegistry([...BUILT_IN_STRATEGIES, mine])`. */
6491
7104
  export declare const BUILT_IN_STRATEGIES: readonly AnyStrategy[];
@@ -8053,5 +8666,5 @@ export declare const PORTFOLIO_SETS: Readonly<Record<`${PortfolioRule}|${Portfol
8053
8666
  * The default stretch order is `sifting`, the best order of the screen. The option `stretchOrder` selects `consensus` or `periphery`.
8054
8667
  */
8055
8668
  export declare const sharedStretchStrategy: Strategy<"router", RouterPreset<SharedOptions>>;
8056
- export { type AdvectionSettings, type AmbiguityGuardOptions, type AnnealingOptions, type ArcOptions, type ArcSource, type AreaOptions, type AreaWidth, type AttractionOptions, type Biclique, type BreakEvenOptions, type BronchialOptions, type BronchialSplit, type BundleLine, type BundleOrder, type CandidateSource, type CellStep, type ClothoidOptions, type ConfluentOptions, type ConsensusLinkage, type ConsensusOptions, type CornersOptions, type CorpusDimension, type CorpusFamily, type CorridorOptions, type Crossbar, type CrossbarOptions, type CubuOptions, type CurveSpace, type CutObjective, type CutOptions, DEFAULT_RNG, type DensityGrid, type DensityImage, type DensityKernel, type DensitySource, type DiffusionOptions, type DimensionValues, type DividedOptions, type EdgeDistance, type EdgeEnds, type EdgeGroup, type EdgeLengths, type EdgePathOptions, type EdgePlugs, type ExerciseEvidence, type FamilyRegistry, type FdebOptions, type FieldEnd, type FlowClusterOptions, type FlowFieldOptions, type FollowOptions, type FrameOptions, type FrechetBundle, type FrechetOptions, type FreeLine, type GapOptions, type Gate, type GenerateContext, type GroupScope, type GroupSpine, type GroupedOptions, type GrowthOptions, type GrowthOrder, type GutterEdge, type GutterOptions, 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 InnerMode, type Interchange, type InterchangeBase, type InterchangeOptions, type JogStyle, type KdAxis, type KdLine, type KdOptions, type KdeebOptions, type KeyOptions, type KeyedWay, type KeysOptions, type KneeOptions, type KneeRule, type KneeTree, 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 Outside, type PHubOptions, type ParamValue, 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 SearchMove, type SearchOptions, type SectionsOptions, type SelectCandidate, type SelectLevel, type SelectOptions, type Selection, type ShapeSkeleton, type ShareCost, type ShareMerge, type ShareOrder, type SharedHooks, type SharedNegotiation, type SharedOptions, type SharedSearch, 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 SteinerGroup, type SteinerMethod, type SteinerMetric, type SteinerOptions, type StreetEdge, type StreetOptions, type StreetRide, type StreetSource, type StretchOptions, type StubEnds, type StubOptions, type TerritoryOptions, type TerritoryPoints, type TightFirst, type TightOptions, type TightTies, type TraceOptions, type TraclusOptions, type TrafficRule, type TrunkFan, type TrunkSplit, type TrunksOptions, type WeiszfeldOptions, type WspdOptions, type Zip, type ZipLimits, type ZipperOptions, canonicalJson, compareMeasure, createFamilyRegistry, dimensionAt, dimensionUnit, exercised, familyKind, levelsOf, minEffectOf, outputGroups, outputHash, paramProblem, pickMoves, portfolio, randomInt, selectBest, sha256Hex };
8669
+ export { type AdamOptions, type AdvectionSettings, type AmbiguityGuardOptions, type AnnealingOptions, type ArcOptions, type ArcSource, type AreaOptions, type AreaWidth, type AttractionOptions, type BalanceEnd, type BalanceOptions, type Biclique, type BreakEvenOptions, type BronchialOptions, type BronchialSplit, type BundleLine, type BundleOrder, type CanalHub, type CanalOptions, type CandidateSource, type CellStep, type ClothoidOptions, type ConfluentOptions, type ConsensusLinkage, type ConsensusOptions, type CornersOptions, type CorpusDimension, type CorpusFamily, type CorridorOptions, type Crossbar, type CrossbarOptions, type CubuOptions, type CurveSpace, type CutObjective, type CutOptions, DEFAULT_RNG, type DensityGrid, type DensityImage, type DensityKernel, type DensitySource, type DiffusionOptions, type DimensionValues, type DividedOptions, type EdgeDistance, type EdgeEnds, type EdgeGroup, type EdgeLengths, type EdgePathOptions, type EdgePlugs, type ExerciseEvidence, type FamilyRegistry, type FdebOptions, type FieldEnd, type FlowClusterOptions, type FlowFieldOptions, type FollowOptions, type FrameOptions, type FrechetBundle, type FrechetOptions, type FreeLine, type GapOptions, type Gate, type GenerateContext, type GroupScope, type GroupSpine, type GroupedOptions, type GrowthOptions, type GrowthOrder, type GutterEdge, type GutterOptions, 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 InnerMode, type Interchange, type InterchangeBase, type InterchangeOptions, type JogStyle, type KdAxis, type KdLine, type KdOptions, type KdeebOptions, type KeyOptions, type KeyedWay, type KeysOptions, type KneeOptions, type KneeRule, type KneeTree, type LaneCurve, type LanesOptions, type LevelHighwayOptions, type LinkCommunityOptions, type LinkEdge, type Linkage, type ManifoldOptions, type ManifoldSide, 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 Outside, type PHubOptions, type ParamValue, type PathStep, type PickSpec, type Portfolio, type PortfolioKey, type PortfolioLevel, type PortfolioOptions, type PortfolioPick, type PortfolioTrace, type PowerOptions, type QuickBundlesOptions, RECORD_EPS, type RerouteOptions, 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 SearchMove, type SearchOptions, type SectionsOptions, type SelectCandidate, type SelectLevel, type SelectOptions, type Selection, type ShapeSkeleton, type ShareCost, type ShareMerge, type ShareOrder, type SharedHooks, type SharedNegotiation, type SharedOptions, type SharedSearch, type SharedStretchOptions, type SharedWaysOptions, type SkeletonGroups, type SkeletonTarget, type SlotJoin, type SlotKeys, type SlotOptions, type SmoothOptions, type SnapLine, type SnapMember, type SnapOptions, type SoftKeyOptions, type SpectralOptions, type SpiralNode, type SpiralOptions, type SplineOptions, type SplitCell, type StableIdOptions, type SteinerGroup, type SteinerMethod, type SteinerMetric, type SteinerOptions, type StreetEdge, type StreetOptions, type StreetRide, type StreetSource, type StretchOptions, type StubEnds, type StubOptions, type TerritoryOptions, type TerritoryPoints, type TightFirst, type TightOptions, type TightTies, type TraceOptions, type TraclusOptions, type TrafficRule, type TrunkFan, type TrunkSplit, type TrunksOptions, type WeiszfeldOptions, type WspdOptions, type Zip, type ZipLimits, type ZipperOptions, canonicalJson, compareMeasure, createFamilyRegistry, dimensionAt, dimensionUnit, exercised, familyKind, levelsOf, minEffectOf, outputGroups, outputHash, paramProblem, pickMoves, portfolio, randomInt, selectBest, sha256Hex };
8057
8670
  //# sourceMappingURL=index.d.ts.map