Open DavidLapous opened 1 year ago
Thank you for this suggestion. The main goal of edge collapses is to avoid computing the complex you would use as input in your code. That is, we only want to build triangles, tetrahedra, etc after doing the edge collapse. I am afraid that if we did what you suggest, some users would get confused into doing expansion before edge collapse, defeating the purpose. There could be valid reasons to expand, then collapse and expand again, if only to see how many simplices you save with the collapses, but that looks like a rather niche use case, with an easy workaround (call expansion yourself afterwards), so for now I think I'd rather not do it. But I'll leave this issue open for a while, to see if other opinions are coming.
Note that we will probably add an extra interface to edge collapses in Python, working on coo_matrix or similar.
I am afraid that if we did what you suggest, some users would get confused into doing expansion before edge collapse, defeating the purpose.
That's a very good point. Do you think that adding a (python) warning in that case would be enough to prevent users to do that ?
That's a very good point. Do you think that adding a (python) warning in that case would be enough to prevent users to do that ?
In collapse_edges, adding something like if self.dimension() > 1: print("Warning: collapse_edges() ignores all the simplices of dimension 2 or more in this complex", file=sys.stderr)
? Yes, I think that would be ok.
As far as I'm aware, edge collapses are only useful for graphs and clique complexes. Wouldn't that make sense to re-expand by default the simplextree to its original dimension after collapsing ? That will ensure that clique complexes simplextrees preserves their homology. I'm thinking about something like this in the
simplextree.pyx
file