Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make simplex insertion more natural #974

Open
DavidLapous opened this issue Sep 27, 2023 · 0 comments
Open

Make simplex insertion more natural #974

DavidLapous opened this issue Sep 27, 2023 · 0 comments

Comments

@DavidLapous
Copy link
Member

The default filtration value of the insert method being 0, and the non conservative nature of the insert method can create unnatural behavior. For instance, if one forgets to set a filtration value to a simplex to insert, the filtration of the other simplices will be erased :

import gudhi as gd
st = gd.SimplexTree()
st.insert([0], 1)
st.insert([1], 1)
st.insert([0,1])
list(st.get_simplices())
> [([0, 1], 0.0), ([0], 0.0), ([1], 0.0)]

As no filtration value is given, a more conservative option, would be to add [0,1] at the first moment when its possible, according to its faces. This would still preserve the filtration property of the simplextree.

Furthermore, I think that "adding a simplex at the first possible moment while preserving the filtration" can be an interesting behavior in practice; for instance if you want to define a filtration on a graph :

  • Assume that you have access to values on its node and other values on its edges.
  • Assume that these values do not form a filtration.

The current behavior preserve the filtration values of the edges, while this proposed behavior (see below) preserve the filtration values of the nodes. Both behaviors seem moral to me.
Another motivating example is when playing with multiparameter filtrations : how to deal with incomparable filtrations values ? In that usecase, I think that a non-conservative approach can be dangerous.

A proposition is the following :

  • Add a flag, e.g. insert_after, in the insert method, such that :
    • if true, the simplex σ to insert, with given filtration f , will be inserted at max ( max τ coface ( σ ) f τ , f )
    • If false, -> default behaviour
  • Set the default value of the flag to be f is not given (and set f = ).

What do you think about all of this ?

DavidLapous referenced this issue in DavidLapous/multipers Oct 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant