14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
def max_distance(node, ancestors, distances, root_descendants):
18
18
"""Calculate the max distance to an ancestor.
19
19
Return None if not all possible ancestors have known distances"""
23
23
for ancestor in ancestors[node]:
24
27
# An ancestor which is not listed in ancestors will never be in
25
28
# distances, so we pretend it never existed.
26
29
if ancestor not in ancestors: