igraph-help
[Top][All Lists]
Advanced

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

[igraph] problem about mincut


From: Jeffery
Subject: [igraph] problem about mincut
Date: Wed, 5 Nov 2014 23:20:03 +0800 (CST)

hello
Recently i am trying to use igraph_mincut to get the min edge cut value and parition the graph to two parts.
Although it can get the mincut value correctly, the vertex ids stored in  igraph_vector_t partition and partition2 
make no sense becase they are full of zero.
the function is defined as follow:

int igraph_mincut(const igraph_t *graph,
igraph_real_t *value,
igraph_vector_t *partition,
igraph_vector_t *partition2,
igraph_vector_t *cut,
const igraph_vector_t *capacity);

I'm sure I have initialized the parameters, such as partition,partition2 and cut .I debug the mincut function and i find that the lacal variable mincut_step is zero.
The adjacency list of my test case is follow:

0 : 1 2 
1 : 0 4 
2 : 0 5 
4 : 1 7 
5 : 2 8 
7 : 4 9 
8 : 5 10 10 
9 : 7 11 
10 : 8 8 11 12 13 
11 : 9 10 14 
12 : 10 14 15 
13 : 10 15 
14 : 11 12 15 
15 : 12 13 14 

the returned edgecut of igraph_mincut includes the edge 0-1 and 1-4, I accept. The first part after partition should only contain the vertex 1 while
the second part should include the other vertexs. However they are full of zero.
So have u faced a similar situation ? How do i resolve it?

p.s sometimes, the mincut of a graph is not unique and i want the function to do balanced partition, namely the vertex num of the first part is roughly 
equal to that of the second part. Could such function can be implemented in igraph_mincut?

Thanks a lot. 

                          Guopeng.




reply via email to

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