igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] how to compare two networks...


From: Gabor Csardi
Subject: Re: [igraph] how to compare two networks...
Date: Fri, 18 Apr 2008 18:39:46 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Simone, there is no function for it, but it is easy. 
For small graphs 

sum(get.adjacency(g1) != get.adjacency(g2))

will do. For undirected graphs divide it by 2 
(or zero out one half of the adjacency matrices).

For larger graphs calculate the intersection 
of the two graphs, this is reasonably fast, and then 
the Hamming distance is the number of edges in the 
symmetric difference. (If i'm right...)

int <- graph.intersection(g1,g2)
ecount(g1)+ecount(g2)-2*ecount(int)

G.

On Fri, Apr 18, 2008 at 06:25:40PM +0200, Simone Gabbriellini wrote:
> Dear Gabor,
> 
> is there a way in igraph to calculate Hamming distances? Sorry but I  
> can't find it on the docs... and with a RSiteSearch I've only found  
> sna routines, but I prefer to stick to igraph.
> 
> thanks,
> Simone
> 
> 
> Il giorno 11/apr/08, alle ore 17:56, Gabor Csardi ha scritto:
> 
> >Simone,
> >
> >in general it depends what you mean by "close".
> >Same structural properties? Which structural properties
> >in particular?
> >
> >Here are two classic graph theory methods.
> >
> >If vertices in the two networks stand for the same entities,
> >then you can take the Hamming distance of their adjacency matrices.
> >
> >If this is not the case, then you can ask for the minimum number of  
> >edge
> >removal/addition operations you need to get the second
> >network from the first. This is a quite difficult problem,
> >and there is no solution for it in igraph.
> >
> >Gabor
> >
> >On Fri, Apr 11, 2008 at 05:45:23PM +0200, Simone Gabbriellini wrote:
> >>Hello,
> >>
> >>is there a procedure in igraph that let's you compare two networks
> >>(with the same nodes but different links distribution) to see how  
> >>much
> >>they are close each other?
> >>
> >>thank you,
> >>Simone
> >>
> >>
> >>_______________________________________________
> >>igraph-help mailing list
> >>address@hidden
> >>http://lists.nongnu.org/mailman/listinfo/igraph-help
> >
> >-- 
> >Csardi Gabor <address@hidden>    UNIL DGM
> >
> >
> >_______________________________________________
> >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

-- 
Csardi Gabor <address@hidden>    UNIL DGM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]