#### Re: Bottleneck distance is not symmetric

Mahdi Kooshkbaghi

I have tested this and I can not reproduce the results as well.
Got the same results as Dimitry.
d.__version__ : 2.0.4
python version: 3.6
Best,
Mahdi

From: dionysus@groups.io [dionysus@groups.io] on behalf of Dmitriy Morozov [dmitriy@...]
Sent: Wednesday, June 20, 2018 12:00 PM
To: dionysus@groups.io
Subject: Re: [dionysus] Bottleneck distance is not symmetric

I'm unfortunately unable to reproduce this. When I run this example, I get:

In Python 2:
>>> import dionysus as d
>>> dgm1 = d.Diagram([(8.04545,4.59091), (5.5,4.68182)])
>>> dgm2 = d.Diagram([(5.96,3.48), (5.24,4.04), (5.24,4.04), (4.44,3.48)])
>>> print d.bottleneck_distance(dgm1, dgm2)
1.73230612278
>>> print d.bottleneck_distance(dgm2, dgm1)
1.73230612278

In Python 3:
>>> import dionysus as d
>>> dgm1 = d.Diagram([(8.04545,4.59091), (5.5,4.68182)])
>>> dgm2 = d.Diagram([(5.96,3.48), (5.24,4.04), (5.24,4.04), (4.44,3.48)])
>>> print(d.bottleneck_distance(dgm1, dgm2))
1.7323061227798462
>>> print(d.bottleneck_distance(dgm2, dgm1))
1.7323061227798462

What does d.__version__ report? I.e., what version of Dionysus are you running?

The only other issue I can think of is that bottleneck_distance computes an approximation, its quality controlled by an extra parameter delta (by default 0.01), so in principle it's possible to get asymmetric answers, but I'm not sure if this is what's going on.

Dmitriy

On Wed, Jun 20, 2018 at 9:19 AM, wrote:
Hi Dimitry,

I found that the bottleneck distance is not symmetric, although the difference is not significant.

import dionysus as d
dgm1 = d.Diagram([(8.04545,4.59091), (5.5,4.68182)])
dgm2 = d.Diagram([(5.96,3.48), (5.24,4.04), (5.24,4.04), (4.44,3.48)])
print d.bottleneck_distance(dgm1, dgm2)
print d.bottleneck_distance(dgm2, dgm1)
1.74330592155
1.73230612278

Best wishes,
Chen

Join dionysus@groups.io to automatically receive all group messages.