Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vr-complex

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vr-complex

Vietrois-Rips complex builder

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Vietoris-Rips complex builder

Small library for building Vietoris-Rips Complex using incremental algorithm as described in the following paper: "Fast Construction of the Vietoris-Rips Complex" by Afra Zomorodian.

Construction of Vietoris-Rips Complex is much faster than Cech Complex so it has more practical applications.

Installation

npm install vr-complex

or in browser

bower install vr-complex

Usage

Building complex (Betti numbers)

var VR = require('vr-complex');
var vr = new VR();

var cells = [
  [0, 0], // [x, y]
  [1, 1],
  // ...
];
var maxK = 3; // maximum size of simplex (0 - point, 1 - edge, 2 - triangle, ...)
var R = 10; // radius

var simplices = vr.complex(cells, maxK, R);
/*
[
  [[0], [1], ... ], // 0-simplex (points)
  [[0,1], [0,5], ...], // 1-simplex (edges)
  [[0,1,5], [0,1,9], ...], // 2-simplex (triangles)
  ... // 3-simplex (tetrahedrons)
]
*/

Computing homology

var simplices = vr.complex(cells, maxK, R); // compute simplices
var homology = vr.homology(3); // compute first 3 Betti numbers

Test

To test, install mocha globally and run following command:

npm test

Future releases

  • benchmark

Keywords

FAQs

Package last updated on 24 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc