I worked on some graphs problems using persistence diagram as a feature. If the graph has self-loops, we will have simplices like [1,1] and [2,2]. This will cause some runtime error when calling d.homology_persistence(f). A small example is given. Running it on Linux throws RuntimeError: Trying to access non-existent cell: <313215472>. This is not very informative and takes me quite a while to figure out where the bug is.
If [1,1] and [2,2] are commented out, I can run the code without a problem.
def dionysus_test():
import dionysus as d
simplices = [([0, 6], 0.0035655512881059928),
([0, 5], 0.004388370816130452),
([0, 4], 0.024136039488717488),
([0, 3], 0.035381239705051776),
([3, 5], 0.035381239705051776),
([0, 1], 0.9824465164612051),
([1, 1], 0.9824465164612051),
([1, 3], 0.9824465164612051),
([1, 4], 0.9824465164612051),
([1, 5], 0.9824465164612051),
([1, 6], 0.9824465164612051),
([0, 2], 0.9999999997257268),
([1, 2], 0.9999999997257268),
([2, 2], 0.9999999997257268),
([2, 3], 0.9999999997257268),
([2, 4], 0.9999999997257268),
([2, 5], 0.9999999997257268),
([2, 6], 0.9999999997257268),
([0], 0.0016456390560489196),
([6], 0.0035655512881059928),
([5], 0.004388370816130452),
([4], 0.024136039488717488),
([3], 0.035381239705051776),
([1], 0.9824465164612051),
([2], 0.9999999997257268)]
f = d.Filtration()
for vertices, time in simplices:
f.append(d.Simplex(vertices, time))
f.sort()
m = d.homology_persistence(f)
for i, c in enumerate(m):
print(i, c)
dionysus_test()
I worked on some graphs problems using persistence diagram as a feature. If the graph has self-loops, we will have simplices like [1,1] and [2,2]. This will cause some runtime error when calling d.homology_persistence(f). A small example is given. Running it on Linux throws RuntimeError: Trying to access non-existent cell: <313215472>. This is not very informative and takes me quite a while to figure out where the bug is.
If [1,1] and [2,2] are commented out, I can run the code without a problem.