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

Creating graphs with different average degree, but same transitivity

I am looking to create a series of graphs with a fixed number of nodes (say n = 100), with varying average degree but with (almost) the same transitivity in the network. At the moment, the best I can come up with is require(igraph) g1 <-…
buzaku
  • 331
  • 1
  • 8
1
vote
1 answer

R igraph : graph_from_incidence_matrix() and graph_from_adjacency_matrix() don't work

My igraph library doesn't recognize "graph_from_incidence_matrix() and graph_from_adjacency_matrix()" anymore (Everything else from igraph works fine). I've uninstalled and reinstalled igraph but still no luck. Here is an…
mathlover
  • 71
  • 6
1
vote
1 answer

R create Random Networks according data frame

I have a data frame "ref.df" that has info about 12 networks. I want to create 100 random networks for each subject according their node and edge numbers. I've tried this code but it didn't work well: library(igraph) random.networks <-…
eabanoz
  • 251
  • 2
  • 16
1
vote
1 answer

Can't set colors of edges in igraph network

When I try to set the color of edges using the edge.color attribute, it doesn't work (I get default grey). However when I put the same attribute in the plot command, it works! What I am doing wrong? (I am using R version 3.4.1 (2017-06-30) --…
Adrian Tompkins
  • 4,261
  • 1
  • 23
  • 56
1
vote
2 answers

iGraph + Plotly creates random connections

I'm trying to use the example code here for doing iGraph network graphs in plotly and shoehorn in my own data.frames instead of using the example karate club data. When the graph is plotted, it seems to ignore the edge list and a bunch of random…
jamzsabb
  • 925
  • 1
  • 12
  • 33
1
vote
1 answer

How to write an if statement about data attributes in R

I have network data in igraph with multiple attributes, n=943. There is an attribute called Border that states whether or not a node represents a border crossing. The values are either Yes (x5) or NA (x938), class = NULL. The name of the graph…
1
vote
1 answer

Creating a cycle graph or adjacency matrix in R, with igraph?

I am currently trying to (ideally) use igraph to generate a cycle graph adjacency matrix. I would like each unit to be neighbors with k people. For k = 2, I am hoping to get: library(igraph) as_adj(make_graph(c(1, 2, 1, 10, 2, 3, 3, 4, 4, 5 ,5,6,…
user321627
  • 1,916
  • 1
  • 11
  • 31
1
vote
1 answer

select vertices based on name

I create a graph and add nodes using the following code. g = Graph() g.add_vertices(3) g.vs["name"] = ["ABC","ABCD","ACD"] I want to select vertices from the graph where the vertices name contain 'AB'. From the above graph, it should return "ABC"…
Agus Sanjaya
  • 683
  • 2
  • 7
  • 11
1
vote
2 answers

How do you add vertice / node information when starting from adjacency matrix?

This seems like a very simple thing, but I can't figure it out. I have created a adjacency matrix, specifying which nodes are connected to which node, this is a directed graph. A B C D A 0 1 0 1 B 0 0 0 0 C 1 0 0 0 D 1 0 1 0 I can read this…
Roel Hogervorst
  • 257
  • 4
  • 13
1
vote
1 answer

"Object 'direction' not found" with dendrogram in ggraph package

I try to plot a dendrogram with the ggraph package but, it's ok with geom_edge_diagonal() but not with geom_edge_elbow() Packages library(phyloseq) library(igraph) library(ggraph) Getting data The file ps.rds is available…
abichat
  • 1,636
  • 1
  • 15
  • 32
1
vote
1 answer

Sankey diagram for Discrete State Sequences in R using networkd3

I am trying to create an interactive Sankey diagram in R using the networkD3 package as described at http://christophergandrud.github.io/networkD3/#sankey. My data is in the format of Discrete State Sequences(DSS). 1 row represents 1 event sequence.…
Vipin
  • 25
  • 5
1
vote
1 answer

Fix y-coordinate when producing igraph layout

I am trying to produce a tree-like diagram using R package igraph. I start with an adjacency matrix Y that looks like this: Y <- matrix(c(1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1, …
1
vote
2 answers

merge edgelists to a single graph

I have three edgelists that have same nodes. I want to merge them into one graph and seperate these edges by colors and weights. I have provide small example of what I want to do: df1 a b 1 blue b c 0.361973313 blue a d 0.343729742…
minoo
  • 451
  • 4
  • 18
1
vote
0 answers

Limit maximum steps in igraph using all_simple_paths (R/CRAN)

I have been using igraphs all_simple_paths command to take an input, such as df: To From A B B C C D A F F E E D and turn it into an…
Taylor Maurer
  • 209
  • 3
  • 9
1
vote
0 answers

Having trouble displaying images at nodes using iGraph in R

I'm currently trying to plot images on my network graph in R. I'm relatively new to R, and am completely stuck trying to figure this out. Here's my syntax: # First, getting the appropriate…
1 2 3
99
100