igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Generate Cluster graph in C


From: Tamas Nepusz
Subject: Re: [igraph] Generate Cluster graph in C
Date: Fri, 13 Nov 2009 16:50:56 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

> To create a cluster graph, i have done as follow:
> 
>     igraph_t topology;
>     igraph_bool_t network_connected = 0;
>     while (network_connected == 0) {
>        igraph_grg_game(&topology, 100, 0.2, 0, NULL, NULL);
>        igraph_is_connected(&topology, &network_connected, IGRAPH_STRONG);
>    }
This loops keeps on generating a graph until the generated graph is
fully connected, i.e. if it contains only a single cluster. Therefore,
when you get out of this loop, the resulting graph will always contain
just one cluster. It's no surprise that you get this cluster back later.
(By the way, when the graph generated in the loop is not connected and
you generate another one, you should destroy the previous one with
igraph_destroy(&topology), otherwise you will be leaking memory).

-- 
Tamas




reply via email to

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