# node-kruskal

> Given a distance array, computes the Minimum Spanning Tree using Kruskal's algorithm.

Latest version **0.0.4** (published 2013-04-24) · BSD license · 0 weekly downloads

## Install

```sh
npm install node-kruskal
pnpm add node-kruskal
yarn add node-kruskal
bun add node-kruskal
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2013-04-24 |
| First published | 2013-04-18 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Stofan |
| Maintainers | kas673 |
| Keywords | kruskal, distance, minimum spanning tree |

## Links

- npm: https://www.npmjs.com/package/node-kruskal
- Repository: https://github.com/kas673/node-kruskal
- npm.io page: https://npm.io/package/node-kruskal

## Dependencies (1)

- [async](https://npm.io/package/async.md) x.x.x

## Recent versions

- 0.0.4 (latest) — 2013-04-24
- 0.0.3 — 2013-04-22
- 0.0.2 — 2013-04-19
- 0.0.1 — 2013-04-18

## README

node-kruskal
============

Given a distance array in the form of:

    d = [ [0,1,2,3],
          [1,0,1,2],
          [2,1,0,1],
          [3,2,1,0] ]

calculates the Minimum Spanning Tree (MST) using Kruskal's algorithm. Returns a JSON object containing the MST distance and an array of edges that make up the MST with each edge array containing:

    [row, column, weight]

Install:

    npm install node-kruskal

Usage:

    var kruskal = require('node-kruskal');

Example:

    kruskal.kruskalMST(d, function(results){
		console.log(results);
	});

Output:

    {
      mst: 3,
      mstArray: [[0,1,1],[1,2,1],[2,3,1]]
    }

---
_Source: https://npm.io/package/node-kruskal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
