Skip to content

@graphty/algorithms / index / kruskalMST

Function: kruskalMST() ​

kruskalMST(s, o?): MstResult

Defined in: indexed/mst.ts:39

Kruskal's minimum spanning forest over logical edges.

The sort is a comparator over an f64 key array, tie-broken by edge index, rather than the design's radix sort on the f32 bit pattern (plan departure DEP-8A-D): the tie-break makes it stable by construction and it has to serve both the f32 arc array and an f64 override.

Parameters ​

s ​

GraphSnapshot

The snapshot

o? ​

MstOptions = {}

The optional per-arc weight override

Returns ​

MstResult

The accepted edge indices and their total weight