[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Extracting sub-graph
From: |
Håvard Wahl Kongsgård |
Subject: |
Re: [igraph] Extracting sub-graph |
Date: |
Wed, 12 Oct 2011 15:27:18 +0200 |
Thanks,
I found that
i.decompose(mode=1) works (assuming that, 1 = weak and 2 = strong)
but not
aa = i.decompose(mode=WEAK)
OR
aa = i.decompose(mode="weak")
-håvard
On Wed, Oct 12, 2011 at 3:09 PM, Tamás Nepusz <address@hidden> wrote:
>> 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-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
Re: [igraph] Extracting sub-graph, Tamás Nepusz, 2011/10/12