Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
53 views

I have a number of graphs in NetworkX, obtained by microscopic images by NEFI https://nefi.mpi-inf.mpg.de/. Since they're from real images, the graphs nodes are always slightly displaced from one ...
alessandro's user avatar
  • 4,014
Advice
0 votes
1 replies
34 views

I came across one of OpenTrack's manuals. I couldn't find a more up to date version, this is the latest screenshot I could find. Is the description vertex-vertex-edge-vertex-vertex actually correct? ...
TomCoding's user avatar
  • 103
2 votes
1 answer
55 views

I've been trying hours to show the x axis label in my GraphRAG plot. The below is similar to my actual code but when I run this, the x axis label just doesn't appear? I am not sure if it's because the ...
Hugh L's user avatar
  • 23
0 votes
1 answer
97 views

When generating a diagram with networkx and pyplot, the diagram is squashed in the middle with lots of empty white space around it. import networkx as nx import matplotlib.pyplot as plt print(f"...
Baldrick's user avatar
  • 11.2k
3 votes
0 answers
121 views

In python, with networkx, I have a large list li = [o1, o2, ...] of objects of a class Myclass. The class has a partial ordering for objects defined through the method __lt__. This is a strict ...
Bulkilol's user avatar
  • 193
2 votes
1 answer
89 views

I'm working with a dataset where I want to assign a sub_graph ID to user interactions. Each row in the data represents a directed edge between an actor_user_id and a related_user_id. I want to compute ...
patrick's user avatar
  • 376
0 votes
1 answer
85 views

Is there a way to draw the graph "features" with networkx ? (-1, 0 and 1 in my example) With my Python code, currently it does not draw it. See code below: import torch from torch_geometric....
Mathieu Krisztian's user avatar
4 votes
3 answers
132 views

I have a pandas dataframe of the following structure: d = {'I': ['A', 'B', 'C', 'D'], 'X': [ 1, 0, 3, 1], 'Y': [0, 1, 2, 1], 'Z': [1, 0, 0, 0], 'W': [3, 2, 0, 0]} df = pd.DataFrame(data=d, columns=['I'...
carpediem's user avatar
  • 491
1 vote
1 answer
272 views

When I tried using the model.identify_effect() in the python dowhy library, I receive the above error. This occurs even if I use the examples provided in the Getting Started guide. ChatGpt informs me ...
ghavranek's user avatar
7 votes
1 answer
127 views

I'm trying to write a script that prompts a user to input a transition probability matrix for a Markov chain, and then displays the associated transition diagram. Here's the relevant code: class ...
Kale's user avatar
  • 81
1 vote
1 answer
62 views

I have 7M nodes and 20M relationships, my goal is to run random walk and node2vec using gds. My current strategy is -> create graph projection, run random walk , use my custom python code to create ...
Karthick Durai's user avatar
1 vote
2 answers
84 views

I have the next example of graph: import networkx as nx G=nx.DiGraph() G.add_edges_from([('b','a'), ('b','c'), ('a','c'),('c','d')]) In visual way it should look like this: digraph { layout=&...
Sanek Zhitnik's user avatar
4 votes
1 answer
150 views

I'm working on a warehouse layout in Python where a route is calculated between multiple pick locations. The layout includes both wide and 'ultra-narrow' aisles. In the real-world setup, ultra-narrow ...
Pim Mulder's user avatar
1 vote
1 answer
96 views

I'm dipping my toes into network visualizations in Python. I have a dataframe like the following: | user | nodes | | -----| ---------| | A | [0, 1, 3]| | B | [1, 2, 4]| | C | [0, 3] | |.....
alpacafondue's user avatar
0 votes
0 answers
57 views

Suppose a number of trees among which we have the following tree. Tree configuration's is represented by 2 lists arranged as tuples representing tree edge's: ss-pair=[(1, 2), (2, 3), (3, 4), (4, 5), (...
Honoré De Marseille's user avatar
3 votes
0 answers
75 views

In networkx there is a function find_negative_cycle, for finding a negative cycle in a weighted graph. But, it requires to specify a node in the cycle: find_negative_cycle(G, source) If I am ...
Erel Segal-Halevi's user avatar
0 votes
1 answer
61 views

I have a directed graph where the edges have the attribute edge_id. I want to create a new graph using the edge_id as nodes. I think there should be some more straightforward method than this? import ...
Bera's user avatar
  • 2,228
2 votes
1 answer
202 views

I'm trying to write code to recursively generate directed graphs as described in the following process: For G_1, we start with a single vertex with a self-loop. For G_2, we take two copies of G_1, ...
Mark's user avatar
  • 1,801
0 votes
1 answer
69 views

I'm working on a task where I need to apply custom modifications to many independent copies of the same base graph. For each instance, I want to: Start from the same base graph Remove one or more ...
hanugm's user avatar
  • 1,437
1 vote
1 answer
137 views

What is the format of node features that graph2vec and GL2vec in karateclub require? It does mention that there should be no string features but with or without it I am running into an error with the ...
Arindam Ghosh's user avatar
0 votes
1 answer
61 views

I'm trying to make a graph to visualize parts in a product and their type of connection inbetween. The labels between the nodes are important, not the labels on the nodes themselves. Sometimes the ...
kucb's user avatar
  • 37
0 votes
1 answer
56 views

I've been trying to calculate graph properties of any given graph using the networkx package and numpy in python. However, when I calculate the eigenvalues of a graph laplacian, it seems that numpy ...
eigenz's user avatar
  • 3
0 votes
0 answers
24 views

Problem Statement I am working on a network closure problem where I have multiple nodes and their measured delays. Given a set of nodes and delay measurements, I need to ensure that each triangle of ...
Anthony Bwembya's user avatar
0 votes
0 answers
57 views

I would like to convert all my .dimacs graphs to .g6. I wrote a Python script to do this, but when I open my graph.g6, I realize that the string is not in the correct format. How can I properly ...
saami783's user avatar
2 votes
2 answers
74 views

I have code that aims to generate a graph from an adjacency matrix from a table correlating workers with their manager. The source is a table with two columns (Worker, manager). It still works ...
mrgou's user avatar
  • 2,720
0 votes
1 answer
70 views

I have multiple Networkx graphs (with node attributes), and I need to represent them as strings. There are several ways to do that, but I need to always get the same string for equal graphs (not ...
ThePirate42's user avatar
0 votes
0 answers
38 views

A TypeError: MyNetwork.__init__() missing 1 required positional argument: 'some_parameter' is thrown on the last line of the following code snippet: class MyNetwork(nx.DiGraph): def __init__(self, ...
Joris Kinable's user avatar
5 votes
2 answers
272 views

In a graph/chain there are 3 different states: ST, GRC_i and GRC_j. The following edges between the states exists: EDGES = [ # source, target, name ('ST', 'GRC_i', 'TDL_i'), ('ST', '...
HJA24's user avatar
  • 406
0 votes
0 answers
35 views

I am stuck with computing the extended modularity metric on a multi-layer graph. I am trying to derive the result of the middle graph in Figure 6 of the following article: https://www.nature.com/...
user avatar
2 votes
0 answers
93 views

Using networkx and graphviz, I am trying to visualize a tree with many nodes. No matter what parameters I use, I am unable to prevent the nodes from overlapping, which makes them illegible. Are there ...
Jonah Lubin's user avatar
1 vote
1 answer
98 views

I have already built a network 2D graph using networkx in python. Code used to build: import pandas as pd import matplotlib as mpl links_data = pd.read_csv("https://raw.githubusercontent.com/...
ViSa's user avatar
  • 2,377
2 votes
1 answer
39 views

I am trying to create a network graph on correlation data and would like to color the nodes based on categories. Data sample view: Data: import pandas as pd links_data = pd.read_csv("https://...
ViSa's user avatar
  • 2,377
2 votes
1 answer
255 views

I have the following graph G G is created using the following code import networkx as nx import matplotlib.pyplot as plt G = nx.hoffman_singleton_graph() pos = nx.spring_layout(G) nx.draw(G, pos=pos)...
HJA24's user avatar
  • 406
1 vote
1 answer
40 views

I have a distance matrix of 50 cities. Sample matrix of the first 10 cities looks something like following: 0 1 2 3 4 5 6 7 8 9 0 0 Inf 1033.836 2954.445 Inf 570.7902 Inf 5201.642 927.6648 Inf 1 Inf 0 ...
Himanshu's user avatar
1 vote
1 answer
76 views

I want to obtain the adjacency matrices of a networkx.MultiDiGraph. My code looks as follows: import numpy as np import networkx as nx np.random.seed(123) n_samples = 10 uv = [ (1, 2), (2, 3),...
HJA24's user avatar
  • 406
1 vote
2 answers
95 views

I have a list of paired values. Values in each pair are declared as similar, meaning two values are considered similar if they appear together in a pair from the list. My goal is to create a list of ...
Ömer Faruk Güllüoğlu's user avatar
1 vote
0 answers
61 views

I have an undirected weighted graph: I manually calculated the centrality for each node. 1 - 0 2 - 1.5 3 - 0 4 - 3 5 - 2 Then I calculated the centrality using this algorithm import networkx as nx G ...
CityOS's user avatar
  • 11
1 vote
0 answers
38 views

The task was: Write a function generate_semieuler that returns some directed semi-Eulerian graph on n vertices with m edges that has no bidirectional edges, or None if such a graph does not exist. ...
cyrexskywalker's user avatar
0 votes
0 answers
43 views

PATY_HI PATY_LO MATCH_KEY WEIGHT_BUCKET 12345 6789 T r 54321 3456 A;T b 34567 12345 EP;T y I'm using the Networkx package to create a visualisation of the associations of a customer, so the user can ...
Noobie09's user avatar
2 votes
2 answers
92 views

I use scipy version 1.14.1 to traverse the minimum spanning tree in depth-first order, but I do not understand some results, namely the predecessors returned by scipy are not correct. Here is an ...
user11634's user avatar
  • 306
-1 votes
1 answer
48 views

This is a simplified version of this SO question (link) with some program output. Using Python and networkX under macOS, I am not able to assign a value to an edge attribute as follows: import ...
Perry Horwich's user avatar
0 votes
1 answer
173 views

Does anyone know of an algorithm that can produce an outerplanar embedding of a graph? I am looking for something similar to check_planarity from NetworkX, which returns a planar embedding if the ...
N C's user avatar
  • 11
0 votes
0 answers
23 views

I have a connected graph that I have created using NetworkX. I am trying to find all cliques in this graph. I used enumerate_all_cliques() from the NetworkX package. This is only giving me cliques of ...
blackthorne18's user avatar
0 votes
1 answer
53 views

I am developing a scikit-learn estimator, the documentation states that the input "X" for the .fit() method should be an "array-like of shape (n_samples, n_features)". However, my ...
Fumagalli's user avatar
1 vote
1 answer
46 views

I have a 2-dimensional array that represents a grid. The (numpy) array is as follows: dx_grid =[[ "A", "B", "C"], [ "L", "M", "N"],...
blackthorne18's user avatar
0 votes
0 answers
57 views

I have a large network file (about 7 million nodes and 7 million edges) that i've imported in a networkx graph. I need to estimate its closeness centrality average across all nodes. I've tried ...
none none's user avatar
  • 353
2 votes
1 answer
116 views

I work for an airport, and my task is to calculate the taxiing routes for airplanes on taxiways, ensuring they follow the prescribed road sequence. Here, I'll give an example and would like to ask if ...
Rabbids's user avatar
  • 176
1 vote
1 answer
156 views

I am new to graph theory and am trying to find the largest subset of x,y coordinate points in which all points in the subset are within a specified distance of one another. I am currently using the nx....
Spencejo's user avatar
0 votes
1 answer
70 views

I'm trying to simplify a graph after modifying the gdf_edges and recreating the graph from the dataframes. My workflow is as follows: ox.graph_from_polygon => graph_to_gdfs => modify gdf_edges =&...
mcsoini's user avatar
  • 6,792
0 votes
1 answer
67 views

isomatcher = nx.isomorphism.GraphMatcher(G, H) isomatcher.subgraph_is_isomorphic() In my understanding this function returns True if a subgraph of G is isomorphic to H. Yet when I run this code as ...
Will Chang's user avatar

1
2 3 4 5
122