scikit-tda / kepler-mapper

Kepler Mapper: A flexible Python implementation of the Mapper algorithm.
https://kepler-mapper.scikit-tda.org
MIT License
623 stars 180 forks source link

Add support for new kinds of nerves: n-simplices and min-intersection. #37

Closed sauln closed 6 years ago

sauln commented 6 years ago

Now that @michiexile abstracted a nerve class, we can include support for other nerves. Most obvious are a min-intersection nerve and an n-simplices nerve. Though I believe we will also need a custom nerve for multi-mapper and we could experiment with a multi-nerve.

min-intersection

It would be nice to set a minimum number of points each cluster has to intersect on to be considered connected.

edges = nerve({"a": [1,2,3], "b": [2,3,4], "c": [4,5,6]}, min_intersection=2)
-> ["a", "b"] in edges and ["b", "c"] not in edges

n-simplices

It would be nice to have a general n-simplex nerve that constructs simplices of order n or less.

Before building this, is there an established format for simplexes? Are there any libraries that we could use? Most promising simplicial complex libraries found in the wild:

I'd prefer not to reinvent the wheel but I think a strong python simplicial complex library could be useful to the community.

michiexile commented 6 years ago

The non-existence of n-simplices was what got me in motion contributing in the first place -- if you want to do anything homology, or anything that waves the nerve lemma around, it's a bit of a glaring omission.

For storing simplices, there are choices to be had:

I haven't looked at pycomplex or simplicial; don't know what to think about them.

If we do do this, it's worth taking a look at Afra Zomorodian's Fast Construction of Vietoris-Rips Complexes -- that method + extra checks on populated intersections might be a good way to generate n-simplices from a cover.

michiexile commented 6 years ago

(wooow. I wrote this out 5 days ago, and never posted it… #oops)

sauln commented 6 years ago

My dream would be to cut SimplexTree out of Gudhi and stick it on pypi. It would be great to have a simplicial complex only library that could interface with any of the PH libraries.

In the mean time, let's not add a dependency until it's clear we need it.

sauln commented 6 years ago

I don't anticipate us developing n-simplex support in the near future. I'm closing this issue.

If support for n-simplices is required at some time, we can create a new issue.