// Heat diffusion from a seeds collection: unit heat spread over the seeds flows along edges for time, through the kernel exp(−t·L) of the weighted Laplacian
eles.heatDiffusion(options?: HeatDiffusionOptions): AlgoRun<HeatDiffusionResult>Heat diffusion from a seeds collection: unit heat spread over the seeds flows along edges for time, through the kernel exp(−t·L) of the weighted Laplacian. Total heat is conserved under the default laplacian: 'combinatorial'; 'normalized' diffuses over I − D^{-½}AD^{-½} instead, whose spectrum is bounded whatever the degrees — hubs neither hoard nor flood — at the price of conservation. Async; the vector form is O(E) per series term on the CPU, so there is no GPU path — an explicit executor: 'gpu' rejects and points at heatKernel. Edges are read undirected with positive weights.
| Name | Description |
|---|---|
options: HeatDiffusionOptions? |
|
Fields of options
| Name | Description |
|---|---|
seeds: Collection | null? | the nodes the heat starts on (required for the seed form) |
time: number? | how long the heat flows (default 0.1); must be positive |
weight: WeightFn? | |
laplacian: HeatLaplacian? | which Laplacian drives the diffusion (default 'combinatorial',
L = D − A, heat-conserving); 'normalized' is I − D^{-½}AD^{-½},
whose spectrum is bounded by 2 so the scaling exponent depends on
|
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<HeatDiffusionResult>a promise of the { score } accessor — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.heatDiffusion({ seeds: cy.getElementById('a'), executor: 'cpu' });const result = await run;console.log(result.score(cy.getElementById('a')) > 0); // trueif executor, time or laplacian is invalid, if seeds holds no node of the collection, or if an edge weight is not positive