igraph-help
[Top][All Lists]
Advanced

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

[igraph] Problem with cut_at to specify number of communities for leadin


From: Qiwen Zheng
Subject: [igraph] Problem with cut_at to specify number of communities for leading eigenvector method
Date: Tue, 25 Jul 2017 22:44:29 -0400

Hi all,

I used cluster_leading_eigen() to generate a community object, and then used cut_at() in order to find the cluster assignment under specified number of communities. 

The cut_at() worked quite well when I use other algorithms like walktrap and edgebetweenness in igraph. But for leading eigenvector method when I use cut_at, and specify the number of community to be 10 (which is larger than the optimal number of clusters the cluster_leading_eigen function provides), it gives me a warning that 

"In cut_at(tempLE, no = 10) : Cannot have that few communities".

Below please see my codes: Y is an adajacency matrix.

  

  diag(Y)=0

  n=dim(Y)[1]

  g1=graph.adjacency(Y)

  g2=as.undirected(g1)

     tempLE=cluster_leading_eigen(g2)
  cut_at(tempLE,no=10)

In my initial investigation, I found that the number of rows the merges(tempLE) provides is only 3, while for walktrap or edgebetweenness method, merges() yields an n by 2 matrix.  I think the reason I have that warning is because merges(tempLE) has too few rows, but I don't know why?

Since leading eigenvector is a hiearchical method, the cut_at function should work for it. Anyone has any thoughts on it?

Thanks,
Qiwen

reply via email to

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