[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] how to "simplify" a graph
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] how to "simplify" a graph |
Date: |
Wed, 8 Aug 2012 10:19:14 -0400 |
On Mon, Aug 6, 2012 at 5:12 PM, Sam Steingold <address@hidden> wrote:
> (no, I am not asking about the simplify function)
> I have a directed graph with, say, 100 sources and 100,000 destinations,
> and only 5 sources which are also destinations.
> I am mostly interested in sources, but the destinations clutter
> everything.
> I want to "simplify" the graph by dropping all the destinations, but I
> want to add a "weighted" link between two sources which have common
> destinations.
> How do I do that?
I think what you might need is a bipartite projection. In a bipartite
(or two-mode) graph, you have two kind of vertices, e.g. sources and
destinations. When you create a one-mode projection, you create a
graph where two sources are connected if they have a common neighbor
among the destinations. (Or the other way.)
Check http://igraph.sourceforge.net/doc/R/bipartite.projection.html
The number of common neighbors of the two sources is automatically
added as an edge weight, if you set the multiplicity argument to TRUE
(the default).
G.
> thanks!
> --
> Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X
> 11.0.11103000
> http://www.childpsy.net/ http://www.memritv.org
> http://truepeace.org http://jihadwatch.org
> To be popular with ladies one has to be smart, handsome & rich. Or to be a
> cat.
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
--
Gabor Csardi <address@hidden> MTA KFKI RMKI