igraph

Transform a dataframe for network analysis using pandas

Transform a dataframe for network analysis using pandas Question: I have a data frame of online game matches including two specific columns: IDs of matches and IDs of players participated in a particular match. For instance: match_id player_id 0 1 0 2 0 3 0 4 0 5 1 6 1 1 1 7 1 …

Total answers: 3

Compute share of resources used by node i w.r.t. neighbors on a large network

Compute share of resources used by node i w.r.t. neighbors on a large network Question: Purpose The main purpose is to be able to compute the share of resources used by node i in relation to its neighbors: r_i / sum_j^i{r_j} where r_i are node i resources and sum_j^i{r_j} is the sum of i’s neighbors’ …

Total answers: 1

Why this simple code is not showing plotted the graph?

Why this simple code is not showing plotted the graph? Question: I’m trying to follow a simple tutorial on how the igraph library works but the first piece of code didn’t show me a plotted graph as it should. I do have everything installed with pip. The code runs fine but doesn’t show me anything. …

Total answers: 1

Plotting “mark groups” with different colors

Plotting “mark groups” with different colors Question: I am very new to igraph, and have been plotting out a project of mine. In my python code I used the: igraph.VertexClustering.FromAttribute(graph, attribute) to identify the groups. The problem is the coloring of this VertexCluster. When using the VertexCluster as “mark_groups” for the visual style, the groups …

Total answers: 1

How to instantiate and extend Python igraph Vertex class

How to instantiate and extend Python igraph Vertex class Question: I’d like to extend the igraph Vertex class with some extra variables methods I need for a simulation study. However, when I try to import and extend the vertex class, I get an error. from igraph import Vertex v = Vertex() TypeError: cannot create ‘igraph.Vertex’ …

Total answers: 1

python-igraph: Multiple weight attributes for shortest_paths_dijkstra

python-igraph: Multiple weight attributes for shortest_paths_dijkstra Question: In my graph I have some edges with multiple weights. Is there any possibility to add multiple weights attributes for the shortest_paths_dijkstra in python-igraph?. My sample code is given below: import igraph from igraph import * g = Graph(directed=True) g.add_vertices(3) g.vs[“name”]=[“GO:1234567″,”GO:6789056″,”GO:5674321”] g.add_edge(‘GO:1234567′,’GO:6789056’, weight=4, weight1 = 3) g.add_edge(‘GO:6789056′,’GO:5674321’, weight=4, …

Total answers: 1

Error with igraph library – deprecated library

Error with igraph library – deprecated library Question: I have changed my computer to a Linux Mint x64 OS and I have throubles with a python library, igraph library, when i try to execute and old program I made. DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to …

Total answers: 2

Equivalent of R igraph graph_from_data_frame() function in Python igraph?

Equivalent of R igraph graph_from_data_frame() function in Python igraph? Question: Is there an equivalent of this igraph R function in Python igraph? graph_from_data_frame(d, directed = TRUE, vertices = NULL) This function creates an igraph graph from one or two data frames containing the (symbolic) edge list and edge/vertex attributes. Asked By: Antoine || Source Answers: …

Total answers: 2

Convert python-igraph graph to networkx

Convert python-igraph graph to networkx Question: Recently I’ve been working with python-igraph package and all my code is based on graphs I create using igraph. Right now, I need to calculate some measures for my graph which apparently are implemented in networkx and not in igraph such as (katz_centrality_numpy, edge_betweenness_centrality, …). I am wondering if …

Total answers: 5