igraph-help
[Top][All Lists]
Advanced

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

[igraph] : compare membership


From: patricia
Subject: [igraph] : compare membership
Date: Tue, 9 Dec 2014 07:37:03 +0300

follows function : 

EdgesBetweenClusters <- function(graph, numTrials, numberVertices)
{
  require(igraph);
  communities <- infomap.community(graph, v.weights = NULL, modularity = TRUE, nb.trials = numTrials); 
  
  for(i in 1:numberVertices-1)
  {
    for(j in i+1:numberVertices)
    {
      if(membership(communities)[i] == membership(communities)[j])
      {
        edgesintracluster <- edgesintracluster + 1;
      } 
      else
      {
        edgesintercluster <- edgesintercluster + 1;
      }
    }
  } 
  return(edgesintercluster);

=> attached the following file in xml format

Attachment: Iris.xml
Description: application/xml


reply via email to

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