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
13
votes
1 answer

Kou's algorithm to find Steiner Tree using igraph

I am trying to implement the Kou's algorithm to identify Steiner Tree(s) in R using igraph. The Kou's algorithm can be described like this: Find the complete distance graph G' (G' has V' = S (steiner nodes) , and for each pair of nodes (u,v) in…
user2380782
  • 1,542
  • 4
  • 22
  • 60
13
votes
2 answers

How to list all graph vertex attributes in R?

I am using the igraph package in R. I would like to associate some data with each vertex, e.g. by adding id and description attributes to each. The attributes are determined at runtime. I have a couple of related questions about how to set and get…
Racing Tadpole
  • 4,270
  • 6
  • 37
  • 56
13
votes
1 answer

How do I merge two nodes into a single node using igraph

I am trying to merge two nodes (call them 'V' and 'U') in a graph (G) into a single node (V). G is a hyperlink network of 779 nodes (websites). Each edge represents a hyperlink. V and U are actually the same website, but unfortunately the webpages…
timothyjgraham
  • 1,142
  • 1
  • 15
  • 28
13
votes
4 answers

How to make grouped layout in igraph?

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…
deeenes
  • 4,148
  • 5
  • 43
  • 59
13
votes
1 answer

Adjusting the node size in igraph using a matrix

I have the following network diagram: set.seed(1410) df<-data.frame( "site.x"=c(rep("a",4),rep("b",4),rep("c",4),rep("d",4)), "site.y"=c(rep(c("e","f","g","h"),4)), "bond.strength"=sample(1:100,16,…
Elizabeth
  • 6,391
  • 17
  • 62
  • 90
12
votes
4 answers

Algorithmic way to combine different contact number and emails for same contact

I have the following tibble, contact <- tribble( ~name, ~phone, ~email, 'John', 123, 'john_abc@gmail.com', 'John', 456, 'john_abc@gmail.com', 'John', 456, 'john_xyz@gmail.com', 'John', 789, 'john_pqr@gmail.com' ) I'd like to combine the…
msunij
  • 309
  • 2
  • 8
12
votes
2 answers

Python Library to create and visualize HyperGraph

Is there any libraries similar to igraph where I can create a hypergraph. I am working with hypergraph now and wanted to use some HyperGraph libraries to work on.
Ashik Vetrivelu
  • 1,021
  • 1
  • 9
  • 24
12
votes
1 answer

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

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…
Boris Gorelik
  • 29,945
  • 39
  • 128
  • 170
12
votes
1 answer

Get rid of vertex labels in graph plot in R

I am working on a small project that involves finding community structure of the graph and plotting. I am using label.propagation.community algorithm for community detection and following line of code for plotting: plot(community_1, graph_1) It is…
Sonu Mishra
  • 1,659
  • 4
  • 26
  • 45
12
votes
1 answer

changing the spacing between vertices in iGraph in R

Suppose I want to make a plot with the following data: pairs <- c(1, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 2, 11, 4, 14, 4, 15, 6, 13, 6, 19, 6, 28, 6, 36, 7, 16, 7, 23, 7, 26, 7, 33, 7, 39, 7, 43, 8, 35, 8, 40,…
Alex
  • 4,030
  • 8
  • 40
  • 62
12
votes
2 answers

R igraph rename vertices

Is there a possibility to rename the vertices in an igraph. I want to plot a certain graph multiple times with different notation on the vertices. Given the following igraph az: > az IGRAPH DN-- 24 23 -- + attr: name (v/c), label (v/c), color…
Richard A. Schäfer
  • 1,029
  • 1
  • 12
  • 18
11
votes
4 answers

Vertex border color/width in R graph plot

I am using igraph for plotting a graph in R doing something like plot(mygraph, vertex.color = "green"). Is there a way to change the color and/or width of the vertices' borders?
3lectrologos
  • 9,469
  • 4
  • 39
  • 46
11
votes
1 answer

R visNetwork + igraph weighted network visualization with visEdges

I have a very simple question regarding combining igraph with visNetwork. I want to weight the edges with visEdges(value=E(graph)$weight), but that does not work. Here is a toy example to illustrate the problem: test [,1] [,2] [,3] [,4]…
user436994
  • 601
  • 5
  • 15
11
votes
2 answers

Remove self loops and vertex with no edges

I am constructing a gene network. I have a two column data frame which i converted into and adjacency matrix and use it in igraph. The problem is i have genes that have self loops, I want to get rid of self loops and then get rid of the vertices…
Saad
  • 381
  • 2
  • 6
  • 12
11
votes
2 answers

Specified edge lengths on networkx/igraph (Python)

I wanted to visualize a network with the data I have and would like to graph them with specific edge lengths. I use Python, and I've tried networkx and igraph to plot but all seem to assign fixed edge lengths. a.) I wonder if I did the codes wrong…
user225288
  • 111
  • 1
  • 1
  • 3