Dear Simone,
I think the difference lies between how igraph and sna handles
multiple edges. Both of your networks have multiple edges. sna
collapses multiple edges into one single edge and then takes the
symmetric difference of the two edge sets -- at least that is what I
assume, since I obtained the same result in Python after doing these
operations manually on your networks (hdist = 611). Strictly
speaking, this method is incorrect if there are multiple edges and
they have to be taken into account. In this sense, the approach
described by Gabor is better: get the adjacency matrices, take the
difference of the two matrices, take the absolute value of every
element in the difference matrix and then sum the elements. This
results in a Hamming distance of 664. sna simply does not count the
cases where there are two edges from A to B in one of the networks
and only one in the other.
--
T.
On 2008.04.19., at 0:36, Simone Gabbriellini wrote:
Gabor,
I see the small graphs solution is good for me, it works easy but,
compared to hdist in sna package, I have a different results. And
even your two solutions bring to different outcomes on the same two
networks... it's all about ten/twenty edges more or less:
small graphs: 657
hdist (sna): 611
large graphs: 664
I have attached the file for testing, if you have the time.
regards,
Simone
<simulated-1.net><empirico.net>
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help