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
19
votes
2 answers

Correctly color vertices in R igraph

I am using igraph to color vertices I have two CSV files answers and topology of the graph. Answers: (this tells that players K and N answered correctly) Player Q1_I1 1 k 1 2 l 0 3 n 1 4 m 0 Topology:…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
19
votes
3 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
  • 255
  • 1
  • 3
  • 9
18
votes
1 answer

Convert igraph object to a data frame in R

I'm working with the iGraph library and I need to run some statistical analysis on the network. I'm computing several variables using iGraph and then want to use those indicators as the dependent variable in a few regressions and the vertex…
biased_estimator
  • 723
  • 3
  • 7
  • 13
18
votes
3 answers

Getting vertex list from python-igraph

I have been scouring the docs trying to find a function that will return a list vertices from an iGraph graph but can't find one. Does anyone know how to do get a list of vertices from an iGraph graph?
user2327814
  • 523
  • 3
  • 8
  • 18
18
votes
1 answer

Change edge thickness in igraph plot R according to Edge Attributes

I want to change the edge width of my graph to correspond to the edge.betweenness score. net <- read.csv("D:/SNA/R/Net.csv") att <- read.csv("D:/SNA/R/Att.csv") g <- graph.data.frame(net, vertices=att, directed=TRUE) pdf("Network.pdf",…
P Mcquiy
  • 305
  • 1
  • 4
  • 10
18
votes
1 answer

A hack to allow arrows size in R igraph to match edge width

Though the manual states that this will be a future feature: arrow.size The size of the arrows. Currently this is a constant, so it is the same for every edge. If a vector is submitted then only the first element is used, ie. if this is taken…
Etienne Low-Décarie
  • 13,063
  • 17
  • 65
  • 87
17
votes
1 answer

igraph: Resolving tight overlapping nodes

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…
mindlessgreen
  • 11,059
  • 16
  • 68
  • 113
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
  • 10,293
  • 3
  • 28
  • 64
17
votes
2 answers

Subset igraph graph by label

I am trying to subset a igraph graph by an edge characteristics (like its label). In the reproducible example I have shamelessly stolen from another post with a little modification, I would like to be able to separate the Best Friend ties (BF) from…
Michael Davidson
  • 1,391
  • 1
  • 14
  • 31
16
votes
1 answer

Create a group index for values connected directly and indirectly

I would like to generate indices to group observations based on two columns. But I want groups to be made of observation that share, at least one observation in commons. In the data below, I want to check if values in 'G1' and 'G2' are connected…
Malta
  • 1,883
  • 3
  • 17
  • 30
16
votes
2 answers

R package that links to external C library

I have some c code that utilizes the igraph library. I would like to put an R wrapper around it and send it off to CRAN as an R package. igraph already has an R port on CRAN, so it would make sense for my R package 'foo' to depend on R's igraph. …
JCWong
  • 1,163
  • 1
  • 10
  • 29
15
votes
2 answers

Community detection in Networkx

I'm studying about detection communities in networks. I'm use igraph and Python For the optimal number of communities in terms of the modularity measure: from igraph import * karate = Nexus.get("karate") cl =…
Alan Valejo
  • 1,305
  • 3
  • 24
  • 44
15
votes
3 answers

R igraph convert parallel edges to weight attribute

I'm working with igraph for R. My graph is based on an edgelist which includes parallel edges (more than one edge with the same source and target). I would like to convert these parallel edges to an edge attribute weight. Is there an eay way to do…
supersambo
  • 811
  • 1
  • 9
  • 25
14
votes
2 answers

Fast method of getting all the descendants of a parent

With the parent-child relationships data frame as below: parent_id child_id 1 1 2 2 2 3 3 3 4 The goal is to achieve the following, i.e. expanded version of previous data frame where all the…
arg0naut91
  • 14,574
  • 2
  • 17
  • 38
14
votes
1 answer

How to solve AttributeError when importing igraph?

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",…
any1
  • 292
  • 3
  • 9