From 581d26ef45ab6b8159545648affe6da54d5f5961 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 6 Mar 2020 02:35:57 +0100 Subject: [PATCH] added a comment to hyperbolic_celldistance --- expansion.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/expansion.cpp b/expansion.cpp index 9dc11d5b..6dc3a18c 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -851,7 +851,15 @@ int sibling_distance(cell *a, cell *b, int limit) { } } -EX int hyperbolic_celldistance(cell *c1, cell *c2) { +/** An algorithm for computing distance between two cells. + This algorithm runs correctly in O(d) assuming that: + - distances from the origin are known + - the set of cells in distance d from the origin forms a cycle + - the map is Gromov hyperbolic (with sibling_limit computed correctly) and planar + - all vertices have valence <= 4 + - each vertex has at most two parents + */ +EX int hyperbolic_celldistance(cell *c1, cell *c2) { int found_distance = INF; int d = 0, d1 = celldist0(c1), d2 = celldist0(c2), sl_used = 0;