Skip to content

Commit

Permalink
add metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
semibran committed Mar 4, 2018
1 parent 3e617a9 commit 81e114a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Binary file added img/tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Brandon Semilla

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "emst",
"version": "0.0.0",
"description": "generates a euclidean minimum spanning tree from a given graph",
"author": "semibran (Brandon Semilla)",
"repository": "semibran/emst",
"license": "MIT",
"main": "lib/emst.js",
"keywords": []
}
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# emst
> generates a euclidean minimum spanning tree from a given graph
![tree](img/tree.png)

This module exposes the `span` function, which uses [Prim's algorithm] to generate a [minimum spanning tree] based on [Euclidean distance] from a given graph.

## usage

### `span(graph) -> tree`
Converts a `graph` with the fields `nodes` (a list of `[ x, y ]` pairs) and `edges` (a list of undirected node index pairs) to a minimum spanning tree.

[Prim's algorithm]: https://en.wikipedia.org/wiki/Prim%27s_algorithm
[Minimum spanning tree]: https://en.wikipedia.org/wiki/Minimum_spanning_tree
[Euclidean distance]: https://en.wikipedia.org/wiki/Euclidean_distance

0 comments on commit 81e114a

Please sign in to comment.