// Floyd–Warshall all-pairs shortest paths
eles.floydWarshall(options?: FloydWarshallOptions): AlgoRun<FloydWarshallResult>Floyd–Warshall all-pairs shortest paths. O(n³) — for a single source prefer dijkstra/bellmanFord. Async: the expensive whole-graph tier returns promises, and executor ('cpu' | 'gpu' | 'auto', default 'auto'; 'workers' runs the reference on one pool worker) picks where the maths runs; 'cpu' is the reproducible reference.
| Name | Description |
|---|---|
options: FloydWarshallOptions? |
|
Fields of options
| Name | Description |
|---|---|
weight: WeightFn? | |
directed: boolean? | |
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<FloydWarshallResult>a promise of the { distance, path } accessors — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.floydWarshall({ executor: 'cpu' });const result = await run;console.log(result.distance(cy.getElementById('a'), cy.getElementById('c'))); // 2if executor is invalid; rejects if executor: 'gpu' is unavailable in this environment