[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] subtraction?
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] subtraction? |
Date: |
Thu, 21 May 2009 11:40:08 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
Hi Marco,
It depends on how that subgraph is specified. If you know the assignment
between vertices of g and h (i.e., you know that, say, vertex X in h
belongs to vertex Y in g for all X), you can simply use igraph_subgraph()
in C or Graph.subgraph() in Python (sorry, I don't know it by heart for R,
but I guess it's simply subgraph()), or you can also use
igraph_delete_vertices() or Graph.delete_vertices() on g if you don't
need g afterwards.
If you don't know the mapping from vertices of h to vertices of g, but
you know that h is a subgraph of g and it is unique, you can use
igraph_get_subisomorphisms_vf2 (or Graph.get_subisomorphisms_vf2) to
find the mapping from vertices of h to vertices of g.
--
Tamas
On Thu, May 21, 2009 at 11:44:19AM +0200, Marco wrote:
> Hi all list!
>
> Let's suppose I have a graph g, and a subgraph of g, let's call it h.
> I'd like to build the graph that is defined of all the vertices in g
> that are not in h.
> Edges are kept the same as in g if both the endvertices survive, or
> are deleted if at least one of the endvertices is killed.
>
> How do it efficiently in igraph?
>
> thanks in advance as always,
>
> marco
>
> --
> restituiremo il riso ai salici
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
pgp0DAdiv88zg.pgp
Description: PGP signature