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
1
vote
2 answers

Generate an undirected graph by probability on edges in R

Is there an R function for generating an undirected graph with probability on edges? I've tried to generate a nonparanormal data set by constructing the adjacency matrix (precision matrix) [see appendix]. First of all, I should generate a random…
1
vote
2 answers

Finding indirect nodes in social network analysis (in R, *using dplyr*)

I would like to solve the following problem using the dplyr in R. This question has been answered using data.table here: Finding indirect nodes for every edge (in R) but because the remainder of my code uses dplyr I need to adapt it. I have…
PaulaSpinola
  • 531
  • 2
  • 10
1
vote
1 answer

Using R igraph all_simple_paths from various origins and constructing Origin Destination Step by Step path

I have a network that is coneccted like the following: library(igraph) network <- graph_from_literal(1--2,2--3,3--4,4--5,3--6,6--7,3--8,8--9) and I want fo find the shortes path for each Origin-Destination pair: data=data.frame(Origin=c(1,8,9,2),…
Tanya Valkanova
  • 209
  • 2
  • 7
1
vote
1 answer

How to make the arrow lines shorter from right side of igraph in R?

I have made an igraph plot with shorter lines from the left side but now I want to make lines shorter from the right side. This is the data: dput(sample) structure(list(NMSUKU = c("Aceh/ Achin/ Akhir/ Asji/ A-Tse/ Ureung Aceh", "Alas", "Aneuk…
Kian
  • 149
  • 6
1
vote
3 answers

Report all possible combinations of a string-separated vector

In the tidyverse I would like to mutate/expand a string vector so that all possible combinations of elements (separated by " & ") are reported, one for each line. I tried decomposing my function using t(combn(unlist(strsplit(x, " & ")),2)), but…
MCS
  • 1,071
  • 9
  • 23
1
vote
1 answer

How to make the arrow lines shorter in igraph in R?

I have made an igraph plot. But, I want to make the arrow lines shorter now. This is the data: dput(sample) structure(list(NMSUKU = c("Aceh/ Achin/ Akhir/ Asji/ A-Tse/ Ureung Aceh", "Alas", "Aneuk Jamee", "Gayo", "Gayo Lut", "Gayo Luwes", "Gayo…
Kian
  • 149
  • 6
1
vote
1 answer

Automating a loop in igraph using tidygraph

Hello and hope all goes well. I made an edit to my previous question and hope it makes it more clear. I created an igraph object and would like to run same analysis several times and extract some information in each iteration. I can't share the…
Alex
  • 245
  • 1
  • 7
1
vote
1 answer

how to plot network graph by coloring the nodes

I have a data frame with two columns(edgelist)and I want to color the two columns in two different colors in the igraph plots. Like the capital letter node in blue and the small letter in dark read. My code is below. dat <- data.frame(col1 =…
adR
  • 305
  • 4
  • 14
1
vote
1 answer

Is possible to be empty the first variable values and make igraph in R?

I have a data frame that wants to make an igraph plot in R. But in the first column some rows do not have values. As you see rows 5-7 in NMSUKU do not have values. dput(sample) structure(list(NMSUKU = c("Betawi", "Cirebon", "Sunda", "Jawa", "", "",…
Kian
  • 149
  • 6
1
vote
1 answer

Laplacian matrix, solving a resistor mesh problem

I'm trying to solve for flows on a network using a laplacian matrix. I started out by testing on this problem here: https://rosettacode.org/wiki/Resistor_mesh#Python And it comes out with the solution perfectly, when all weights are 1, R =…
1
vote
1 answer

R find groups of tupples ignoring NAs

Based on an almost identical question, I am trying to create unique based on several columns where rows should grouped into the same ID if "there exists a path through any combination of the columns". The difference is that I have NAs that should…
safex
  • 2,398
  • 17
  • 40
1
vote
1 answer

How to split the graph comprised of several components and calculate its closeness with R?

I want to get the closeness of a graph, but sometimes the graph is comprised by several components which disconnected with each other. So the more appropriate method is to calculate the closeness by each component. components() can return the…
Chao He
  • 11
  • 2
1
vote
2 answers

delete_vertices igraph in R

I need to remove from the graph the group with the greatest number of nodes. I try to use the delete_vertices(name_of_graph, nodes_to_remove), but how can I indicate the nodes to remove? Ex. I have 5 groups with 6, 19, 27, 11, and 18 nodes. So I…
1
vote
0 answers

igraph Breadth-first search (bfs) callback function R

Is it possible to use the callback function to stop the search when the cumulative sum of assigned vertex weights achieved a threshold value? Thanks, Following the pseudo code: graph1 <- make_ring(10) weights <- c(1:10) func1 <- function(graph,…
Pedro
  • 23
  • 4
1
vote
1 answer

Graph Union in Python Igraph

I have 3 subgraphs and I want to obtain their union using the Python package Igraph (v. 0.9.1). I use Python v. 3.8.5. Let's assume a simple example of 3 directed graphs of 5, 4 and 8 vertices respectively. Each vertex has an attribute called "name"…