Skip to content

@graphty/graphty-element / catalog / AlgorithmDescriptor

Interface: AlgorithmDescriptor ​

Defined in: graphty-element/src/catalog/types.ts:680

One algorithm the element can run.

Extended by ​

Properties ​

approximable? ​

optional approximable?: object

Defined in: graphty-element/src/catalog/types.ts:701

defaultSample ​

defaultSample: number

method ​

method: string

plainName ​

plainName: string

seeded ​

seeded: boolean


category ​

category: string & object | "community" | "path" | "centrality" | "flow" | "structure" | "prediction"

Defined in: graphty-element/src/catalog/types.ts:685


complexity ​

complexity: string

Defined in: graphty-element/src/catalog/types.ts:690


cost? ​

optional cost?: (n, m) => number

Defined in: graphty-element/src/catalog/types.ts:700

A cost model in seconds over a graph of n nodes and m edges.

SUPERSEDED BY RegisteredAlgorithm.cost, and not to be set by a plugin. A function is not plain JSON, so a descriptor carrying one stops surviving JSON.stringify and a postMessage -- which is why no built-in sets it and a test pins that. Declare static cost on the algorithm class instead, where the registry holds it beside the class reference and a function belongs.

Parameters ​

n ​

number

m ​

number

Returns ​

number


costClass ​

costClass: "instant" | "iterative" | "heavy" | "cubic" | "unbounded"

Defined in: graphty-element/src/catalog/types.ts:689


description ​

description: string

Defined in: graphty-element/src/catalog/types.ts:684


fields ​

fields: readonly FieldDescriptor[]

Defined in: graphty-element/src/catalog/types.ts:687


key ​

key: AlgorithmKey

Defined in: graphty-element/src/catalog/types.ts:681


options ​

options: readonly OptionDescriptor[]

Defined in: graphty-element/src/catalog/types.ts:688


plainName ​

plainName: string

Defined in: graphty-element/src/catalog/types.ts:682


requires? ​

optional requires?: object

Defined in: graphty-element/src/catalog/types.ts:707

accelerator? ​

optional accelerator?: boolean

connected? ​

optional connected?: boolean

directed? ​

optional directed?: boolean

weighted? ​

optional weighted?: boolean


scopeInput? ​

optional scopeInput?: "none" | "subgraph"

Defined in: graphty-element/src/catalog/types.ts:725

What a run over a scope computes on. "subgraph": the scope's own nodes and edges, so a small scope is estimated and run as small. "none": the whole graph, keeping only the scope's values, so the run is estimated -- and refused -- as a whole-graph run.

DERIVED, NOT AUTHORED: Algorithm.register fills it from the class's static scopeInput, which is the one declaration the run, its caveat and this field all read. A plugin leaves it out of the descriptor it writes; one that disagrees with the class is refused.

OPEN UNION: values may be added in a minor release ("mask" is reserved); treat an unknown value as "none".


shape ​

shape: "node-metric" | "edge-metric" | "community" | "layered-grouping" | "category-table" | "path" | "node-set" | "edge-set" | "pair-list" | "temporal" | "fact"

Defined in: graphty-element/src/catalog/types.ts:686


technicalName ​

technicalName: string

Defined in: graphty-element/src/catalog/types.ts:683