igraph

How to plot just the legends in ggplot2?

隐身守侯 提交于 2019-11-27 00:57:23
I'm currently working with igraph and have colour labelled my vertices. I would like to add a legend Indicating what each colour represents. What I can think of at this point is to use ggplot2 to print only the legend and hide a bar plot. Is there a way to just output the legend? Here are 2 approaches: Set Up Plot library(ggplot2) library(grid) library(gridExtra) my_hist <- ggplot(diamonds, aes(clarity, fill = cut)) + geom_bar() Cowplot approach # Using the cowplot package legend <- cowplot::get_legend(my_hist) grid.newpage() grid.draw(legend) Home grown approach Shamelessly stolen from:

What are the differences between community detection algorithms in igraph?

三世轮回 提交于 2019-11-26 23:15:12
I have a list of about 100 igraph objects with a typical object having about 700 vertices and 3500 edges. I would like to identify groups of vertices within which ties are more likely. My plan is to then use a mixed model to predict how many within-group ties vertices have using vertex and group attributes. Some people may want to respond to other aspects of my project, which would be great, but the thing I'm most interested in is information about functions in igraph for grouping vertices. I've come across these community detection algorithms but I'm not sure of their advantages and

pycairo “ImportError: DLL load failed: The specified module could not be found.” even after DLLs installed

孤街浪徒 提交于 2019-11-26 17:03:34
问题 I'm following the pycairo installation instructions here : http://www.cs.rhul.ac.uk/home/tamas/development/igraph/tutorial/install.html to install pycairo for use with igraph. However, even after running the installer and unzipping/copying all DLL's into the site-packages cairo directory according to the instructions, I still get the following error: >>> import cairo Traceback (most recent call last): File "", line 1, in File "c:\Python26\lib\site-packages\cairo__init__.py", line 1, in from

All possible paths from one node to another in a directed tree (igraph)

≡放荡痞女 提交于 2019-11-26 16:21:35
问题 I use python binding to igraph to represent a directed tree. I would like to find all possible paths from one node in that graph to another one. Unfortunately, I couldn't find a ready to use function in igraph that performs this task? EDIT The concerns on infinite number of paths the graph I'm talking about is actually a directed acyclic graph (DAG) with a single root. It represents a unidirectional cascade of events that, on various levels of the cascade, can either split or join together.

How to split an igraph into connected subgraphs?

南笙酒味 提交于 2019-11-26 15:59:56
问题 I have an igraph with several disconnected components. For example: library(igraph) g <- simplify( graph.compose( graph.ring(10), graph.star(5, mode = "undirected") ) ) + edge("7", "8") In this example, node 9 is its own graph, as are nodes 7 and 8, and the rest form a third graph. I'd like to treat these separately, so I want to convert the single igraph into a list of 3 igraphs (split by connectedness). I hacked some code to achieve this, but it's inefficient and fairly awful. split_graph

How to create a bipartite network in R with igraph or tnet

旧时模样 提交于 2019-11-26 14:09:38
问题 I have an edgelist for a two mode network, similar to this: person Event Amy football_game Sam picnic Bob art_show I want to perform an analysis on this in R, but seemingly everything I try fails. Converting it to a one mode network runs into memory limitations, and I can't figure out how to analyze it as bipartite in either igraph or tnet. In igraph, bipartite.projection gives me all FALSE , on the igraph object created using net <- graph.edgelist(myobject) On tnet, I can't convert the

Path between two nodes

你。 提交于 2019-11-26 14:09:13
问题 I'm using networkx to work with graphs. I have pretty large graph (it's near 200 nodes in it) and I try to find all possible paths between two nodes. But, as I understand, networkx can find only shortest path. How can I get not just shortest path, but all possible paths? UPD: path can contain each node only once. UPD2: I need something like find_all_paths() function, described here: python.org/doc/essays/graphs.html But this function doesn't work well with large number of nodes and edged =(

How to make grouped layout in igraph?

柔情痞子 提交于 2019-11-26 13:52:36
问题 In igraph , after applying a modularization algorithm to find graph communites, i would like to draw a network layout which clearly makes visible the distinct communities and their connections. Something like "group attributes layout" in Cytoscape: i want to show the members of each group/community close to each other, and keep some distance between groups/communities. I couldn't find any function in igraph providing this feature out of the box. While posting this question i have already

How to plot just the legends in ggplot2?

≯℡__Kan透↙ 提交于 2019-11-26 09:27:17
问题 I\'m currently working with igraph and have colour labelled my vertices. I would like to add a legend Indicating what each colour represents. What I can think of at this point is to use ggplot2 to print only the legend and hide a bar plot. Is there a way to just output the legend? 回答1: Here are 2 approaches: Set Up Plot library(ggplot2) library(grid) library(gridExtra) my_hist <- ggplot(diamonds, aes(clarity, fill = cut)) + geom_bar() Cowplot approach # Using the cowplot package legend <-

What are the differences between community detection algorithms in igraph?

我与影子孤独终老i 提交于 2019-11-26 08:39:11
问题 I have a list of about 100 igraph objects with a typical object having about 700 vertices and 3500 edges. I would like to identify groups of vertices within which ties are more likely. My plan is to then use a mixed model to predict how many within-group ties vertices have using vertex and group attributes. Some people may want to respond to other aspects of my project, which would be great, but the thing I\'m most interested in is information about functions in igraph for grouping vertices.