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

Create an adjacency matrix or list based on shared properties from a data-frame

I have a dataframe of repeated items (rows) that in a sense describes items that share some property with each other. I would like to express this relation as a graph. property node red A red B red C blue A blue D purple …
eastafri
  • 2,086
  • 2
  • 23
  • 31
1
vote
1 answer

Assign colour to chosen communities in a plot

In a plot, I need to colour two specific communities. Take the following data frame: A B C D E F G A 0 1 0 1 0 1 0 B 1 0 1 1 0 1 0 C 0 1 0 0 0 0 0 D 1 1 0 0 1 1 0 E 0 0 0 …
NBK
  • 765
  • 4
  • 18
1
vote
0 answers

tkplot on mac freezes

I am running igraph on RStudio (version 1.0.143) on a Mac (OS Version Sierra) R version 3.3.3 Another Canoe. tkplot does not show any windows and freezes when invoked.Only action possible is to force quit RStudio. Same code works fine on my…
user2345448
  • 149
  • 1
  • 10
1
vote
1 answer

Reading ".dot" files in R with attribute information

How can one read in a .dot file representing a graph into R and include attribute information? I can read in a .dot file using sna::read.dot. But this just returns an adjacency matrix without any of the attribute labels, as far as I can tell. Using…
Cliff AB
  • 1,029
  • 7
  • 14
1
vote
0 answers

Is it possible to do cohesion block in parallel with igraph?

I have a network of about 2k nodes and 4.8k edges which exhibits high small world attributes. I want to get its cohesion blocks with cohesive.blocks() in igraph, however, it has been running for days and still not output. There was a link similar…
baidao
  • 473
  • 3
  • 10
1
vote
1 answer

Using ego function from iGraph to generate a list of connected nodes to parse through a function

I'm having some trouble working with the iGraph package with R. Specifically when i'm trying to get all the nodes within 2 degrees of separation from a given node then use that list to run some operations on via a function. I'm not super confident…
DavimusPrime
  • 340
  • 2
  • 14
1
vote
2 answers

In igraph in R: how can I remove non-branch-point vertices, while maintaining connectivity?

I have a graph extracted from an image of several tree-like structures. The graph has a vertex for every articulation point, even if that point is not a branch or end (i.e. the node order is 2). I'd like to remove these order-2 vertices, but…
Alizaybak
  • 307
  • 3
  • 8
1
vote
1 answer

Transform directed graph into an undirected graph and adding the weights

I have a directed graph where agents move from node1 to node2 like the following node1 node2 flow A B 12 B A 6 C A 1 D B 3 E A 4 A E 10 E B 1 B E 2 I would like to change this directed graph into an undirected one, summing the flow between edges,…
Felipe Alvarenga
  • 2,140
  • 13
  • 31
1
vote
0 answers

Combine edgelist and nodelist (error with vertices) igraph

I have a question on combining two csv.files - one is a edgelist and the other a nodelist. I want to combine them (graph.data.frame) and it should be a directed graph. I am using r version 3.2.3/rstudio version 0.99.879 and igraph version 1.0.1. A…
Stefan_W
  • 163
  • 1
  • 9
1
vote
2 answers

Plotting a igraph network with DiagrammeR

I would like to create this simple igraph plot: library(igraph) mydata <- data.table(from=c("John", "John", "Jim"),to=c("John", "Jim", "Jack")) mygraph <- graph_from_data_frame(d=mydata, directed=T) plot(mygraph, vertex.label.dist=2) With…
skan
  • 6,456
  • 11
  • 47
  • 83
1
vote
1 answer

How plotting specific vertex labels (such as: c("a", "b", "c")) in Igraph?

Why when I tried such as: vertex.label= ifelse(V(graph)$name == c("vertex_name1", "vertex_name2", "vertex_name3"), V(graph)$name, NA) I've received the warning message: In V(a)$name == c("vertex_name1", "vertex_name2", "vertex_name3") : longer…
1
vote
1 answer

Calculating geographic distance of edge in iGraph

I have geographic coordinates for every vertex in an iGraph object. Now I want to calculate distance between existing edges. library(igraph) library(ggmap) library(geosphere) g <- graph.ring(6) V(grph)$postcode <- c("Johannesburg 2017", …
aterhorst
  • 397
  • 1
  • 12
1
vote
1 answer

Geocoding igraph vertex attributes using ggmap

I have a postcode for each vertex in an igraph object. I want to convert these into geographic coordinates using ggmap so I can calculate edge attribute = geographic distance. require(igraph) require(ggmap) g <- graph.ring(6) V(grph)$postcode <-…
aterhorst
  • 397
  • 1
  • 12
1
vote
1 answer

Color nodes based on condition in a graph

I have this dataset: df <- structure(list(name = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 2L), .Label = c("node1", "node10", "node2", "node3", "node4", "node5", "node6", "node7", "node8", "node9"), class = "factor"), value = c(100L,…
Sasak
  • 149
  • 2
  • 13
1
vote
1 answer

In R how to remove small community from igraph

in R network graph how to remove small community of twos (two nodes connected with one edge and no connection with other nodes, like jane and ike in this example: library(igraph) g <- graph_from_literal(Andre----Beverly:Diane:Fernando …
santoku
  • 2,759
  • 4
  • 32
  • 61
1 2 3
99
100