graphwise 1.10.0 → 1.11.0
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/dist/index/index.cjs +4 -0
- package/dist/index/index.js +2 -2
- package/dist/seeds/crest.d.ts +48 -0
- package/dist/seeds/crest.d.ts.map +1 -0
- package/dist/seeds/crest.unit.test.d.ts +2 -0
- package/dist/seeds/crest.unit.test.d.ts.map +1 -0
- package/dist/seeds/crisp.d.ts +57 -0
- package/dist/seeds/crisp.d.ts.map +1 -0
- package/dist/seeds/crisp.unit.test.d.ts +2 -0
- package/dist/seeds/crisp.unit.test.d.ts.map +1 -0
- package/dist/seeds/index.cjs +714 -4
- package/dist/seeds/index.cjs.map +1 -1
- package/dist/seeds/index.d.ts +4 -0
- package/dist/seeds/index.d.ts.map +1 -1
- package/dist/seeds/index.js +711 -5
- package/dist/seeds/index.js.map +1 -1
- package/dist/seeds/spine.d.ts +50 -0
- package/dist/seeds/spine.d.ts.map +1 -0
- package/dist/seeds/spine.unit.test.d.ts +2 -0
- package/dist/seeds/spine.unit.test.d.ts.map +1 -0
- package/dist/seeds/stride.d.ts +55 -0
- package/dist/seeds/stride.d.ts.map +1 -0
- package/dist/seeds/stride.unit.test.d.ts +2 -0
- package/dist/seeds/stride.unit.test.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index/index.cjs
CHANGED
|
@@ -46,6 +46,8 @@ exports.countEdgesOfType = require_utils$1.countEdgesOfType;
|
|
|
46
46
|
exports.countNodesOfType = require_utils$1.countNodesOfType;
|
|
47
47
|
exports.createFuseBatchPriority = require_expansion.createFuseBatchPriority;
|
|
48
48
|
exports.createSiftBatchPriority = require_expansion.createSiftBatchPriority;
|
|
49
|
+
exports.crest = require_seeds.crest;
|
|
50
|
+
exports.crisp = require_seeds.crisp;
|
|
49
51
|
exports.csrToTypedBuffers = require_logic.csrToTypedBuffers;
|
|
50
52
|
exports.defaultYieldStrategy = require_utils.defaultYieldStrategy;
|
|
51
53
|
exports.degreeSum = require_ranking.degreeSum;
|
|
@@ -167,9 +169,11 @@ exports.sorensen = require_ranking_mi.sorensen;
|
|
|
167
169
|
exports.sorensenAsync = require_ranking_mi.sorensenAsync;
|
|
168
170
|
exports.span = require_ranking_mi.span;
|
|
169
171
|
exports.spanAsync = require_ranking_mi.spanAsync;
|
|
172
|
+
exports.spine = require_seeds.spine;
|
|
170
173
|
exports.standardBfs = require_expansion.standardBfs;
|
|
171
174
|
exports.standardBfsAsync = require_expansion.standardBfsAsync;
|
|
172
175
|
exports.stratified = require_seeds.stratified;
|
|
176
|
+
exports.stride = require_seeds.stride;
|
|
173
177
|
exports.tide = require_expansion.tide;
|
|
174
178
|
exports.tideAsync = require_expansion.tideAsync;
|
|
175
179
|
exports.warp = require_expansion.warp;
|
package/dist/index/index.js
CHANGED
|
@@ -13,8 +13,8 @@ import { n as jaccardAsync, t as jaccard } from "../jaccard-BwC_NuQu.js";
|
|
|
13
13
|
import { a as communicabilityAsync, c as betweenness, d as jaccardArithmetic, f as widestPath, g as parseAsync, h as parse, i as communicability, l as pagerank, m as shortest, n as randomRanking, o as katz, p as degreeSum, r as resistanceDistance, s as katzAsync, t as hittingTime, u as pagerankAsync } from "../ranking-DOKDBcIR.js";
|
|
14
14
|
import { adamicAdar, adamicAdarAsync, adaptive, adaptiveAsync, cosine, cosineAsync, etch, etchAsync, hubPromoted, hubPromotedAsync, notch, notchAsync, overlapCoefficient, overlapCoefficientAsync, resourceAllocation, resourceAllocationAsync, scale, scaleAsync, skew, skewAsync, sorensen, sorensenAsync, span, spanAsync } from "../ranking/mi/index.js";
|
|
15
15
|
import { a as gpuMIBatch, c as withBackend, d as detectWebGPU, f as isWebGPUAvailable, i as gpuKMeansAssign, l as GPUNotAvailableError, n as gpuDegreeHistogram, o as gpuPageRank, r as gpuJaccardBatch, s as gpuSpmv, t as gpuBfsLevels, u as assertWebGPUAvailable } from "../operations-D9otVlIH.js";
|
|
16
|
-
import { grasp, stratified } from "../seeds/index.js";
|
|
16
|
+
import { crest, crisp, grasp, spine, stratified, stride } from "../seeds/index.js";
|
|
17
17
|
import { computeTrussNumbers, enumerateMotifs, enumerateMotifsWithInstances, extractEgoNetwork, extractInducedSubgraph, extractKCore, extractKTruss, filterSubgraph, getMotifName } from "../extraction/index.js";
|
|
18
18
|
import { CSRReadableGraph, initGPU, initGPUFromDevice } from "../gpu/index.js";
|
|
19
19
|
import { runBatched } from "../async/index.js";
|
|
20
|
-
export { AdjacencyMapGraph, CSRReadableGraph, GPUNotAvailableError, PriorityQueue, _computeMean, adamicAdar, adamicAdarAsync, adaptive, adaptiveAsync, approximateClusteringCoefficient, assertWebGPUAvailable, base, baseAsync, batchClusteringCoefficients, betweenness, bfs, bfsWithPath, collectAsyncIterable, communicability, communicabilityAsync, computeJaccard, computeTrussNumbers, cosine, cosineAsync, countEdgesOfType, countNodesOfType, createFuseBatchPriority, createSiftBatchPriority, csrToTypedBuffers, defaultYieldStrategy, degreeSum, detectWebGPU, dfs, dfsPriority, dfsPriorityAsync, dfsPriorityFn, dfsWithPath, dome, domeAsync, domeHighDegree, domeHighDegreeAsync, edge, edgeAsync, entropyFromCounts, enumerateMotifs, enumerateMotifsWithInstances, etch, etchAsync, extractEgoNetwork, extractInducedSubgraph, extractKCore, extractKTruss, filterSubgraph, flux, fluxAsync, frontierBalanced, frontierBalancedAsync, fuse, fuseAsync, fuseBatchPriority, fuseWithBatchPriority, getMotifName, gpuBfsLevels, gpuDegreeHistogram, gpuJaccardBatch, gpuKMeansAssign, gpuMIBatch, gpuPageRank, gpuSpmv, graphToCSR, grasp, hae, haeAsync, hittingTime, hubPromoted, hubPromotedAsync, initGPU, initGPUFromDevice, isWebGPUAvailable, jaccard, jaccardArithmetic, jaccardAsync, kHop, katz, katzAsync, lace, laceAsync, laceBatchPriority, laceWithBatchPriority, localClusteringCoefficient, localTypeEntropy, maze, mazeAsync, miniBatchKMeans, neighbourIntersection, neighbourOverlap, neighbourSet, normaliseFeatures, normaliseFeatures as zScoreNormalise, normalisedEntropy, notch, notchAsync, opBatchDegree, opBatchNeighbours, opDegree, opGetEdge, opGetNode, opHasNode, opNeighbours, opProgress, opYield, overlapCoefficient, overlapCoefficientAsync, pagerank, pagerankAsync, parse, parseAsync, pipe, pipeAsync, randomPriority, randomPriorityAsync, randomRanking, randomWalk, reach, reachAsync, resistanceDistance, resolveAsyncOp, resolveSyncOp, resourceAllocation, resourceAllocationAsync, runAsync, runBatched, runSync, sage, sageAsync, scale, scaleAsync, shannonEntropy, shortest, sift, siftAsync, siftBatchPriority, siftWithBatchPriority, skew, skewAsync, sorensen, sorensenAsync, span, spanAsync, standardBfs, standardBfsAsync, stratified, tide, tideAsync, warp, warpAsync, widestPath, withBackend };
|
|
20
|
+
export { AdjacencyMapGraph, CSRReadableGraph, GPUNotAvailableError, PriorityQueue, _computeMean, adamicAdar, adamicAdarAsync, adaptive, adaptiveAsync, approximateClusteringCoefficient, assertWebGPUAvailable, base, baseAsync, batchClusteringCoefficients, betweenness, bfs, bfsWithPath, collectAsyncIterable, communicability, communicabilityAsync, computeJaccard, computeTrussNumbers, cosine, cosineAsync, countEdgesOfType, countNodesOfType, createFuseBatchPriority, createSiftBatchPriority, crest, crisp, csrToTypedBuffers, defaultYieldStrategy, degreeSum, detectWebGPU, dfs, dfsPriority, dfsPriorityAsync, dfsPriorityFn, dfsWithPath, dome, domeAsync, domeHighDegree, domeHighDegreeAsync, edge, edgeAsync, entropyFromCounts, enumerateMotifs, enumerateMotifsWithInstances, etch, etchAsync, extractEgoNetwork, extractInducedSubgraph, extractKCore, extractKTruss, filterSubgraph, flux, fluxAsync, frontierBalanced, frontierBalancedAsync, fuse, fuseAsync, fuseBatchPriority, fuseWithBatchPriority, getMotifName, gpuBfsLevels, gpuDegreeHistogram, gpuJaccardBatch, gpuKMeansAssign, gpuMIBatch, gpuPageRank, gpuSpmv, graphToCSR, grasp, hae, haeAsync, hittingTime, hubPromoted, hubPromotedAsync, initGPU, initGPUFromDevice, isWebGPUAvailable, jaccard, jaccardArithmetic, jaccardAsync, kHop, katz, katzAsync, lace, laceAsync, laceBatchPriority, laceWithBatchPriority, localClusteringCoefficient, localTypeEntropy, maze, mazeAsync, miniBatchKMeans, neighbourIntersection, neighbourOverlap, neighbourSet, normaliseFeatures, normaliseFeatures as zScoreNormalise, normalisedEntropy, notch, notchAsync, opBatchDegree, opBatchNeighbours, opDegree, opGetEdge, opGetNode, opHasNode, opNeighbours, opProgress, opYield, overlapCoefficient, overlapCoefficientAsync, pagerank, pagerankAsync, parse, parseAsync, pipe, pipeAsync, randomPriority, randomPriorityAsync, randomRanking, randomWalk, reach, reachAsync, resistanceDistance, resolveAsyncOp, resolveSyncOp, resourceAllocation, resourceAllocationAsync, runAsync, runBatched, runSync, sage, sageAsync, scale, scaleAsync, shannonEntropy, shortest, sift, siftAsync, siftBatchPriority, siftWithBatchPriority, skew, skewAsync, sorensen, sorensenAsync, span, spanAsync, spine, standardBfs, standardBfsAsync, stratified, stride, tide, tideAsync, warp, warpAsync, widestPath, withBackend };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ReadableGraph } from '../graph';
|
|
2
|
+
import { Seed } from '../schemas/index';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for CREST seed selection.
|
|
5
|
+
*/
|
|
6
|
+
export interface CrestOptions {
|
|
7
|
+
/** Number of seed pairs to select (default: 100) */
|
|
8
|
+
readonly nPairs?: number;
|
|
9
|
+
/** Random seed for reproducibility (default: 42) */
|
|
10
|
+
readonly rngSeed?: number;
|
|
11
|
+
/** Jaccard diversity threshold for greedy selection (default: 0.5) */
|
|
12
|
+
readonly diversityThreshold?: number;
|
|
13
|
+
/** Number of candidate pairs to sample before greedy selection (default: 5000) */
|
|
14
|
+
readonly sampleSize?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A seed pair selected by CREST with bridge score metadata.
|
|
18
|
+
*/
|
|
19
|
+
export interface CrestSeedPair {
|
|
20
|
+
/** Source seed */
|
|
21
|
+
readonly source: Seed;
|
|
22
|
+
/** Target seed */
|
|
23
|
+
readonly target: Seed;
|
|
24
|
+
/** Bridge score: ratio of exclusive to shared neighbours */
|
|
25
|
+
readonly bridgeScore: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Result of CREST seed selection.
|
|
29
|
+
*/
|
|
30
|
+
export interface CrestResult {
|
|
31
|
+
/** Selected seed pairs */
|
|
32
|
+
readonly pairs: readonly CrestSeedPair[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* CREST — Community-Revealing Edge Sampling Technique.
|
|
36
|
+
*
|
|
37
|
+
* Samples random node pairs and scores them by the ratio of exclusive
|
|
38
|
+
* to shared neighbours. Pairs with high ratios connect different
|
|
39
|
+
* communities (few shared neighbours, many exclusive). Greedy
|
|
40
|
+
* selection with Jaccard diversity ensures selected pairs are
|
|
41
|
+
* spread across different structural regions.
|
|
42
|
+
*
|
|
43
|
+
* @param graph - The graph to sample seeds from
|
|
44
|
+
* @param options - Configuration options
|
|
45
|
+
* @returns Selected seed pairs with bridge score metadata
|
|
46
|
+
*/
|
|
47
|
+
export declare function crest(graph: ReadableGraph, options?: CrestOptions): CrestResult;
|
|
48
|
+
//# sourceMappingURL=crest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crest.d.ts","sourceRoot":"","sources":["../../src/seeds/crest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,kBAAkB;IAClB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;CACzC;AA4DD;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CACpB,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,YAAiB,GACxB,WAAW,CAiGb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crest.unit.test.d.ts","sourceRoot":"","sources":["../../src/seeds/crest.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ReadableGraph } from '../graph';
|
|
2
|
+
import { Seed } from '../schemas/index';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for CRISP seed selection.
|
|
5
|
+
*/
|
|
6
|
+
export interface CrispOptions {
|
|
7
|
+
/** Number of seed pairs to select (default: 100) */
|
|
8
|
+
readonly nPairs?: number;
|
|
9
|
+
/** Random seed for reproducibility (default: 42) */
|
|
10
|
+
readonly rngSeed?: number;
|
|
11
|
+
/** Minimum BFS distance to consider (default: 2) */
|
|
12
|
+
readonly minDistance?: number;
|
|
13
|
+
/** Maximum BFS distance to consider (default: 4) */
|
|
14
|
+
readonly maxDistance?: number;
|
|
15
|
+
/** Minimum common neighbours required (default: 2) */
|
|
16
|
+
readonly minCommonNeighbours?: number;
|
|
17
|
+
/** Jaccard diversity threshold for greedy selection (default: 0.5) */
|
|
18
|
+
readonly diversityThreshold?: number;
|
|
19
|
+
/** Number of candidate pairs to sample before greedy selection (default: 5000) */
|
|
20
|
+
readonly sampleSize?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A seed pair selected by CRISP with connectivity metadata.
|
|
24
|
+
*/
|
|
25
|
+
export interface CrispSeedPair {
|
|
26
|
+
/** Source seed */
|
|
27
|
+
readonly source: Seed;
|
|
28
|
+
/** Target seed */
|
|
29
|
+
readonly target: Seed;
|
|
30
|
+
/** BFS distance between source and target */
|
|
31
|
+
readonly distance: number;
|
|
32
|
+
/** Common neighbour count */
|
|
33
|
+
readonly commonNeighbours: number;
|
|
34
|
+
/** Connectivity score */
|
|
35
|
+
readonly score: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Result of CRISP seed selection.
|
|
39
|
+
*/
|
|
40
|
+
export interface CrispResult {
|
|
41
|
+
/** Selected seed pairs */
|
|
42
|
+
readonly pairs: readonly CrispSeedPair[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* CRISP — Connectivity-Rich Informed Seed Pairing.
|
|
46
|
+
*
|
|
47
|
+
* Samples random node pairs and scores them by common neighbour count
|
|
48
|
+
* and BFS distance (preferring 2–4 hops, peaking at 3). Greedy
|
|
49
|
+
* selection with Jaccard diversity ensures selected pairs are
|
|
50
|
+
* spread across different structural regions.
|
|
51
|
+
*
|
|
52
|
+
* @param graph - The graph to sample seeds from
|
|
53
|
+
* @param options - Configuration options
|
|
54
|
+
* @returns Selected seed pairs with connectivity metadata
|
|
55
|
+
*/
|
|
56
|
+
export declare function crisp(graph: ReadableGraph, options?: CrispOptions): CrispResult;
|
|
57
|
+
//# sourceMappingURL=crisp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crisp.d.ts","sourceRoot":"","sources":["../../src/seeds/crisp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAA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