igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Problem with igraph_simplify() for C


From: Gábor Csárdi
Subject: Re: [igraph] Problem with igraph_simplify() for C
Date: Tue, 15 Feb 2011 16:56:52 +0100

Dear Rick,

your network is already simple, i.e. it does not have any loop or
multiple edges. So there is nothing to do for igraph_simplify().

Gabor

On Tue, Feb 15, 2011 at 3:29 PM, Quax, Rick <address@hidden> wrote:
>
> Dear all,
>
> I try to use the function igraph_simplify() in C to remove self-loops and
> double edges, but it leaves the network unchanged. It does not matter what I
> pass as boolean arguments to it (true/false/0/1). I use igraph 0.5.4 and g++
> 4.1.2. The following is the relevant piece of code:
>
> -------------------------------------------------------
>         igraph_t graph;
>         size_t dim = 1, L = 20;
>         double p = 0.15;
>
>         int ret = igraph_watts_strogatz_game(&graph, dim, L, nbh, p);
>
>         igraph_write_graph_edgelist(&graph, stdout);
>
>         ret = igraph_simplify(&graph, 1, 1);
>
>         cout << "-----------------------------------\n";
>
>         igraph_write_graph_edgelist(&graph, stdout);
> -------------------------------------------------------
>
> The output of this code is the following (i.e., unchanged):
>
> --------------------------------------------------------
> 0 1
> 1 2
> 2 3
> 3 4
> 3 19
> 4 5
> 5 6
> 6 7
> 7 8
> 8 9
> 9 10
> 10 11
> 11 12
> 12 13
> 13 14
> 14 15
> 15 16
> 16 17
> 17 18
> 18 19
> -----------------------------------
> 0 1
> 1 2
> 2 3
> 3 4
> 3 19
> 4 5
> 5 6
> 6 7
> 7 8
> 8 9
> 9 10
> 10 11
> 11 12
> 12 13
> 13 14
> 14 15
> 15 16
> 16 17
> 17 18
> 18 19
> --------------------------------------------------------
>
> Does anyone have a clue why this happens? In R it does work.
>
> Thank you very much in advance,
>
> Rick
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM



reply via email to

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