// Markov clustering (MCL) — flow simulation over the graph, so unlike the attribute-space algorithms this one clusters by structure
eles.markovClustering(options?: MarkovClusteringOptions): AlgoRun<Collection<NodeData, EdgeData, NodeData>[]>Markov clustering (MCL) — flow simulation over the graph, so unlike the attribute-space algorithms this one clusters by structure.
Async: returns a promise, and executor ('cpu' | 'gpu' | 'auto', default 'auto'; 'workers' runs the reference on one pool worker) picks where the expand/inflate iteration runs; 'cpu' is the reproducible reference. maxIterations defaults to 100 (as Python markov_clustering and R MCL), and pruneThreshold (default 0) drops each inflated matrix's entries under it, keeping each column's largest, as markov_clustering's pruning_threshold does.
| Name | Description |
|---|---|
options: MarkovClusteringOptions? |
|
Fields of options
| Name | Description |
|---|---|
expandFactor: number? | |
inflateFactor: number? | |
multFactor: number? | |
maxIterations: number? | the iteration cap (default 100, as Python
|
pruneThreshold: number? | after each inflation, drop entries under this to 0, keeping each
column's largest (default 0: no pruning) — Python
|
attributes: MarkovAttributeFn[]? | |
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<Collection<NodeData, EdgeData, NodeData>[]>a promise of one collection per cluster — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.markovClustering({ executor: 'cpu' });const result = await run;console.log(result.reduce((sum, cluster) => sum + cluster.length, 0)); // 3if executor or pruneThreshold is invalid; rejects if executor: 'gpu' is unavailable in this environment
Also spelled eles.mcl.