Skip to content

Tag: networkx

Visually see edges and node color in networkx graph

I am creating a graph that will represent a Fat Tree (https://www.researchgate.net/figure/Fat-Tree-structure-with-n-4-It-has-three-levels-of-switches_fig1_220429211). Currently, when I visually see the network I code up, the nodes are close together but I do not see a visible edge between them. How do I make …

How to add a feature to all the nodes in networkx

How to assign a number between 0-1 determining the sate of each of the neighbours. (That is in principle, each node has a number(state) associated to it! So that when I call a node; it has the information of its neighbours and their corresponding states! something like a Multi-dimmensional array in C! So that…

Highlighting the neighborhood of a node on selection

I created a graph using networkx and I am trying to plot it using bokeh. Currently, I am able to highlight the node that I clicked on, as well as the edges linked to the selected node. To reproduce the example, see the following code inspired from the official bokeh tutorial: I would like to be able to highli…

igraph: get dict with nodes and corresponding attribute

I have a large igraph network and want to get some attributes of the vertices in the network. I have created a directed graph and want to run some algorithms: When I print the list it just gives me list of the authority scores of the vertices. However I would like to know which node exactly has each value. Is

Put nodes names to a graph with Networkx python

I created a graph G (network library) through the adjacency matrix A (numpy matrix) that stores the weights of the links. I also have the list of the names of the nodes but I don’t know how to assign the name to each node. How can I do? Answer You can loop over the nodes and append the label from

How to only get the shortest path with networkx (shortest_path)

first of all I am really new to python in genereal and espcially to networkx. I got a question regarding the networkx shortest_path(G,source,target) function. For a series of found positions (let´s call them x), I would like to find the shortest path to another series of found positions (let´s call them y). I…