Questions tagged [igraph]

igraph is a free software package for creating and manipulating large undirected and directed graphs. It is written in C, but has interfaces to higher-level languages like R, Python or Mathematica.

igraph includes implementations for classic graph theory problems like minimum spanning trees and network flow, and also implements algorithms for some recent network analysis methods (e.g., community structure search).

igraph is a collection of network analysis tools with the emphasis on efficiency, portability and ease of use. igraph is open source and free. igraph can be programmed in R, Python, Mathematica and C/C++.

Repositories

Related links

3934 questions
10
votes
1 answer

Using igraph, how to force curvature when arrows point in opposite directions

autocurve.edges does an amazing job of curving edges in igraph plots so that they don't overlap when they point in the same direction. However, when they point in opposite directions, no curvature is applied. d <-…
Etienne Low-Décarie
  • 13,063
  • 17
  • 65
  • 87
9
votes
3 answers

Join two coordinates of a matrix with minimum distance

I am working on a process of completion (I am not sure of the correct term) of a matrix based on two coordinates considering the minimum distance, let me explain. I have a matrix of nxm (rows and columns), of NA values and 1 see figure 1: The goal…
rral
  • 554
  • 3
  • 20
9
votes
1 answer

r igraph find all cycles

I have directed igraph and want to fetch all the cycles. girth function works but only returns the smallest cycle. Is there a way in R to fetch all the cycles in a graph of length greater then 3 (no vertex pointing to itself and loops)
Ankit
  • 6,388
  • 8
  • 54
  • 79
9
votes
1 answer

tidygraph and igraph - build graph from dataframe discrepancy

I can build a graph object in igraph from two dataframes without problems. When I try do the same in tidygraph I get errors. Let me demonstrate. First I load my source data (data from a message…
aterhorst
  • 625
  • 4
  • 14
9
votes
2 answers

How can I add a data frame as vertex attributes with matching ids in igraph?

In R, I have a weighted undirected graph as an igraph object : IGRAPH e7a8fac UNW- 306 2829 -- + attr: name (v/c), label (v/c), nom (v/c), sigle (v/c), statut (v/c), champ (v/c), cp (v/c), info (v/c), weight (e/n) + edges from e7a8fac (vertex…
mhr
  • 147
  • 1
  • 10
9
votes
2 answers

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

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…
cip
  • 93
  • 1
  • 1
  • 3
9
votes
1 answer

Show edge attributes as label with igraph

I am using igraph in R for network analysis. I want to display an edge attribute on each line in the plot. An example is below df <- data.frame(a = c(0,1,2,3,4),b = c(3,4,5,6,7)) nod <- data.frame(node = c(0:7),wt = c(1:8)) pg <-…
user2997345
  • 121
  • 1
  • 2
9
votes
1 answer

Collapsing graph by clusters in igraph

I want to collapse a graph into its respective communities/clusters. Let me illustrate this with the following toy example: set.seed(123) #toy graph g <- barabasi.game(10) %>% as.undirected() #identify communities c_g <-…
Jacob H
  • 4,317
  • 2
  • 32
  • 39
9
votes
1 answer

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

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…
willemr
  • 93
  • 1
  • 4
9
votes
2 answers

Changing node/vertice opacity in iGraph in R

I have a network that, when I plot it, has a number of overlapping nodes. I want to change the opacity of the colors so that you can see nodes underneath others when they overlap. As an example, see this video: https://vimeo.com/52390053 I'm using…
Net20
  • 105
  • 1
  • 5
9
votes
1 answer

Error in python-igraph 'module' object has no attribute 'Graph'

I have installed igraph on Pycharm for Windows. import igraph yields no errors. import igraph print igraph.__version__ yields: 0.1.5. import igraph dir(igraph) yields nothing... import igraph g = igraph.Graph(1) yields: Traceback (most recent…
Margaret McDaniel
  • 105
  • 1
  • 1
  • 4
9
votes
4 answers

Efficiently generating random graphs with a user-specified global clustering coefficient

I'm working on simulations of large-scale neuronal networks, for which I need to generate random graphs that represent the network topology. I'd like to be able to specify the following properties of these graphs: Number of nodes, N…
ali_m
  • 71,714
  • 23
  • 223
  • 298
9
votes
3 answers

Path between two nodes

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,…
user285070
  • 761
  • 2
  • 12
  • 21
9
votes
3 answers

Plotting communities with python igraph

I have a graph g in python-igraph. I can get a VertexCluster community structure with the following: community = g.community_multilevel() community.membership gives me a list of the group membership of all the vertices in the graph. My question is…
jayelm
  • 7,236
  • 5
  • 43
  • 61
9
votes
1 answer

Differences in centrality measures between igraph and tnet

I'm trying to obtain centrality measures for a directed, weighted network. I've been using the igraph and tnet packages in R. However, I've discovered some differences in the results obtained using these two packages, and I'm a little confused…