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

3392 questions
85
votes
2 answers

What are the differences between community detection algorithms in igraph?

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…
Michael Bishop
  • 1,705
  • 4
  • 15
  • 22
49
votes
2 answers

Network chord diagram woes in R

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", …
Crops
  • 4,500
  • 3
  • 31
  • 58
45
votes
4 answers

How to plot just the legends in ggplot2?

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…
Buthetleon
  • 937
  • 3
  • 11
  • 20
33
votes
2 answers

Error with igraph library - deprecated library

I have changed my computer to a Linux Mint x64 OS and I have throubles with a python library, igraph library, when i try to execute and old program I made. DeprecationWarning: To avoid name collision with the igraph project, this visualization…
BugliL
  • 492
  • 1
  • 6
  • 16
29
votes
4 answers

How do I find the edges of a vertex using igraph and R?

Say I have this example graph, i want to find the edges connected to vertex 'a' d <- data.frame(p1=c('a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'd'), p2=c('b', 'c', 'd', 'c', 'd', 'e', 'd', 'e', 'e')) library(igraph) g <-…
tommy chheng
  • 8,680
  • 9
  • 53
  • 69
29
votes
3 answers

Which layout should I use to get non-overlapping edges in igraph?

I am trying to build graphs using tree-like data, where nodes typically split into >2 edges. I have tried various layouts, and I see that the layout.reingold.tilford parameter will generate tree-like graphs with non-bifurcating data. However the…
Marcus Shepheard
  • 335
  • 1
  • 3
  • 6
27
votes
2 answers

How to control the igraph plot layout with Fixed Positions?

I am trying to draw a network visualization to resemble a flow diagram. I'm fairly close with the following code, but I have a couple questions: Is this the best layout() algorithm, or can I manually assign a position for each node> How can I make…
david h
  • 349
  • 1
  • 3
  • 7
27
votes
4 answers

python + igraph "plotting not available"

I installed python-igraph 0.5.4 and igraph 0.5.4 (also tested 0.6) from source on a RHEL machine. All is fine except when I try to plot I get. "TypeError: plotting not available" There were no errors or warnings in the configure or install stages.…
Raphael
  • 716
  • 1
  • 7
  • 19
25
votes
1 answer

How to split an igraph into connected subgraphs?

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…
Richie Cotton
  • 107,354
  • 40
  • 225
  • 343
24
votes
3 answers

igraph Graph from numpy or pandas adjacency matrix

I have an adjacency matrix stored as a pandas.DataFrame: node_names = ['A', 'B', 'C'] a = pd.DataFrame([[1,2,3],[3,1,1],[4,0,2]], index=node_names, columns=node_names) a_numpy = a.as_matrix() I'd like to create an igraph.Graph from either the…
LondonRob
  • 53,478
  • 30
  • 110
  • 152
24
votes
3 answers

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

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…
Jonathan Hendler
  • 1,201
  • 1
  • 16
  • 22
22
votes
2 answers

How do I lengthen edges in an igraph network plot (layout=fruchterman.reingold)?

Trying to do a network plot in R. How do I lengthen edges in a network graph using IGraph? I actually want to use the fruchterman-reingold layout. Is there some way I can make that force-based algorithm "springier" so that my vertices are further…
Monica
  • 231
  • 1
  • 2
  • 3
17
votes
4 answers

igraph creating a weighted adjacency matrix

I'm trying to use the igraph package to draw a (sparse) weighted graph. I currently have an adjacency matrix, but cannot get the graph.adjacency function to recognise the edge weights. Consider the following random symmetric matrix: m <-…
Scott Ritchie
  • 9,228
  • 2
  • 24
  • 61
17
votes
2 answers

How to get vertex ids back from graph

Please consider the following library(igraph) id <- c("1","2","A","B") name <- c("02 653245","03 4542342","Peter","Mary") category <- c("digit","digit","char","char") from <- c("1","1","2","A","A","B") to <- c("2","A","A","B","1","2") nodes <-…
CptNemo
  • 5,805
  • 14
  • 46
  • 95
17
votes
2 answers

Where are the vertex names in an iGraph graph

My general problem is that I loose the vertex names / labels (not sure about the right word here) when generating a graph using iGraph. I have an edge list IC_edge_sub of a bipartite network, that looks like the following: new_individualID…
Henning Piezunka
  • 235
  • 1
  • 3
  • 9
1
2 3
99 100