|
From: | Tamas Nepusz |
Subject: | Re: [igraph] subgraph from edge seq |
Date: | Mon, 10 Nov 2008 12:09:27 +0000 |
> 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)) -- Tamas
[Prev in Thread] | Current Thread | [Next in Thread] |