[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] Problem with igraph_simplify() for C
From: |
Quax, Rick |
Subject: |
[igraph] Problem with igraph_simplify() for C |
Date: |
Tue, 15 Feb 2011 15:29:52 +0100 |
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] Problem with igraph_simplify() for C,
Quax, Rick <=
Re: [igraph] Problem with igraph_simplify() for C, Tamás Nepusz, 2011/02/15