graphwise 1.11.0 → 1.12.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/README.md +17 -17
- package/dist/__test__/fixtures/graphs/linear-chain.d.ts +3 -3
- package/dist/__test__/fixtures/helpers.d.ts +12 -12
- package/dist/__test__/fixtures/helpers.d.ts.map +1 -1
- package/dist/__test__/fixtures/index.d.ts +1 -1
- package/dist/__test__/fixtures/metrics.d.ts +10 -10
- package/dist/__test__/fixtures/metrics.d.ts.map +1 -1
- package/dist/__test__/fixtures/types.d.ts +2 -2
- package/dist/__test__/fixtures/types.d.ts.map +1 -1
- package/dist/async/protocol.d.ts +1 -1
- package/dist/async/protocol.d.ts.map +1 -1
- package/dist/{expansion → exploration}/base-core.d.ts +5 -5
- package/dist/exploration/base-core.d.ts.map +1 -0
- package/dist/exploration/base-core.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/base-helpers.d.ts +11 -11
- package/dist/exploration/base-helpers.d.ts.map +1 -0
- package/dist/{expansion → exploration}/base.d.ts +11 -11
- package/dist/exploration/base.d.ts.map +1 -0
- package/dist/exploration/base.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/comparison.integration.test.d.ts +2 -2
- package/dist/exploration/comparison.integration.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/dfs-priority.d.ts +8 -8
- package/dist/exploration/dfs-priority.d.ts.map +1 -0
- package/dist/exploration/dfs-priority.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/dome.d.ts +13 -13
- package/dist/exploration/dome.d.ts.map +1 -0
- package/dist/{expansion → exploration}/dome.integration.test.d.ts +2 -2
- package/dist/exploration/dome.integration.test.d.ts.map +1 -0
- package/dist/exploration/dome.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/edge.d.ts +8 -8
- package/dist/exploration/edge.d.ts.map +1 -0
- package/dist/{expansion → exploration}/edge.integration.test.d.ts +1 -1
- package/dist/exploration/edge.integration.test.d.ts.map +1 -0
- package/dist/exploration/edge.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/flux.d.ts +11 -11
- package/dist/exploration/flux.d.ts.map +1 -0
- package/dist/{expansion → exploration}/flux.integration.test.d.ts +1 -1
- package/dist/exploration/flux.integration.test.d.ts.map +1 -0
- package/dist/exploration/flux.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/frontier-balanced.d.ts +8 -8
- package/dist/exploration/frontier-balanced.d.ts.map +1 -0
- package/dist/exploration/frontier-balanced.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/fuse.d.ts +10 -10
- package/dist/exploration/fuse.d.ts.map +1 -0
- package/dist/{expansion → exploration}/fuse.integration.test.d.ts +1 -1
- package/dist/exploration/fuse.integration.test.d.ts.map +1 -0
- package/dist/exploration/fuse.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/hae.d.ts +10 -10
- package/dist/exploration/hae.d.ts.map +1 -0
- package/dist/{expansion → exploration}/hae.integration.test.d.ts +2 -2
- package/dist/exploration/hae.integration.test.d.ts.map +1 -0
- package/dist/exploration/hae.unit.test.d.ts.map +1 -0
- package/dist/exploration/index.cjs +51 -0
- package/dist/{expansion → exploration}/index.d.ts +3 -3
- package/dist/exploration/index.d.ts.map +1 -0
- package/dist/{expansion → exploration}/index.js +1 -1
- package/dist/{expansion → exploration}/k-hop.d.ts +6 -6
- package/dist/exploration/k-hop.d.ts.map +1 -0
- package/dist/exploration/k-hop.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/lace.d.ts +11 -11
- package/dist/exploration/lace.d.ts.map +1 -0
- package/dist/{expansion → exploration}/lace.integration.test.d.ts +1 -1
- package/dist/exploration/lace.integration.test.d.ts.map +1 -0
- package/dist/exploration/lace.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/maze.d.ts +9 -9
- package/dist/exploration/maze.d.ts.map +1 -0
- package/dist/{expansion → exploration}/maze.integration.test.d.ts +1 -1
- package/dist/exploration/maze.integration.test.d.ts.map +1 -0
- package/dist/exploration/maze.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/pipe.d.ts +8 -8
- package/dist/exploration/pipe.d.ts.map +1 -0
- package/dist/{expansion → exploration}/pipe.integration.test.d.ts +2 -2
- package/dist/exploration/pipe.integration.test.d.ts.map +1 -0
- package/dist/exploration/pipe.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/priority-helpers.d.ts +2 -2
- package/dist/exploration/priority-helpers.d.ts.map +1 -0
- package/dist/{expansion → exploration}/random-priority.d.ts +11 -11
- package/dist/exploration/random-priority.d.ts.map +1 -0
- package/dist/exploration/random-priority.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/random-walk.d.ts +6 -6
- package/dist/exploration/random-walk.d.ts.map +1 -0
- package/dist/exploration/random-walk.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/reach.d.ts +9 -9
- package/dist/exploration/reach.d.ts.map +1 -0
- package/dist/{expansion → exploration}/reach.integration.test.d.ts +1 -1
- package/dist/exploration/reach.integration.test.d.ts.map +1 -0
- package/dist/exploration/reach.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/sage.d.ts +9 -9
- package/dist/exploration/sage.d.ts.map +1 -0
- package/dist/{expansion → exploration}/sage.integration.test.d.ts +1 -1
- package/dist/exploration/sage.integration.test.d.ts.map +1 -0
- package/dist/exploration/sage.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/sift.d.ts +12 -12
- package/dist/exploration/sift.d.ts.map +1 -0
- package/dist/{expansion → exploration}/sift.integration.test.d.ts +1 -1
- package/dist/exploration/sift.integration.test.d.ts.map +1 -0
- package/dist/exploration/sift.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/standard-bfs.d.ts +8 -8
- package/dist/exploration/standard-bfs.d.ts.map +1 -0
- package/dist/exploration/standard-bfs.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/tide.d.ts +8 -8
- package/dist/exploration/tide.d.ts.map +1 -0
- package/dist/{expansion → exploration}/tide.integration.test.d.ts +1 -1
- package/dist/exploration/tide.integration.test.d.ts.map +1 -0
- package/dist/exploration/tide.unit.test.d.ts.map +1 -0
- package/dist/{expansion → exploration}/types.d.ts +17 -17
- package/dist/exploration/types.d.ts.map +1 -0
- package/dist/{expansion → exploration}/warp.d.ts +8 -8
- package/dist/exploration/warp.d.ts.map +1 -0
- package/dist/{expansion → exploration}/warp.integration.test.d.ts +1 -1
- package/dist/exploration/warp.integration.test.d.ts.map +1 -0
- package/dist/exploration/warp.unit.test.d.ts.map +1 -0
- package/dist/{expansion--UuRowv-.cjs → exploration-BfDi17av.cjs} +136 -136
- package/dist/exploration-BfDi17av.cjs.map +1 -0
- package/dist/{expansion-CZLNK6Pr.js → exploration-DKjRNxS5.js} +136 -136
- package/dist/exploration-DKjRNxS5.js.map +1 -0
- package/dist/gpu/index.cjs +1 -1
- package/dist/gpu/index.js +1 -1
- package/dist/index/index.cjs +57 -53
- package/dist/index/index.js +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/{kernel-CigCjrts.js → kernel-BLwhyVSV.js} +1 -1
- package/dist/{kernel-CigCjrts.js.map → kernel-BLwhyVSV.js.map} +1 -1
- package/dist/{kernel-2oH4Cn32.cjs → kernel-BffKjhZS.cjs} +1 -1
- package/dist/{kernel-2oH4Cn32.cjs.map → kernel-BffKjhZS.cjs.map} +1 -1
- package/dist/{kernel-CXeGBH3s.cjs → kernel-CbP715Sq.cjs} +1 -1
- package/dist/{kernel-CXeGBH3s.cjs.map → kernel-CbP715Sq.cjs.map} +1 -1
- package/dist/{kernel-CvnRsF7E.js → kernel-DolEKSSx.js} +1 -1
- package/dist/{kernel-CvnRsF7E.js.map → kernel-DolEKSSx.js.map} +1 -1
- package/dist/{kernel-DukrXtVb.cjs → kernel-E_h47HjZ.cjs} +1 -1
- package/dist/{kernel-DukrXtVb.cjs.map → kernel-E_h47HjZ.cjs.map} +1 -1
- package/dist/{kernel-6deK9fh1.js → kernel-lYa4TYth.js} +1 -1
- package/dist/{kernel-6deK9fh1.js.map → kernel-lYa4TYth.js.map} +1 -1
- package/dist/{operations-D-RB67WP.cjs → operations-CSU0yFPr.cjs} +4 -4
- package/dist/{operations-D-RB67WP.cjs.map → operations-CSU0yFPr.cjs.map} +1 -1
- package/dist/{operations-D9otVlIH.js → operations-CdrA87Au.js} +4 -4
- package/dist/{operations-D9otVlIH.js.map → operations-CdrA87Au.js.map} +1 -1
- package/dist/ranking/baselines/betweenness.d.ts +2 -2
- package/dist/ranking/baselines/betweenness.d.ts.map +1 -1
- package/dist/ranking/baselines/communicability.d.ts +3 -3
- package/dist/ranking/baselines/communicability.d.ts.map +1 -1
- package/dist/ranking/baselines/degree-sum.d.ts +2 -2
- package/dist/ranking/baselines/degree-sum.d.ts.map +1 -1
- package/dist/ranking/baselines/hitting-time.d.ts +2 -2
- package/dist/ranking/baselines/hitting-time.d.ts.map +1 -1
- package/dist/ranking/baselines/jaccard-arithmetic.d.ts +2 -2
- package/dist/ranking/baselines/jaccard-arithmetic.d.ts.map +1 -1
- package/dist/ranking/baselines/katz.d.ts +3 -3
- package/dist/ranking/baselines/katz.d.ts.map +1 -1
- package/dist/ranking/baselines/pagerank.d.ts +3 -3
- package/dist/ranking/baselines/pagerank.d.ts.map +1 -1
- package/dist/ranking/baselines/random-ranking.d.ts +2 -2
- package/dist/ranking/baselines/random-ranking.d.ts.map +1 -1
- package/dist/ranking/baselines/resistance-distance.d.ts +2 -2
- package/dist/ranking/baselines/resistance-distance.d.ts.map +1 -1
- package/dist/ranking/baselines/shortest.d.ts +2 -2
- package/dist/ranking/baselines/shortest.d.ts.map +1 -1
- package/dist/ranking/baselines/types.d.ts +3 -3
- package/dist/ranking/baselines/types.d.ts.map +1 -1
- package/dist/ranking/baselines/utils.d.ts +3 -3
- package/dist/ranking/baselines/utils.d.ts.map +1 -1
- package/dist/ranking/baselines/widest-path.d.ts +2 -2
- package/dist/ranking/baselines/widest-path.d.ts.map +1 -1
- package/dist/ranking/index.cjs +1 -1
- package/dist/ranking/index.js +1 -1
- package/dist/ranking/parse-gpu.d.ts +2 -2
- package/dist/ranking/parse-gpu.d.ts.map +1 -1
- package/dist/ranking/parse.d.ts +4 -4
- package/dist/ranking/parse.d.ts.map +1 -1
- package/dist/{ranking-pe5UaxKg.cjs → ranking-BQqrH26-.cjs} +2 -2
- package/dist/ranking-BQqrH26-.cjs.map +1 -0
- package/dist/{ranking-DOKDBcIR.js → ranking-B_KdM8Wq.js} +2 -2
- package/dist/ranking-B_KdM8Wq.js.map +1 -0
- package/dist/schemas/graph.d.ts +1 -1
- package/dist/schemas/index.cjs +1 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/seeds/basil.d.ts +12 -0
- package/dist/seeds/basil.d.ts.map +1 -0
- package/dist/seeds/brisk.d.ts +18 -0
- package/dist/seeds/brisk.d.ts.map +1 -0
- package/dist/seeds/hybrid-core.d.ts +32 -0
- package/dist/seeds/hybrid-core.d.ts.map +1 -0
- package/dist/seeds/hybrid-ensembles.unit.test.d.ts +2 -0
- package/dist/seeds/hybrid-ensembles.unit.test.d.ts.map +1 -0
- package/dist/seeds/index.cjs +11 -1108
- package/dist/seeds/index.d.ts +4 -0
- package/dist/seeds/index.d.ts.map +1 -1
- package/dist/seeds/index.js +2 -1103
- package/dist/seeds/omnia.d.ts +12 -0
- package/dist/seeds/omnia.d.ts.map +1 -0
- package/dist/seeds/prism.d.ts +12 -0
- package/dist/seeds/prism.d.ts.map +1 -0
- package/dist/seeds--fLhoBaG.cjs +1762 -0
- package/dist/seeds--fLhoBaG.cjs.map +1 -0
- package/dist/seeds-ihozTw4J.js +1703 -0
- package/dist/seeds-ihozTw4J.js.map +1 -0
- package/dist/utils/entropy.d.ts +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -7
- package/dist/expansion/base-core.d.ts.map +0 -1
- package/dist/expansion/base-core.unit.test.d.ts.map +0 -1
- package/dist/expansion/base-helpers.d.ts.map +0 -1
- package/dist/expansion/base.d.ts.map +0 -1
- package/dist/expansion/base.unit.test.d.ts.map +0 -1
- package/dist/expansion/comparison.integration.test.d.ts.map +0 -1
- package/dist/expansion/dfs-priority.d.ts.map +0 -1
- package/dist/expansion/dfs-priority.unit.test.d.ts.map +0 -1
- package/dist/expansion/dome.d.ts.map +0 -1
- package/dist/expansion/dome.integration.test.d.ts.map +0 -1
- package/dist/expansion/dome.unit.test.d.ts.map +0 -1
- package/dist/expansion/edge.d.ts.map +0 -1
- package/dist/expansion/edge.integration.test.d.ts.map +0 -1
- package/dist/expansion/edge.unit.test.d.ts.map +0 -1
- package/dist/expansion/flux.d.ts.map +0 -1
- package/dist/expansion/flux.integration.test.d.ts.map +0 -1
- package/dist/expansion/flux.unit.test.d.ts.map +0 -1
- package/dist/expansion/frontier-balanced.d.ts.map +0 -1
- package/dist/expansion/frontier-balanced.unit.test.d.ts.map +0 -1
- package/dist/expansion/fuse.d.ts.map +0 -1
- package/dist/expansion/fuse.integration.test.d.ts.map +0 -1
- package/dist/expansion/fuse.unit.test.d.ts.map +0 -1
- package/dist/expansion/hae.d.ts.map +0 -1
- package/dist/expansion/hae.integration.test.d.ts.map +0 -1
- package/dist/expansion/hae.unit.test.d.ts.map +0 -1
- package/dist/expansion/index.cjs +0 -51
- package/dist/expansion/index.d.ts.map +0 -1
- package/dist/expansion/k-hop.d.ts.map +0 -1
- package/dist/expansion/k-hop.unit.test.d.ts.map +0 -1
- package/dist/expansion/lace.d.ts.map +0 -1
- package/dist/expansion/lace.integration.test.d.ts.map +0 -1
- package/dist/expansion/lace.unit.test.d.ts.map +0 -1
- package/dist/expansion/maze.d.ts.map +0 -1
- package/dist/expansion/maze.integration.test.d.ts.map +0 -1
- package/dist/expansion/maze.unit.test.d.ts.map +0 -1
- package/dist/expansion/pipe.d.ts.map +0 -1
- package/dist/expansion/pipe.integration.test.d.ts.map +0 -1
- package/dist/expansion/pipe.unit.test.d.ts.map +0 -1
- package/dist/expansion/priority-helpers.d.ts.map +0 -1
- package/dist/expansion/random-priority.d.ts.map +0 -1
- package/dist/expansion/random-priority.unit.test.d.ts.map +0 -1
- package/dist/expansion/random-walk.d.ts.map +0 -1
- package/dist/expansion/random-walk.unit.test.d.ts.map +0 -1
- package/dist/expansion/reach.d.ts.map +0 -1
- package/dist/expansion/reach.integration.test.d.ts.map +0 -1
- package/dist/expansion/reach.unit.test.d.ts.map +0 -1
- package/dist/expansion/sage.d.ts.map +0 -1
- package/dist/expansion/sage.integration.test.d.ts.map +0 -1
- package/dist/expansion/sage.unit.test.d.ts.map +0 -1
- package/dist/expansion/sift.d.ts.map +0 -1
- package/dist/expansion/sift.integration.test.d.ts.map +0 -1
- package/dist/expansion/sift.unit.test.d.ts.map +0 -1
- package/dist/expansion/standard-bfs.d.ts.map +0 -1
- package/dist/expansion/standard-bfs.unit.test.d.ts.map +0 -1
- package/dist/expansion/tide.d.ts.map +0 -1
- package/dist/expansion/tide.integration.test.d.ts.map +0 -1
- package/dist/expansion/tide.unit.test.d.ts.map +0 -1
- package/dist/expansion/types.d.ts.map +0 -1
- package/dist/expansion/warp.d.ts.map +0 -1
- package/dist/expansion/warp.integration.test.d.ts.map +0 -1
- package/dist/expansion/warp.unit.test.d.ts.map +0 -1
- package/dist/expansion--UuRowv-.cjs.map +0 -1
- package/dist/expansion-CZLNK6Pr.js.map +0 -1
- package/dist/ranking-DOKDBcIR.js.map +0 -1
- package/dist/ranking-pe5UaxKg.cjs.map +0 -1
- package/dist/seeds/index.cjs.map +0 -1
- package/dist/seeds/index.js.map +0 -1
- /package/dist/{expansion → exploration}/base-core.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/base.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/dfs-priority.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/dome.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/edge.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/flux.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/frontier-balanced.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/fuse.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/hae.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/k-hop.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/lace.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/maze.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/pipe.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/random-priority.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/random-walk.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/reach.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/sage.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/sift.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/standard-bfs.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/tide.unit.test.d.ts +0 -0
- /package/dist/{expansion → exploration}/warp.unit.test.d.ts +0 -0
package/README.md
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/graphwise)
|
|
5
5
|
[](https://github.com/Mearman/graphwise)
|
|
6
6
|
|
|
7
|
-
Low-dependency TypeScript graph algorithms for citation network analysis: novel
|
|
7
|
+
Low-dependency TypeScript graph algorithms for citation network analysis: novel exploration, MI variants, and path ranking.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **Exploration algorithms**: BASE, DOME, EDGE, HAE, PIPE, SAGE, REACH, MAZE + 6 variants (TIDE, LACE, WARP, FUSE, SIFT, FLUX) + baselines
|
|
12
12
|
- **MI variants**: Jaccard, Adamic-Adar, SCALE, SKEW, SPAN, ETCH, NOTCH, Unified Adaptive
|
|
13
13
|
- **Path ranking**: PARSE + baselines (Katz, Communicability, PageRank, etc.)
|
|
14
|
-
- **Seed selection**: GRASP, Stratified
|
|
14
|
+
- **Seed selection**: GRASP, STRIDE, CREST, SPINE, CRISP, BRISK, BASIL, PRISM, OMNIA, Stratified
|
|
15
15
|
- **Subgraph extraction**: ego-network, k-core, k-truss, motif, induced, filter
|
|
16
16
|
- **Optional WebGPU acceleration**
|
|
17
17
|
- **Async support**: Generator coroutine protocol, sync/async runners, all algorithms available as `*Async` variants
|
|
@@ -36,7 +36,7 @@ const ranked = parse(graph, result.paths, { mi: jaccard });
|
|
|
36
36
|
|
|
37
37
|
## Algorithms
|
|
38
38
|
|
|
39
|
-
###
|
|
39
|
+
### Exploration: BASE Framework
|
|
40
40
|
|
|
41
41
|
**Boundary-free Adaptive Seeded Expansion** (BASE) discovers the neighbourhood around seed nodes without any configuration. You provide seeds and a priority function; BASE expands outward, visiting the most interesting nodes first and recording paths when search frontiers from different seeds collide. It stops naturally when there is nothing left to explore — no depth limits, no size thresholds, no parameters to tune.
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ Three key properties:
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
-
#### DOME: Degree-Ordered Multi-seed
|
|
53
|
+
#### DOME: Degree-Ordered Multi-seed Exploration
|
|
54
54
|
|
|
55
55
|
Explores low-connectivity nodes before hubs. In a social network, DOME visits niche specialists before reaching the well-connected influencers, discovering the quiet corners of the graph before the busy crossroads.
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@ where $\deg^{+}(v)$ is weighted out-degree, $\deg^{-}(v)$ is weighted in-degree,
|
|
|
60
60
|
|
|
61
61
|
---
|
|
62
62
|
|
|
63
|
-
####
|
|
63
|
+
#### Exploration Variants
|
|
64
64
|
|
|
65
65
|
| Algorithm | Priority Function | Phases |
|
|
66
66
|
| --------- | ------------------------------------------------------ | ------ |
|
|
@@ -80,7 +80,7 @@ where $\deg^{+}(v)$ is weighted out-degree, $\deg^{-}(v)$ is weighted in-degree,
|
|
|
80
80
|
|
|
81
81
|
---
|
|
82
82
|
|
|
83
|
-
#### EDGE: Entropy-Driven Graph
|
|
83
|
+
#### EDGE: Entropy-Driven Graph Exploration
|
|
84
84
|
|
|
85
85
|
Finds nodes that sit at the boundary between different kinds of things. If a person's friends include scientists, artists, and engineers (high type diversity), EDGE visits them early — they are likely bridges between communities.
|
|
86
86
|
|
|
@@ -90,7 +90,7 @@ where $H_{\text{local}}(v) = -\sum_{\tau} p(\tau) \log p(\tau)$ is the Shannon e
|
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
-
#### PIPE: Path-potential Informed Priority
|
|
93
|
+
#### PIPE: Path-potential Informed Priority Exploration
|
|
94
94
|
|
|
95
95
|
Rushes towards nodes that are about to connect two search frontiers. When expanding from multiple seeds, PIPE detects that a node's neighbours have already been reached by another seed's frontier — meaning a connecting path is one step away.
|
|
96
96
|
|
|
@@ -100,7 +100,7 @@ where $\mathrm{pathPotential}(v) = \lvert N(v) \cap \bigcup_{j \neq i} V_j \rver
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
#### SAGE: Salience-Accumulation Guided
|
|
103
|
+
#### SAGE: Salience-Accumulation Guided Exploration
|
|
104
104
|
|
|
105
105
|
Learns from its own discoveries. Phase 1 explores by degree (like DOME). Once the first path is found, SAGE switches to Phase 2: nodes that appear in many discovered paths get top priority, guiding expansion towards structurally rich regions.
|
|
106
106
|
|
|
@@ -112,7 +112,7 @@ where $\text{salience}(v)$ counts discovered paths containing $v$.
|
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
115
|
-
#### REACH: Retrospective
|
|
115
|
+
#### REACH: Retrospective Exploration with Adaptive Convergence
|
|
116
116
|
|
|
117
117
|
Uses the quality of already-discovered paths to steer future exploration. Phase 1 explores by degree. Once paths are found, REACH asks "which unexplored nodes look structurally similar to the endpoints of my best paths?" and prioritises those — seeking more of what already worked.
|
|
118
118
|
|
|
@@ -124,7 +124,7 @@ where $\widehat{\text{MI}}(v) = \frac{1}{\lvert \mathcal{P}\_{\text{top}} \rvert
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
#### MAZE: Multi-frontier Adaptive Zone
|
|
127
|
+
#### MAZE: Multi-frontier Adaptive Zone Exploration
|
|
128
128
|
|
|
129
129
|
Combines the best of PIPE and SAGE across three phases. First, it races to find initial paths using path potential (like PIPE). Then it refines exploration using salience feedback (like SAGE). Finally, it decides when to stop based on whether it's still discovering diverse, high-quality paths.
|
|
130
130
|
|
|
@@ -136,7 +136,7 @@ Phase 1 uses path potential until $M$ paths found. Phase 2 adds salience feedbac
|
|
|
136
136
|
|
|
137
137
|
---
|
|
138
138
|
|
|
139
|
-
#### TIDE: Total Interconnected Degree
|
|
139
|
+
#### TIDE: Total Interconnected Degree Exploration
|
|
140
140
|
|
|
141
141
|
Avoids dense clusters by looking at total neighbourhood connectivity. A node surrounded by other well-connected nodes gets deferred; a node in a quiet corner of the graph gets explored first.
|
|
142
142
|
|
|
@@ -146,7 +146,7 @@ Related to EDGE but uses raw degree sums rather than entropy.
|
|
|
146
146
|
|
|
147
147
|
---
|
|
148
148
|
|
|
149
|
-
#### LACE: Local Affinity-Computed
|
|
149
|
+
#### LACE: Local Affinity-Computed Exploration
|
|
150
150
|
|
|
151
151
|
Explores towards nodes that are most similar to what the frontier has already seen. If a candidate node shares many neighbours with the explored region, it gets priority — building outward from a coherent core.
|
|
152
152
|
|
|
@@ -166,7 +166,7 @@ Related to PIPE but omits the degree numerator, making it more aggressive at pri
|
|
|
166
166
|
|
|
167
167
|
---
|
|
168
168
|
|
|
169
|
-
#### FUSE: Fused Utility-Salience
|
|
169
|
+
#### FUSE: Fused Utility-Salience Exploration
|
|
170
170
|
|
|
171
171
|
Balances two signals simultaneously: how connected a node is (degree) and how strongly it relates to the explored region (MI). The weight $w$ controls the trade-off — at $w=0$ it behaves like DOME, at $w=1$ it behaves like LACE.
|
|
172
172
|
|
|
@@ -196,7 +196,7 @@ Related to MAZE but adapts spatially (per-node) rather than temporally (per-phas
|
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
199
|
-
####
|
|
199
|
+
#### Exploration Baselines
|
|
200
200
|
|
|
201
201
|
| Algorithm | Priority Function | Description |
|
|
202
202
|
| --------------------- | ------------------------------ | ------------------------------------------ |
|
|
@@ -325,7 +325,7 @@ where $c(\tau_u)$ is the count of nodes with the same type as $u$.
|
|
|
325
325
|
|
|
326
326
|
### Seed Selection: GRASP
|
|
327
327
|
|
|
328
|
-
**Graph-agnostic Representative seed pAir Sampling** picks starting points for
|
|
328
|
+
**Graph-agnostic Representative seed pAir Sampling** picks starting points for exploration algorithms. Given a graph you have never seen before, GRASP streams through its edges, samples a representative set of nodes, clusters them by structural role (hubs, bridges, peripherals), and returns seed pairs that cover the full range of structural diversity — without loading the entire graph into memory.
|
|
329
329
|
|
|
330
330
|
Three phases:
|
|
331
331
|
|
|
@@ -342,7 +342,7 @@ Three phases:
|
|
|
342
342
|
```typescript
|
|
343
343
|
import { ... } from 'graphwise'; // Everything
|
|
344
344
|
import { ... } from 'graphwise/graph'; // Graph data structures
|
|
345
|
-
import { ... } from 'graphwise/
|
|
345
|
+
import { ... } from 'graphwise/exploration'; // Exploration algorithms
|
|
346
346
|
import { ... } from 'graphwise/ranking'; // PARSE + baselines
|
|
347
347
|
import { ... } from 'graphwise/ranking/mi'; // MI variants
|
|
348
348
|
import { ... } from 'graphwise/seeds'; // Seed selection
|
|
@@ -3,15 +3,15 @@ import { KGNode } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Five-node linear chain: A – B – C – D – E, all edges weight 1.
|
|
5
5
|
*
|
|
6
|
-
* Used as the primary test graph in
|
|
7
|
-
* placed at the two endpoints (A and E) to exercise bidirectional
|
|
6
|
+
* Used as the primary test graph in exploration unit tests. Seeds are typically
|
|
7
|
+
* placed at the two endpoints (A and E) to exercise bidirectional exploration
|
|
8
8
|
* across the full chain length.
|
|
9
9
|
*/
|
|
10
10
|
export declare function createLinearChainGraph(): AdjacencyMapGraph<KGNode>;
|
|
11
11
|
/**
|
|
12
12
|
* Two disconnected nodes A and B with no edges between them.
|
|
13
13
|
*
|
|
14
|
-
* Used to verify that
|
|
14
|
+
* Used to verify that exploration algorithms correctly return zero paths when
|
|
15
15
|
* seeds cannot be connected.
|
|
16
16
|
*/
|
|
17
17
|
export declare function createDisconnectedGraph(): AdjacencyMapGraph<KGNode>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { NodeId, ReadableGraph, NodeData, EdgeData } from '../../graph';
|
|
2
|
-
import {
|
|
2
|
+
import { ExplorationPath, ExplorationResult, ExplorationStats } from '../../exploration';
|
|
3
3
|
import { MIFunction } from '../../ranking/mi';
|
|
4
4
|
/**
|
|
5
|
-
* Create an
|
|
5
|
+
* Create an ExplorationPath from an array of node IDs.
|
|
6
6
|
*
|
|
7
7
|
* The first node becomes the source seed and the last becomes the target seed.
|
|
8
8
|
* Useful for constructing paths in tests without manually creating Seed objects.
|
|
9
9
|
*
|
|
10
10
|
* @param nodes - Array of node IDs forming the path (must have at least 1 element)
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns ExplorationPath with fromSeed and toSeed inferred from endpoints
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
@@ -18,7 +18,7 @@ import { MIFunction } from '../../ranking/mi';
|
|
|
18
18
|
* // path.nodes === ['A', 'B', 'C']
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function createPath(nodes: readonly NodeId[]):
|
|
21
|
+
export declare function createPath(nodes: readonly NodeId[]): ExplorationPath;
|
|
22
22
|
/**
|
|
23
23
|
* Compute the mean MI across all edges in a single path.
|
|
24
24
|
*
|
|
@@ -40,18 +40,18 @@ export declare function createPath(nodes: readonly NodeId[]): ExpansionPath;
|
|
|
40
40
|
* // score is geometric mean of MI(A,B) and MI(B,C)
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export declare function pathMI<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, path:
|
|
43
|
+
export declare function pathMI<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, path: ExplorationPath, mi: MIFunction<N, E>): number;
|
|
44
44
|
/**
|
|
45
|
-
* Assert that an
|
|
45
|
+
* Assert that an ExplorationResult has the four required top-level properties.
|
|
46
46
|
*
|
|
47
47
|
* Checks for `paths`, `sampledNodes`, `sampledEdges`, and `stats`. Intended
|
|
48
|
-
* as a concise structural guard in
|
|
48
|
+
* as a concise structural guard in exploration unit tests.
|
|
49
49
|
*
|
|
50
|
-
* @param result - The
|
|
50
|
+
* @param result - The exploration result to validate
|
|
51
51
|
*/
|
|
52
|
-
export declare function assertExpansionResultShape(result:
|
|
52
|
+
export declare function assertExpansionResultShape(result: ExplorationResult): void;
|
|
53
53
|
/**
|
|
54
|
-
* Assert that an
|
|
54
|
+
* Assert that an ExplorationStats object has all expected numeric fields and
|
|
55
55
|
* a valid termination reason.
|
|
56
56
|
*
|
|
57
57
|
* Checks `iterations`, `nodesVisited`, `edgesTraversed`, `pathsFound`,
|
|
@@ -59,7 +59,7 @@ export declare function assertExpansionResultShape(result: ExpansionResult): voi
|
|
|
59
59
|
*
|
|
60
60
|
* @param stats - The stats object to validate
|
|
61
61
|
*/
|
|
62
|
-
export declare function assertValidStats(stats:
|
|
62
|
+
export declare function assertValidStats(stats: ExplorationStats): void;
|
|
63
63
|
/**
|
|
64
64
|
* Compute the mean MI across all edges in all paths.
|
|
65
65
|
*
|
|
@@ -81,5 +81,5 @@ export declare function assertValidStats(stats: ExpansionStats): void;
|
|
|
81
81
|
* const avgScore = meanPathMI(graph, paths, jaccard);
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
export declare function meanPathMI<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, paths: readonly
|
|
84
|
+
export declare function meanPathMI<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, paths: readonly ExplorationPath[], mi: MIFunction<N, E>): number;
|
|
85
85
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe,CAiBpE;AAoBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAC5D,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,IAAI,EAAE,eAAe,EACrB,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAClB,MAAM,CAgCR;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAa1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CA8B9D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAChE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAClB,MAAM,CAeR"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Test fixtures infrastructure.
|
|
3
3
|
*
|
|
4
4
|
* Provides types, helpers, and graph builders for integration tests
|
|
5
|
-
* across
|
|
5
|
+
* across exploration, ranking, and other algorithms.
|
|
6
6
|
*/
|
|
7
7
|
export * from './types';
|
|
8
8
|
export * from './helpers';
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { NodeId, NodeData, EdgeData, ReadableGraph } from '../../graph';
|
|
2
|
-
import {
|
|
2
|
+
import { ExplorationResult } from '../../exploration/types';
|
|
3
3
|
import { PARSEResult } from '../../ranking/parse';
|
|
4
4
|
/**
|
|
5
5
|
* Fraction of visited nodes whose degree is below the 90th percentile of all
|
|
6
6
|
* sampled node degrees. A high ratio indicates the algorithm successfully
|
|
7
7
|
* defers high-degree hubs in favour of lower-degree nodes.
|
|
8
8
|
*/
|
|
9
|
-
export declare function hubDeferralRatio<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, result:
|
|
9
|
+
export declare function hubDeferralRatio<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, result: ExplorationResult): number;
|
|
10
10
|
/**
|
|
11
11
|
* Count of distinct intermediate nodes (i.e. excluding endpoints) across all
|
|
12
12
|
* discovered paths. Higher values indicate broader path diversity.
|
|
13
13
|
*/
|
|
14
|
-
export declare function pathDiversity(result:
|
|
14
|
+
export declare function pathDiversity(result: ExplorationResult): number;
|
|
15
15
|
/**
|
|
16
16
|
* Ratio of sampled edges to sampled nodes. Reflects how densely the sampled
|
|
17
17
|
* subgraph is connected (higher = more edges per node).
|
|
18
18
|
*/
|
|
19
|
-
export declare function subgraphDensity(result:
|
|
19
|
+
export declare function subgraphDensity(result: ExplorationResult): number;
|
|
20
20
|
/**
|
|
21
21
|
* Ratio of discovered paths to total nodes visited. Measures how efficiently
|
|
22
|
-
* the
|
|
22
|
+
* the exploration produced useful paths relative to exploration cost.
|
|
23
23
|
*/
|
|
24
|
-
export declare function coverageEfficiency(result:
|
|
24
|
+
export declare function coverageEfficiency(result: ExplorationResult): number;
|
|
25
25
|
/**
|
|
26
26
|
* Ratio of total iterations to paths discovered. Measures how many
|
|
27
27
|
* iterations were required per path. Returns Infinity when no paths
|
|
28
|
-
* were found (
|
|
28
|
+
* were found (exploration terminated without connecting seeds).
|
|
29
29
|
*/
|
|
30
|
-
export declare function firstPathLatency(result:
|
|
30
|
+
export declare function firstPathLatency(result: ExplorationResult): number;
|
|
31
31
|
/**
|
|
32
32
|
* Number of distinct node types present in the sampled node set.
|
|
33
33
|
* Nodes without a `type` property are counted as a single unnamed type.
|
|
34
34
|
*/
|
|
35
|
-
export declare function typeCoverage<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, result:
|
|
35
|
+
export declare function typeCoverage<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, result: ExplorationResult): number;
|
|
36
36
|
/**
|
|
37
37
|
* Number of connected components that contain at least one path node,
|
|
38
38
|
* determined via union-find over the sampled edge set. Higher values
|
|
39
39
|
* indicate paths spanning structurally distant regions of the graph.
|
|
40
40
|
*/
|
|
41
|
-
export declare function communitySpan(result:
|
|
41
|
+
export declare function communitySpan(result: ExplorationResult): number;
|
|
42
42
|
/**
|
|
43
43
|
* Spearman rank correlation coefficient between two rankings (arrays of node
|
|
44
44
|
* IDs ordered from highest to lowest). Returns a value in [-1, 1] where 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EACtE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,MAAM,EAAE,iBAAiB,GACvB,MAAM,CAaR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAa/D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAMjE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAMpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAKlE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAClE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,MAAM,EAAE,iBAAiB,GACvB,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA4C/D;AAMD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,MAAM,EAAE,GACzB,MAAM,CA+BR;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,MAAM,EAAE,GACzB,MAAM,CAsCR;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACd,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAS9D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CA+B3D;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAK1E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeData, EdgeData, ReadableGraph } from '../../graph';
|
|
2
|
-
import { Seed } from '../../
|
|
2
|
+
import { Seed } from '../../exploration';
|
|
3
3
|
/**
|
|
4
4
|
* Knowledge graph node with optional label and type.
|
|
5
5
|
*/
|
|
@@ -27,7 +27,7 @@ export interface KGEdge extends EdgeData {
|
|
|
27
27
|
export interface TestGraphFixture {
|
|
28
28
|
/** The test graph */
|
|
29
29
|
readonly graph: ReadableGraph;
|
|
30
|
-
/** Seed nodes for
|
|
30
|
+
/** Seed nodes for exploration */
|
|
31
31
|
readonly seeds: readonly Seed[];
|
|
32
32
|
/** Optional metadata about the fixture (e.g. structure description) */
|
|
33
33
|
readonly metadata: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/__test__/fixtures/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,MAAO,SAAQ,QAAQ;IACvC,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,MAAO,SAAQ,QAAQ;IACvC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAChC,qBAAqB;IACrB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C"}
|
package/dist/async/protocol.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export type GraphOpResponse<N extends NodeData = NodeData, E extends EdgeData =
|
|
|
64
64
|
} | {
|
|
65
65
|
readonly tag: "progress";
|
|
66
66
|
};
|
|
67
|
-
/** Progress statistics emitted during
|
|
67
|
+
/** Progress statistics emitted during exploration. */
|
|
68
68
|
export interface ProgressStats {
|
|
69
69
|
readonly iterations: number;
|
|
70
70
|
readonly nodesVisited: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/async/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEtE,gEAAgE;AAChE,MAAM,MAAM,OAAO,GAChB;IACA,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAC9B,GACD;IACA,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAC9B,GACD;IAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChD;IACA,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACvB,GACD;IAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChD;IACA,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAC9B,GACD;IACA,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,GAA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DAAsD;AACtD,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NodeData, EdgeData, ReadableGraph } from '../graph';
|
|
2
2
|
import { GraphOp, GraphOpResponse } from '../async/protocol';
|
|
3
|
-
import { Seed,
|
|
3
|
+
import { Seed, ExplorationResult, ExplorationConfig } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* Generator core of the BASE
|
|
5
|
+
* Generator core of the BASE exploration algorithm.
|
|
6
6
|
*
|
|
7
7
|
* Yields GraphOp objects to request graph data, allowing the caller to
|
|
8
8
|
* provide a sync or async runner. The optional `graphRef` parameter is
|
|
@@ -11,14 +11,14 @@ import { Seed, ExpansionResult, ExpansionConfig } from './types';
|
|
|
11
11
|
* graph may be supplied instead.
|
|
12
12
|
*
|
|
13
13
|
* @param graphMeta - Immutable graph metadata (directed, nodeCount, edgeCount)
|
|
14
|
-
* @param seeds - Seed nodes for
|
|
14
|
+
* @param seeds - Seed nodes for exploration
|
|
15
15
|
* @param config - Expansion configuration (priority, limits, debug)
|
|
16
16
|
* @param graphRef - Optional real graph reference for context.graph in priority functions
|
|
17
|
-
* @returns An
|
|
17
|
+
* @returns An ExplorationResult with all discovered paths and statistics
|
|
18
18
|
*/
|
|
19
19
|
export declare function baseCore<N extends NodeData, E extends EdgeData>(graphMeta: {
|
|
20
20
|
readonly directed: boolean;
|
|
21
21
|
readonly nodeCount: number;
|
|
22
22
|
readonly edgeCount: number;
|
|
23
|
-
}, seeds: readonly Seed[], config?:
|
|
23
|
+
}, seeds: readonly Seed[], config?: ExplorationConfig<N, E>, graphRef?: ReadableGraph<N, E>): Generator<GraphOp, ExplorationResult, GraphOpResponse<N, E>>;
|
|
24
24
|
//# sourceMappingURL=base-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-core.d.ts","sourceRoot":"","sources":["../../src/exploration/base-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAU,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,KAAK,EACX,IAAI,EACJ,iBAAiB,EAGjB,iBAAiB,EAGjB,MAAM,SAAS,CAAC;AAqBjB;;;;;;;;;;;;;;GAcG;AACH,wBAAiB,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAC/D,SAAS,EAAE;IACV,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B,EACD,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAChC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5B,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAoR9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-core.unit.test.d.ts","sourceRoot":"","sources":["../../src/exploration/base-core.unit.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodeId } from '../graph';
|
|
2
|
-
import { Seed,
|
|
2
|
+
import { Seed, ExplorationPath, ExplorationResult, ExplorationStats } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Internal queue entry for frontier
|
|
4
|
+
* Internal queue entry for frontier exploration.
|
|
5
5
|
*/
|
|
6
6
|
export interface QueueEntry {
|
|
7
7
|
nodeId: NodeId;
|
|
@@ -11,13 +11,13 @@ export interface QueueEntry {
|
|
|
11
11
|
/**
|
|
12
12
|
* Limits structure used by continueExpansion.
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface ExplorationLimits {
|
|
15
15
|
readonly maxIterations: number;
|
|
16
16
|
readonly maxNodes: number;
|
|
17
17
|
readonly maxPaths: number;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Check whether
|
|
20
|
+
* Check whether exploration should continue given current progress.
|
|
21
21
|
*
|
|
22
22
|
* Returns shouldContinue=false as soon as any configured limit is reached,
|
|
23
23
|
* along with the appropriate termination reason.
|
|
@@ -25,12 +25,12 @@ export interface ExpansionLimits {
|
|
|
25
25
|
* @param iterations - Number of iterations completed so far
|
|
26
26
|
* @param nodesVisited - Number of distinct nodes visited so far
|
|
27
27
|
* @param pathsFound - Number of paths discovered so far
|
|
28
|
-
* @param limits - Configured
|
|
28
|
+
* @param limits - Configured exploration limits (0 = unlimited)
|
|
29
29
|
* @returns Whether to continue and the termination reason if stopping
|
|
30
30
|
*/
|
|
31
|
-
export declare function continueExpansion(iterations: number, nodesVisited: number, pathsFound: number, limits:
|
|
31
|
+
export declare function continueExpansion(iterations: number, nodesVisited: number, pathsFound: number, limits: ExplorationLimits): {
|
|
32
32
|
shouldContinue: boolean;
|
|
33
|
-
termination:
|
|
33
|
+
termination: ExplorationStats["termination"];
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Reconstruct path from collision point.
|
|
@@ -45,13 +45,13 @@ export declare function continueExpansion(iterations: number, nodesVisited: numb
|
|
|
45
45
|
* @param seeds - Seed nodes, one per frontier
|
|
46
46
|
* @returns The reconstructed path, or null if seeds are missing
|
|
47
47
|
*/
|
|
48
|
-
export declare function reconstructPath(collisionNode: NodeId, frontierA: number, frontierB: number, predecessors: readonly Map<NodeId, NodeId | null>[], seeds: readonly Seed[]):
|
|
48
|
+
export declare function reconstructPath(collisionNode: NodeId, frontierA: number, frontierB: number, predecessors: readonly Map<NodeId, NodeId | null>[], seeds: readonly Seed[]): ExplorationPath | null;
|
|
49
49
|
/**
|
|
50
|
-
* Create an empty
|
|
50
|
+
* Create an empty exploration result for early termination (e.g. no seeds given).
|
|
51
51
|
*
|
|
52
52
|
* @param algorithm - Name of the algorithm producing this result
|
|
53
53
|
* @param startTime - performance.now() timestamp taken before the algorithm began
|
|
54
|
-
* @returns An
|
|
54
|
+
* @returns An ExplorationResult with zero paths and zero stats
|
|
55
55
|
*/
|
|
56
|
-
export declare function emptyResult(algorithm: string, startTime: number):
|
|
56
|
+
export declare function emptyResult(algorithm: string, startTime: number): ExplorationResult;
|
|
57
57
|
//# sourceMappingURL=base-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-helpers.d.ts","sourceRoot":"","sources":["../../src/exploration/base-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EACX,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,GACvB;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;CAAE,CAW3E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC9B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,EACnD,KAAK,EAAE,SAAS,IAAI,EAAE,GACpB,eAAe,GAAG,IAAI,CAuCxB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GACf,iBAAiB,CAgBnB"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { NodeData, EdgeData, ReadableGraph } from '../graph';
|
|
2
2
|
import { AsyncReadableGraph } from '../graph/async-interfaces';
|
|
3
3
|
import { AsyncRunnerOptions } from '../async/types';
|
|
4
|
-
import { Seed,
|
|
4
|
+
import { Seed, ExplorationResult, ExplorationConfig } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* Configuration for the async BASE
|
|
6
|
+
* Configuration for the async BASE exploration algorithm.
|
|
7
7
|
*
|
|
8
|
-
* Extends
|
|
8
|
+
* Extends ExplorationConfig with async runner options (cancellation, progress,
|
|
9
9
|
* yield strategy).
|
|
10
10
|
*/
|
|
11
|
-
export interface AsyncExpansionConfig<N extends NodeData = NodeData, E extends EdgeData = EdgeData> extends
|
|
11
|
+
export interface AsyncExpansionConfig<N extends NodeData = NodeData, E extends EdgeData = EdgeData> extends ExplorationConfig<N, E>, AsyncRunnerOptions {
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Run BASE
|
|
14
|
+
* Run BASE exploration synchronously.
|
|
15
15
|
*
|
|
16
16
|
* Delegates to baseCore + runSync. Behaviour is identical to the previous
|
|
17
17
|
* direct implementation — all existing callers are unaffected.
|
|
18
18
|
*
|
|
19
19
|
* @param graph - Source graph
|
|
20
|
-
* @param seeds - Seed nodes for
|
|
20
|
+
* @param seeds - Seed nodes for exploration
|
|
21
21
|
* @param config - Expansion configuration
|
|
22
22
|
* @returns Expansion result with discovered paths
|
|
23
23
|
*/
|
|
24
|
-
export declare function base<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, seeds: readonly Seed[], config?:
|
|
24
|
+
export declare function base<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, seeds: readonly Seed[], config?: ExplorationConfig<N, E>): ExplorationResult;
|
|
25
25
|
/**
|
|
26
|
-
* Run BASE
|
|
26
|
+
* Run BASE exploration asynchronously.
|
|
27
27
|
*
|
|
28
28
|
* Delegates to baseCore + runAsync. Supports:
|
|
29
29
|
* - Cancellation via AbortSignal (config.signal)
|
|
@@ -35,9 +35,9 @@ export declare function base<N extends NodeData, E extends EdgeData>(graph: Read
|
|
|
35
35
|
* priority (DOME) does not access context.graph and works correctly.
|
|
36
36
|
*
|
|
37
37
|
* @param graph - Async source graph
|
|
38
|
-
* @param seeds - Seed nodes for
|
|
38
|
+
* @param seeds - Seed nodes for exploration
|
|
39
39
|
* @param config - Expansion and async runner configuration
|
|
40
|
-
* @returns Promise resolving to the
|
|
40
|
+
* @returns Promise resolving to the exploration result
|
|
41
41
|
*/
|
|
42
|
-
export declare function baseAsync<N extends NodeData, E extends EdgeData>(graph: AsyncReadableGraph<N, E>, seeds: readonly Seed[], config?: AsyncExpansionConfig<N, E>): Promise<
|
|
42
|
+
export declare function baseAsync<N extends NodeData, E extends EdgeData>(graph: AsyncReadableGraph<N, E>, seeds: readonly Seed[], config?: AsyncExpansionConfig<N, E>): Promise<ExplorationResult>;
|
|
43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@
|
|
|
1
|
+
{"version":3,"file":"base.unit.test.d.ts","sourceRoot":"","sources":["../../src/exploration/base.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cross-algorithm comparison integration tests for
|
|
2
|
+
* Cross-algorithm comparison integration tests for exploration algorithms.
|
|
3
3
|
*
|
|
4
|
-
* Runs all
|
|
4
|
+
* Runs all exploration algorithms head-to-head on the same graphs to verify
|
|
5
5
|
* relative performance properties. Tests are structural rather than exact —
|
|
6
6
|
* they validate ordering relationships and quality bounds with tolerance.
|
|
7
7
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison.integration.test.d.ts","sourceRoot":"","sources":["../../src/exploration/comparison.integration.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeData, EdgeData, ReadableGraph } from '../graph';
|
|
2
2
|
import { AsyncReadableGraph } from '../graph/async-interfaces';
|
|
3
|
-
import { Seed,
|
|
3
|
+
import { Seed, ExplorationResult, ExplorationConfig, PriorityContext } from './types';
|
|
4
4
|
import { AsyncExpansionConfig } from './base';
|
|
5
5
|
/**
|
|
6
6
|
* DFS priority function: negative iteration produces LIFO ordering.
|
|
@@ -10,25 +10,25 @@ import { AsyncExpansionConfig } from './base';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function dfsPriorityFn<N extends NodeData, E extends EdgeData>(_nodeId: string, context: PriorityContext<N, E>): number;
|
|
12
12
|
/**
|
|
13
|
-
* Run DFS-priority
|
|
13
|
+
* Run DFS-priority exploration (LIFO discovery order).
|
|
14
14
|
*
|
|
15
15
|
* Uses the BASE framework with a negative-iteration priority function,
|
|
16
16
|
* which causes the most recently discovered node to be expanded first —
|
|
17
17
|
* equivalent to depth-first search behaviour.
|
|
18
18
|
*
|
|
19
19
|
* @param graph - Source graph
|
|
20
|
-
* @param seeds - Seed nodes for
|
|
20
|
+
* @param seeds - Seed nodes for exploration
|
|
21
21
|
* @param config - Expansion configuration
|
|
22
22
|
* @returns Expansion result with discovered paths
|
|
23
23
|
*/
|
|
24
|
-
export declare function dfsPriority<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, seeds: readonly Seed[], config?:
|
|
24
|
+
export declare function dfsPriority<N extends NodeData, E extends EdgeData>(graph: ReadableGraph<N, E>, seeds: readonly Seed[], config?: ExplorationConfig<N, E>): ExplorationResult;
|
|
25
25
|
/**
|
|
26
|
-
* Run DFS-priority
|
|
26
|
+
* Run DFS-priority exploration asynchronously (LIFO discovery order).
|
|
27
27
|
*
|
|
28
28
|
* @param graph - Async source graph
|
|
29
|
-
* @param seeds - Seed nodes for
|
|
29
|
+
* @param seeds - Seed nodes for exploration
|
|
30
30
|
* @param config - Expansion and async runner configuration
|
|
31
|
-
* @returns Promise resolving to the
|
|
31
|
+
* @returns Promise resolving to the exploration result
|
|
32
32
|
*/
|
|
33
|
-
export declare function dfsPriorityAsync<N extends NodeData, E extends EdgeData>(graph: AsyncReadableGraph<N, E>, seeds: readonly Seed[], config?: AsyncExpansionConfig<N, E>): Promise<
|
|
33
|
+
export declare function dfsPriorityAsync<N extends NodeData, E extends EdgeData>(graph: AsyncReadableGraph<N, E>, seeds: readonly Seed[], config?: AsyncExpansionConfig<N, E>): Promise<ExplorationResult>;
|
|
34
34
|
//# sourceMappingURL=dfs-priority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dfs-priority.d.ts","sourceRoot":"","sources":["../../src/exploration/dfs-priority.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACX,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EACnE,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5B,MAAM,CAER;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EACjE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9B,iBAAiB,CAKnB;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAC5E,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAC/B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,MAAM,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GACjC,OAAO,CAAC,iBAAiB,CAAC,CAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dfs-priority.unit.test.d.ts","sourceRoot":"","sources":["../../src/exploration/dfs-priority.unit.test.ts"],"names":[],"mappings":""}
|