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

Bayesian networks 'catnet' package cnPlot returning null

I am working with Bayesian Networks for the first time and I am using Catnet package in R. The reason being my data is full of categorical variables and a lot of missing data too. I tried the simple example posted elsewhere in StackOverflow just to…
RforResearch
  • 401
  • 8
  • 16
1
vote
3 answers

Turning data.frame into adjacency matrix lists does not show values (in R)

I have a data.frame that has 4 columns (sender, receiver, year and value). I want to create a list which has for each year an adjacency matrix of the sender and the receiver containing the value. A MVE would be df = data.frame(sender =…
1
vote
2 answers

how to connect directional sub-graphs in R igraph

I have a directional weighted graph that is made of two or more disconnected sub-graphs (with some attributes, in addition to…
SVS
  • 17
  • 5
1
vote
1 answer

Error : declared object not Found in RStudio code

I am new to R, and I'm working on it for a college project, I try to color the nodes of a node network based on another list called "cores" using the function setColor, but when I try to run it, it results in the error "Error in setColor(i): object…
Ghoostfire
  • 21
  • 2
1
vote
1 answer

I can't add edges to my network graph made in the igraph in R

I am trying to make a network graph through the igraph, but only the nodes appear, the edges / links do not appear. My data comes from an adjacency matrix. And I don't know where the problem is. Does anyone know how I can add the edges? Here is my…
1
vote
1 answer

R igraph: calculate shortest path only for a subset of all pairs of vertices

I have a very large igraph object so that calculation of shortest paths takes a long time. I am only interested in the length of the shortest path between a very small set of pairs of vertices. Let's say the (undirected) graph consists of 10,000…
R.Hanovre
  • 47
  • 4
1
vote
1 answer

How to calculate betweenness of cities on the road network with igraph

My aim is to calculate the betweenness centrality of cities on a road network with igraph. Firstly I use points2network function from shp2graph package to put the city nodes on the road network. Then I use nel2igraph function to convert the network…
Freeego
  • 135
  • 6
1
vote
2 answers

How to create edge weight reflecting values in adjacency matrix in R?

Suppose we have an adjacency matrix, maybe something like this: A1 A2 A3 A1 0 1 0 A2 1 0 2 A3 0 2 0 Each number reflects the number of ties between people (people being A1-A3). How would you use igraph to create edge weights which reflect…
1
vote
1 answer

R Plotting of a non-overlapping minimum spanning tree

I have created a minimum spanning tree in which communities have been found using the Louvain method. I would now like to display the tree clearly, i.e., it would be great to have an overlap-free representation. On the left is my current plot and on…
carl
  • 305
  • 2
  • 13
1
vote
1 answer

creating an object from edgelist in igraph

I am new to igraph. I use it with R (which I am new to as well). I want to use the CINNA R package later on, but am struggling to load my network into igraph/create an igraph object out of my file. What I have tried so far: ```read.graph("file",…
Caty
  • 11
  • 1
1
vote
2 answers

Set the direction of network circle graph to clockwise

I have the graph below in which I always display node a on top. What I would like to change is to change the direction of the circle network to be always right (clockwise) with igraph. Here is an example based on Set the position of certain node…
firmo23
  • 7,490
  • 2
  • 38
  • 114
1
vote
1 answer

Distance between two vertices in igraph

I have a big (half a million edges) weighted graph (not directional) and I want to find the distance between two nodes u and v. I could use my_graph.shortest_paths(u, v, weights='length') to get the distance. However, this is really slow. I can also…
McToel
  • 131
  • 1
  • 6
1
vote
0 answers

Count unique triangles in a network

Using iGraph I can count the number of triangles a given vertex is part of, but I can't find a way to simply count the number of unique triangles within a network. For instance, we create a network that forms two distinct triangles: A-B-D,…
Obed
  • 403
  • 3
  • 12
1
vote
2 answers

Going from a 2mode edgelist (.csv) to colored edges on a third attribute

I am working on a network graph using a .csv database containing companies and projects. I can make network graphs showing how all these companies are connected through their projects (one company works on several projects). My .csv database looks…
T. Zuidema
  • 11
  • 1
1
vote
1 answer

How to connect components of a graph in igraph

I have a dataset containing the edge list of a weighted undirected graph. My dataset contains multiple components. Now, I am trying to connect the components of the graph. My graph contains 4 components. Actually, I want to connect them any edge of…
0Knowledge
  • 747
  • 3
  • 14