igraph

How to write a dataframe, graph to pajek format?

橙三吉。 提交于 2019-12-25 05:32:05
问题 I Would like to save a igraph graph or a dataframe to pajek format. So I have used the igraph package to create graph object and then used this write.graph(graph_activitynetwork,"layer_share","pajek") to write the igraph graph in pajek .but what I am wondering is to create it in customized format :like this : *Vertices 4 1 "Node 1" 2 "Node 2" 3 "Node 3" 4 "Node 4" *Multiplex # layer node layer node [weight] 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 now I could just have this format : *Vertices 4 1 "1" 2

How to write a dataframe, graph to pajek format?

十年热恋 提交于 2019-12-25 05:32:02
问题 I Would like to save a igraph graph or a dataframe to pajek format. So I have used the igraph package to create graph object and then used this write.graph(graph_activitynetwork,"layer_share","pajek") to write the igraph graph in pajek .but what I am wondering is to create it in customized format :like this : *Vertices 4 1 "Node 1" 2 "Node 2" 3 "Node 3" 4 "Node 4" *Multiplex # layer node layer node [weight] 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 now I could just have this format : *Vertices 4 1 "1" 2

installing python igraph anaconda on mac

删除回忆录丶 提交于 2019-12-25 05:25:36
问题 I decided to uninstall and reinstall igraph package for anaconda on my mac. I started running into some issues - I've looked at all the links and have tried the following... brew install pkg-config --> already installed brew install igraph --> installed and linked but since I'm using anaconda, I can't use the brew installed version of igraph (please correct me if this is not the case) when I run... pip install python-igraph I get the following output Collecting python-igraph Using cached

Using std::vector with Igraph

北战南征 提交于 2019-12-25 05:06:56
问题 I've been trying to find a really function that let me convert from std::vector of vector to igraph_vector_ptr_t and the opposite way. The reason is, there are different classes like a std::sort, std::unique and others, that let us manipulate vectors, this function do not exist in Igraph libraries. The next code only show the code to convert from std::vector to igraph_vector_ptr_t, the problem is that it doesn't work, please help me to help me to improve it. #include <igraph.h> #include

Ggraph node color to match edge color

一曲冷凌霜 提交于 2019-12-25 04:08:12
问题 Is it possible to get ggraph to plot node colors the same color as connected edge color? I've tried feeding ggraph the colors for edges and nodes manually without any luck. It seems as if this would be something rather trivial, but I can't find any direction on it. My question is somewhat similar to this question, but I would like to color my nodes the same as their out-degree edges. library(tidyverse) library(igraph) library(ggraph) g <- graph_from_data_frame(highschool) ggraph(g)+ geom_edge

How to get the details of triads in r/python?

巧了我就是萌 提交于 2019-12-25 03:20:49
问题 I am currently using igraph to get the traid census of a given directed graph using triad_census(g) . This returns the count of triads in each of the 16 classes. e.g., 16 3 0 10 1 0 0 0 0 0 0 0 0 0 0 0 However, I would like to know more details of the triads than these summary statistics. i.e. given that the network has 16 of 003 , what they are? given that the network has 3 012 , what they are? Example: The 3 traids of 012 are (john -> emi, jenne) , (cena -> ally, john) , (emi -> peter,

Python - Remove overlapping communities in iGraph plot

南楼画角 提交于 2019-12-25 02:16:41
问题 I've been using iGraph to determine staff community structures within the 2002 Enron corpus. I've extracted a subset of only 50 employees, and am plotting this subset using various community detection algorithms. The problem is that when I use the plot function, numerous nodes will overlap across different communities (communities being defined by colour of node, and colour bubbles). Example: I want to keep the colour bubbles, however dont want any to overlap. I've tried all the different

How to find membership of vertices using Graphframes or igraph or networx in pyspark

放肆的年华 提交于 2019-12-25 01:49:01
问题 my input dataframe is df valx valy 1: 600060 09283744 2: 600131 96733110 3: 600194 01700001 and I want to create the graph treating above two columns are edgelist and then my output should have list of all vertices of graph with its membership . I have tried Graphframes in pyspark and networx library too, but not getting desired results My output should look like below (its basically all valx and valy under V1 (as vertices) and their membership info under V2) V1 V2 600060 1 96733110 1

How to visualize a graph made with igraph in C?

落花浮王杯 提交于 2019-12-25 00:34:33
问题 I started to learn igraph in C and I was wondering how can I visualize a graph made with this library. I've seen that with igraph R one just use the plot function and the graph is plotted but if I use C, should I print the graph in a file and then use another program to visualize it or which is the usual way? Thanks! edit: This kind of graph. 回答1: To plot directed graphs try GraphViz (https://www.graphviz.org). Alternatively you could use a tool like Gephi (https://gephi.org) if you are

igraph & POSIXct

寵の児 提交于 2019-12-24 22:41:48
问题 I have the following data library(data.table); library(igraph) t <- data.table(a=seq(ISOdate(2019,1,1), ISOdate(2019,7,1), "months"), b=seq(ISOdate(2019,1,2), ISOdate(2019,7,2), "months")) g <- graph_from_edgelist(as.matrix(t[,c("a","b")])) and would like to apply subcomponent(g,ISOdate(2019,1,1),"out") but obtain the error that At structural_properties.c:1249 : subcomponent failed, Invalid vertex id Is anyone aware of a solution to this problem? Additional complication The problem is