[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Extracting sub-graph
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Extracting sub-graph |
Date: |
Wed, 12 Oct 2011 15:09:36 +0200 |
> decompose() seems to work for that purpose, but not on directed graphs.
>
> aa = i.decompose()
> igraph._igraph.InternalError: Error at components.c:463: only
> 'IGRAPH_WEAK' is implemented, Invalid value
> Note: unable to select mode='WEAK' with decompose(), is this a bug?
Well, sort of. The decompose() method (or more precisely, the underlying
igraph_decompose function) has only been implemented to extract the weakly
connected components. However, I made two mistakes:
1) I have inadvertedly set the default value of the mode=... argument to
STRONG, which works for undirected graphs (since this argument is simply
ignored) but not for directed ones.
2) I have forgot to handle cases when the mode argument is specified as string.
So, this will work:
from igraph import Graph, WEAK
[...]
aa = i.decompose(mode=WEAK)
but this will not:
aa = i.decompose(mode="weak")
I'll fix this in the development version.
--
T.
- [igraph] Extracting sub-graph, Håvard Wahl Kongsgård, 2011/10/12
- Re: [igraph] Extracting sub-graph, Håvard Wahl Kongsgård, 2011/10/12
- Re: [igraph] Extracting sub-graph,
Tamás Nepusz <=
- Re: [igraph] Extracting sub-graph, Håvard Wahl Kongsgård, 2011/10/12
- Re: [igraph] Extracting sub-graph, Tamás Nepusz, 2011/10/12
- Re: [igraph] Extracting sub-graph, Håvard Wahl Kongsgård, 2011/10/12
- Re: [igraph] Extracting sub-graph, Tamás Nepusz, 2011/10/12
- Re: [igraph] Extracting sub-graph, Håvard Wahl Kongsgård, 2011/10/12
Re: [igraph] Extracting sub-graph, Tamás Nepusz, 2011/10/12