Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 562 Bytes

readme.md

File metadata and controls

14 lines (9 loc) · 562 Bytes

graph-mst

generates a minimum spanning tree from a weighted graph

demo

This module exposes the span function, which uses Prim's algorithm to generate a minimum spanning tree from a weighted graph.

usage

span(graph) -> tree

Converts a graph with the fields nodes : [ x, y ] and edges : { endpoints : [ ...nodeIndices ], weight: Number } to a minimum spanning tree.