@procedures/dag 0.46.0 → 0.47.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @procedures/dag
2
2
 
3
+ ## 0.47.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 74f2f24: `@procedures/dag`: a new entry `./graph` with `hubBreadthFirstOrder`, a pure breadth-first order from the hub of each component of a weighted graph. The entry imports no other package.
8
+ - Updated dependencies [f845c6d]
9
+ - @procedures/client@0.47.1
10
+
11
+ ## 0.47.0
12
+
13
+ ### Patch Changes
14
+
15
+ - e913014: Each module imports zod with `import * as z from "zod"`, not `import { z } from "zod"`. With the old form, an esbuild bundle got each locale of zod: 264 kB of minified code (esbuild metafile of the journey worker of the site). The Vite build of the site gives the same worker files with both forms. The procedure scaffolder writes the new form in `types.ts`. The API and the behavior stay the same.
16
+ - Updated dependencies [c9125a8]
17
+ - Updated dependencies [335728b]
18
+ - Updated dependencies [d987202]
19
+ - Updated dependencies [45a737f]
20
+ - Updated dependencies [d77e9e8]
21
+ - Updated dependencies [e913014]
22
+ - Updated dependencies [2f0c7b0]
23
+ - Updated dependencies [ad70c38]
24
+ - Updated dependencies [47819c6]
25
+ - @procedures/client@0.47.0
26
+
3
27
  ## 0.46.0
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -23,6 +23,7 @@ npm install @procedures/dag
23
23
  - [Functions](#functions)
24
24
  - [buildDAG](#builddag)
25
25
  - [executeDAG](#executedag)
26
+ - [hubBreadthFirstOrder](#hubbreadthfirstorder)
26
27
  - [Use Cases](#use-cases)
27
28
  - [Integration](#integration)
28
29
  - [Requirements](#requirements)
@@ -378,6 +379,20 @@ graph LR
378
379
 
379
380
  ---
380
381
 
382
+ ### hubBreadthFirstOrder
383
+
384
+ The entry `@procedures/dag/graph` holds pure graph functions. It imports no other package.
385
+
386
+ ```typescript
387
+ import { hubBreadthFirstOrder } from "@procedures/dag/graph";
388
+
389
+ const sizes = [4, 9, 1];
390
+ const order = hubBreadthFirstOrder(3, [{ a: 0, b: 1, weight: 2 }, { a: 1, b: 2 }], (i, j) => sizes[j]! - sizes[i]!);
391
+ // order: [1, 0, 2]
392
+ ```
393
+
394
+ The function reads an undirected weighted graph with the nodes `0` to `n - 1`. It starts at the node with the largest sum of edge weights, and goes breadth-first. The comparator, then the lower index, breaks each tie. Each next component starts at its own hub.
395
+
381
396
  ## Use Cases
382
397
 
383
398
  ### Package Build Order