// The triad census — every three-node subgraph classified into the sixteen Holland–Leinhardt classes ('003' … '300'; '030T' is the feed-forward loop)
eles.motifCensus(options?: MotifCensusOptions): AlgoRun<MotifCensusResult>The triad census — every three-node subgraph classified into the sixteen Holland–Leinhardt classes ('003' … '300'; '030T' is the feed-forward loop). The counts sum to C(n, 3). Async: executor ('cpu' | 'gpu' | 'auto', default 'auto'; 'workers' runs the reference on one pool worker) picks between sparse wedge walks on the CPU and matmul trace products on the GPU — under 'auto' the GPU only on dense graphs (a mean degree of 64). directed: false reads every edge as mutual, so only 003 / 102 / 201 / 300 (empty / one-edge / path / triangle) can be non-zero.
| Name | Description |
|---|---|
options: MotifCensusOptions? |
|
Fields of options
| Name | Description |
|---|---|
directed: boolean? | read edge direction (default true — the census is a directed
notion; |
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<MotifCensusResult>a promise of { counts } — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.motifCensus({ executor: 'cpu' });const result = await run;console.log(result.counts['021C']); // 1if executor is invalid; rejects if executor: 'gpu' is unavailable in this environment