[Top][All Lists]

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

RE: [igraph] subgraph from edge seq

From: Sergio Jiménez
Subject: RE: [igraph] subgraph from edge seq
Date: Mon, 10 Nov 2008 13:25:17 +0100


-----Mensaje original-----
De: address@hidden
[mailto:address@hidden En nombre de
Tamas Nepusz
Enviado el: lunes, 10 de noviembre de 2008 13:09
Para: Help for igraph users
Asunto: Re: [igraph] subgraph from edge seq

> Hi, a simple question:
> Is it possible in igraph for Python to construct a subgraph fron an edge
> sequence of a graph? 
Not yet. The easiest way to achieve this is to collect the vertices
participating in the edge sequence and then call subgraph() on the
vertex set:

def adj(es):
     result = set()
     for e in es: result.add(*e.tuple)
     return list(result)

g2 = g.subgraph(adj(your_edge_sequence))


igraph-help mailing list
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.175 / Virus Database: 270.8.5/1757 - Release Date: 10/11/2008

reply via email to

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