summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Bottleneck.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Bottleneck.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 0c9e5ea8..24a31ac1 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -46,12 +46,11 @@ double bottleneck_distance(const Persistence_diagram1 &diag1, const Persistence_
sd = g.sorted_distances();
long idmin = 0;
long idmax = e==0. ? sd.size() - 1 : g.diameter_bound()/e + 1;
- // alpha can change the complexity
- double alpha = std::pow(idmax, 0.25);
+ double alpha = std::pow(g.size(), 1./5.);
Graph_matching m(g);
Graph_matching biggest_unperfect(g);
while (idmin != idmax) {
- long step = static_cast<long>((idmax - idmin) / alpha);
+ long step = static_cast<long>((idmax - idmin - 1)/alpha);
m.set_r(e == 0. ? sd.at(idmin + step) : e*(idmin + step));
while (m.multi_augment());
//The above while compute a maximum matching (according to the r setted before)