// The all-pairs heat kernel exp(−t·L) — heat(from, to) is the heat at to after unit heat starts at from (symmetric)
eles.heatKernel(options?: HeatDiffusionOptions): AlgoRun<HeatKernelResult>The all-pairs heat kernel exp(−t·L) — heat(from, to) is the heat at to after unit heat starts at from (symmetric). Async: executor ('cpu' | 'gpu' | 'workers' | 'auto', default 'auto') picks between per-column sparse series on the CPU, the same columns spread over the worker pool (bit-identical to 'cpu') and the dense scaling-and-squaring chain on the GPU — under 'auto' the GPU from 256 nodes at any density, else the pool from 256. laplacian ('combinatorial' | 'normalized', default 'combinatorial') picks L = D − A or I − D^{-½}AD^{-½}. All-pairs (O(n²) memory).
| 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<HeatKernelResult>a promise of the { heat } accessor — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.heatKernel({ seeds: cy.getElementById('a'), executor: 'cpu' });const result = await run;console.log(result.heat(cy.getElementById('a'), cy.getElementById('a')) > 0); // trueif executor, time or laplacian is invalid, or if an edge weight is not positive