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 = ;var 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;/*[ [[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; // compute simplicesvar homology = vr; // compute first 3 Betti numbers
Test
To test, install mocha
globally and run following command:
npm test
Future releases
- benchmark