igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Graphs union


From: Gábor Csárdi
Subject: Re: [igraph] Graphs union
Date: Mon, 10 Oct 2011 13:32:31 -0400

On Mon, Oct 10, 2011 at 1:27 PM, Rossano Gaeta <address@hidden> wrote:
> Il 10/10/2011 19:10, Gábor Csárdi ha scritto:
>>
>> Dear Rossano,
>>
>> it seems to me that you simply need the igraph_disjoint_union function:
>> http://igraph.sourceforge.net/doc/html/igraph_disjoint_union.html
>>
>> Best,
>> Gabor
>
> According to my understanding, the igraph_disjoint_union function will
> output a graph where the set of vertices is relabeled before union so to
> have |V| = |V1|+|V2|. In my problem a node x belonging to both V1 and V2
> must appear only once in G but must maintain
> all edges it had in G1 and G2. It is a sort of superposition of two graphs
> where common vertices are fused to obtain only one node.

Oh, I see. So you would need something like igraph_union(), but with
keeping the multiple edges?

One solution would be to query the edge lists of both graphs, put them
in vectors, concatenate the vectors, and create
a new graph. This might be even faster than igraph_union(), because it
does not look for multiple edges.

G.

> Did I miss any details in the semantic of the igraph_disjoint_union
> function?
>
> Thank you for your prompt reply
> Rossano
>
> --
> Rossano Gaeta - Associate Professor
>
> Dipartimento di Informatica
> Universitŕ di Torino
>
>
>



-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

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