igraph

How to find measures after community detection in igraph (R)?

烈酒焚心 提交于 2019-12-18 11:42:56
问题 I am working with Community Detection in graphs. I have been through the different community detection algorithms implemented in igraph and plotting the community structures. Now after getting the communities object for different algorithms, I want to compare the algorithms based on different measures like density,cut ratio, coverage. (I know that modularity is already implemented). I can obtain a subgraph and then calculate the intra-cluster density but to find the inter-cluster density, I

How to solve AttributeError when importing igraph?

ⅰ亾dé卋堺 提交于 2019-12-18 04:35:26
问题 When I import the igraph package in my project, I get an AttributeError. This only happens in the project directory: [12:34][~]$ python2 Python 2.7.1 (r271:86832, Apr 15 2011, 12:09:10) [GCC 4.5.2 20110127 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import igraph >>> [12:34][~]$ cd projectdir/ [12:34][projectdir]$ python2 Python 2.7.1 (r271:86832, Apr 15 2011, 12:09:10) [GCC 4.5.2 20110127 (prerelease)] on linux2 Type "help", "copyright",

Using geo-coordinates as vertex coordinates in the igraph r-package

牧云@^-^@ 提交于 2019-12-18 01:19:46
问题 In the igraph package for R, I am struggling to plot a social network using latitude/longitude coordinates as the layout of the graph. Imagine this simple example: a network with 4 nodes of which you know the geographical location and the connections: df<-data.frame("from" = c("Bob", "Klaus", "Edith", "Liu"), "to"= c("Edith", "Edith", "Bob", "Klaus")) Here you have the meta-data for the nodes, so that Bob lives in NY, Klaus in Berlin, Edith in Paris and Liu in Bejing: meta <- data.frame("name

igraph: Resolving tight overlapping nodes

前提是你 提交于 2019-12-17 22:52:44
问题 I have a graph with few hundred nodes and edges. The disconnected subgraphs separate out and resolve well but the nodes within subgraphs overlap and do not resolve well. I have tried several layout algorithms and have also tried changing the relevant parameters within the layout algorithm (ex: iter, kkconst, start.temp etc). But, I am still not able to disperse the tightly clustered nodes. See figure below. I was hoping to find some parameter to control attraction/repulsion/gravity etc but

Best practices for Querying graphs by edge and node attributes in NetworkX

断了今生、忘了曾经 提交于 2019-12-17 15:25:51
问题 Using NetworkX, and new to the library, for a social network analysis query. By Query, I mean select/create subgraphs by attributes of both edges nodes where the edges create a path, and nodes contain attributes. The graph is using a MultiDiGraph of the form G2 = nx.MultiDiGraph() G2.add_node( "UserA", { "type" :"Cat" } ) G2.add_node( "UserB", { "type" :"Dog" } ) G2.add_node( "UserC", { "type" :"Mouse" } ) G2.add_node( "Likes", { "type" :"Feeling" } ) G2.add_node( "Hates", { "type" :"Feeling"

Network chord diagram woes in R

喜你入骨 提交于 2019-12-17 10:24:10
问题 I have some data similar to the data.frame d as follows. d <- structure(list(ID = c("KP1009", "GP3040", "KP1757", "GP2243", "KP682", "KP1789", "KP1933", "KP1662", "KP1718", "GP3339", "GP4007", "GP3398", "GP6720", "KP808", "KP1154", "KP748", "GP4263", "GP1132", "GP5881", "GP6291", "KP1004", "KP1998", "GP4123", "GP5930", "KP1070", "KP905", "KP579", "KP1100", "KP587", "GP913", "GP4864", "KP1513", "GP5979", "KP730", "KP1412", "KP615", "KP1315", "KP993", "GP1521", "KP1034", "KP651", "GP2876",

r igraph - how to add labels to vertices based on vertex id

◇◆丶佛笑我妖孽 提交于 2019-12-14 04:01:22
问题 I have an igraph where each vertex has both a vertex ID and a name. I want the vertices to still be identified by their vertex ID's, but to be labeled by their names. It seems like when adding labels to vertices through V(g)$label <- names, the names have to be in order. Is there a way to maybe put in a named vector or dataframe that names the vertices based on their IDs? names <- c('A','B','C,','D') from <- c(113,115,112,114,113) to <- c(112,112,115,113,114) structure <- data.frame("from" =

Python igraph import error on Windows

末鹿安然 提交于 2019-12-14 03:21:33
问题 I've installed igraph form .whl file using pip install. When I was trying to test the correctness of installation import igraph.test igraph.test.test() I got this error: Traceback (most recent call last): File "D:/Nauka/Praca-inzynierska/Barabasi-Albert.py", line 4, in <module> import igraph.test File "D:\Programy\Python 3.5\lib\site-packages\igraph\__init__.py", line 34, in <module> from igraph._igraph import * ImportError: No module named 'igraph._igraph' (the same error pops out if I'm

Build of py2cairo fails in Mac OS X with Homebrew

感情迁移 提交于 2019-12-14 03:13:00
问题 I've made the debatable decision to do some network analysis directly in Python instead of R. However, I'm having trouble getting all the igraph dependencies installed, ultimately failing with py2cairo. After updating Xcode to latest, installed cairo with Homebrew: brew install cairo A few warnings there for dependent libraries, and the brew link step failed. After chowning a few directories, I ran brew link again and it worked. Then, I uninstalled and re-installed python-igraph using pip .

Louvain community detection in R using igraph - assigns alternating group membership assignment

无人久伴 提交于 2019-12-14 02:16:11
问题 I have been running Louvain community detection in R using igraph, with thanks to this answer for my previous query. However, I found that the cluster_louvain method seemed to do something strange with assigning group membership, which I think was due to an error in how I imported my data. Whilst I think I resolved this I would like to understand what the problem was. I ran louvain clustering on a 400x400 correlation matrix (i.e. correlation scores for 400 individuals). When I initially