Skip to content

semibran/graph-mst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published