> - First one:
> giant.component <- function(graph, ...) {
>   cl <- clusters(graph, ...)
>   subgraph(graph, which(cl$membership == which.max(cl$csize)-1)-1)
> }
You don't have to subtract 1 from the result of which and which.max since 
igraph 0.6 if I remember correctly.

> Anyway, I decided that problem of the first function may be related to 
> obsolete igraph (1/0 indexing) version and then deleted both minus 1s that 
> gives the same result with the second one. But now I'm not sure whether that 
> makes sense, I mean which one of the above methods are more reliable to find 
> giant component (or is there a better way)?
Both are equivalent and correct if you omit the -1 from the first version. 
However, the first version is faster because it does not extract the remaining 
components for you while decompose.graph does that.

-- 
Tamas


_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to