# Questions tagged [graph]

Graph refers to a graphic (such as a chart or diagram) which displays the relationship between two or more variables. For the discrete mathematics structure consisting of vertices and edges, use the graph-theory tag.

20,974 questions

**0**

votes

**0**answers

8 views

### Framework to draw dependency graph in iOS swift

I need to draw graph which represent structural information

**0**

votes

**0**answers

4 views

### Decide whether there exists a path with a given weight sum K in a weighted (nonnegative) tree in linear time?

I think I should use BFS/DFS and maybe convert the tree into binary (search) tree however I am not sure how to combine this so that the algo is linear. Any help
appreciated.

**0**

votes

**3**answers

36 views

### How to I create an adjacency matrix out of this?

Reading an unspecified amount of edges in the form of 3 ints, the first is the source node, second is destination node, and the third is the weight of the edge.
Currently trying to turn in this ...

**0**

votes

**0**answers

8 views

### DotNetBar DevComponent ChartXY - Saving the chart as an image

I need help turning my ChartXY DevComponent from dotnetbar (with data already plotted), into an image I can import into my pdf.
I have tried to do it similar to WinForms DevComponent Chart with the ...

**0**

votes

**0**answers

9 views

### What is the best choice to store graphs metadata

I work on graphs. I create a java project that read the input graph (csv file). Then, it partitions the large graph using a graph partitioning method over a set of 4 partitions. Until now, the graph ...

**-1**

votes

**0**answers

13 views

### For the adjacent matrix graph how to transpose graph [on hold]

i have a homework is about adjacent matrix directed graph algorithm, i am a little confused about how to transpose the graph, can anyone give me a c++ pseudocode please....

**0**

votes

**1**answer

24 views

### Counter for graphs in VBA

Im working on a code in the userform in the vba. For this, i have to plot a graph multiple times with the data i aquired online. But the graph ploted many times should be the same. So how do i call ...

**1**

vote

**0**answers

13 views

### Time and Space complexity of BFS and DFS, on Graph in AdjacencyMatrix and AdjacencyList

i have performed BFS and DFS ( For printing the Graphs) --> with multiple Implementations.
But I am confused with the time complexity of them, while reading online some say its O(V^2) . some say its O(...

**0**

votes

**0**answers

8 views

### Bellman-Ford algorithm with n-1 iterations

I am supposed to find the graph for Bellman-Ford algorithm, where I have to use all n-1 number of itterations.
Can I use this graph, where S is my initial node?
https://imgur.com/a/AX3iMRS
Thanks.

**0**

votes

**0**answers

14 views

### How to compute nodes of a my Graph from (node,value) pair

I am new to Python and while computing centralities (katz centrality in this case) of the nodes in my network, I have gotten top nodes with highest centralities but I don't know how to get the node ...

**0**

votes

**1**answer

20 views

### How can I create a planar graph? (graph based method )

Creating a planar graph using a graph based method is a my homework.
graph based method is to maxmize weight between departments.
The steps of the graph method
Step 1: Select a department pair ...

**0**

votes

**1**answer

9 views

### Algorithm for solving a shortest edges problem?

Here is the problem:
For a graph of several nodes, each node could only connect to one of the other nodes. How to minimize the total edges of this graph?
Fig.1Fig.2
As the above, Fig.2 has shorter ...

**0**

votes

**0**answers

22 views

### Confused about stop condition on Spark/Graphx/Pregel example program to find 'path distance

'
I am working my way through Graphx In Action and this book
(source code for which is here: https://github.com/insidedctm/spark-graphx-in-action)
discusses two ways of calculating the distance
(...

**0**

votes

**2**answers

29 views

### Is there any way to add overlays to bokeh plot highlighting certain areas based on x-axis datapoints. See picture below

I am plotting some data on x-axis and y-axis which gives peaks. I want to highlight certain areas of the peaks in multiple colors.
I was able to get the plot but have no clue on how to add overlays ...

**0**

votes

**1**answer

22 views

### I am trying to categorize bars on a Bokeh chart using a pandas multi-index, but I can't seem to get it to work

As the title states, I have a multi-index dataframe in pandas which I am trying to convert to a ColumnDataSource in Bokeh. Once this is complete I am attempting to create a bar chart with each bar in ...

**1**

vote

**0**answers

3 views

### How to fix - Update plannertaskdetails - If-Match header contains an invalid value

I am trying to update (PATCH) an existing Microsoft Planner task, to add one (1) checklist item to it. I am using Microsoft doc https://docs.microsoft.com/en-us/graph/api/plannertaskdetails-update?...

**-1**

votes

**1**answer

38 views

### Data Structure to Represent Family Tree

I want to have a data structure to represent a family relationship, including mother, father, sister, spouse, etc. One way I am thinking is to have a class of Person and make different fields to ...

**0**

votes

**2**answers

27 views

### How to select data from 'logged in user' from database to a graph

I need help with some code. I want to select data from mySQL to a graph on my web page.
The data must be from the current logged in user, and when I select data to a card it works fine, but when I ...

**0**

votes

**0**answers

11 views

### Reconstruct shortest path from a list of predecessors

I am trying to do a shortest path reconstruction with the given parameters:
an array P, which contains the predecessors of every vertex on a shortest path from S to I
a starting vertex S, defined by ...

**-1**

votes

**0**answers

16 views

### How can I determine the leaders and followers of a graph using python?

I created a graph using the networkx library, now I need to identify the leaders and followe of the graph.
From the theory I know that these particular nodes are characteristic of symmetric graphs.
...

**0**

votes

**1**answer

10 views

### saving a graph for each matplotlib

How do I save a graph for each graph produced in a for loop?
Here is my code:
for frame in all_frames:
test[frame.columns[0]].plot(kind ='line', x ='date')
plt.ylabel('Percent Change from ...

**0**

votes

**0**answers

16 views

### How does characteristic of thing being match using bipartite graph?

i want to ask about the use of bipartite graph in a job searching system. how do they work? and where do we put the characteristic that we want to match with on graph to another? for example G={A,B} ...

**0**

votes

**0**answers

12 views

### How to forbid cyclic edge connections between vertexes on mxgraph (acyclic graph)

I have created a custom editor using mxGraph.In my editor, the user should be able to create an acyclic graph. When the user will try to make a cycle in the graph, a popup should appear informing the ...

**1**

vote

**4**answers

43 views

### colors in legend do not match graph colors

I am trying to make customized legends showing only some of the lines plotted. However, the color in the legend does not always match the color of the plotted line. In the example legend 1 and legend ...

**0**

votes

**0**answers

6 views

### Graph with O365 Calendar is legacy? What is the 'new' way?

I want to use an O365 API for synchronisation of the Calendar (deamon).
Currently it uses EWS, but that is end-of-life and can't be used (in our case) due to new security policies.
But Graph Calendar ...

**0**

votes

**1**answer

16 views

### How can I implement the Union-Find algorithm?

I'm trying to implement the Union-Find algorithm, but all of the implementations i've looked up use integers. I need to implement the algorithm so that I can call the union() and the connected() ...

**0**

votes

**0**answers

24 views

### How do I implement Kruskal's algorithm in Java with non-integer vertices?

I've been trying to implement Kruskal's algorithm on my graph which is undirected and weighted. Nonetheless, in all of the implementations i've seen vertices are defined as integers but in my project ...

**0**

votes

**0**answers

31 views

### How can i calcullate the complexity of my longest path problem?

I need to find the longest path in wich the values of the points are geting bigger. First i find the number of steps of the longest path, and then i use DFS to search all the point in my map and see ...

**0**

votes

**1**answer

29 views

### Neo4j - how to include start node in my query?

I'm attempting to build a recommendation engine for a library system.
This is my db schema:
My starting point is a LoanerCard. The flow is then supposed to look like this: Get all copies -> get the ...

**0**

votes

**1**answer

28 views

### How to calculate the distance between all nodes of a graph MatLab

I have a graph G, and I want to find the distance of each pair of nodes. For directly connected nodes the distances(G) matlab function will return 1, there i want to find the distance as if these two ...

**0**

votes

**0**answers

7 views

### See if exists a connected subgraph that contains only and all articulation points as vertices

I need to see if a connected undirected graph verifies this two conditions:
1: it contains at least one articulation point;
2: there exists a connected subgraph that contains only and all ...

**0**

votes

**0**answers

16 views

### Is it possible to rotate a certain part of a graph in python by 90, 180 and 270 degrees?

I'm currently writing a code where I should implement the pivot algorithm. This means that I have to rotate a part of the graph either 90, 180 or 270 degrees.
The code uses lists for both x- and y ...

**0**

votes

**0**answers

13 views

### What library/libraries of Python can I use to plots that follow Edward Tufte's style with axes, plot multiple ranges of values, etc.? (Examples below)

I'm looking for libraries that can plot different types of graphs, most of which are relevant in ML/Data science areas. Below are examples of graphs that I'd like to plot.
"Plot 1" follows Edward ...

**0**

votes

**0**answers

12 views

### Universal Sentence Encoder - RAM and CPU requirements

I am planning to deploy application, which uses Universal Sentence Encoder link on AWS Elastic BeanStalk.
What would be appropriate instance to deploy (RAM and CPU)? Where can I get more info on how ...

**2**

votes

**1**answer

21 views

### Recursive function returning final result before all recursive calls are popped off the call stack

I am confused about why this DFS algorithm I've written is not visiting the final vertex in my graph. Here is the code:
Graph/Vertex Class
import java.util.ArrayList;
import java.util.Deque;
import ...

**0**

votes

**1**answer

70 views

### facebook graph request using swift 5

I am trying to implement a facebook graph request just as described on their developer´s doc page (https://developers.facebook.com/docs/swift/graph). Xcode 10.2.1, swift 5.
But I keep getting the ...

**-1**

votes

**1**answer

13 views

### Creating a 3D graph out of 3 lists that contain recurring values

I'm new to python.
I'm working on a machine learning problem in which I value my models by their accuracy given a theta (learning rate) and a number of epochs.
How can I create a clear 3D graph that ...

**0**

votes

**0**answers

39 views

### Dijkstra's Algorithm for graph structure

I'm currently trying to learn some graph theory online and from a friend and he's had me working with a specific structure of graph, I now want to implement Dijkstra's algorithm using the struct but i ...

**0**

votes

**1**answer

18 views

### Inconsistent data interval, create regular interval values between known points

I have a list of data points for given depths. Each depth is assigned a character.
My problem is that the data points are at inconsistent intervals, sometimes they can be 1m apart, sometimes 100m.
...

**0**

votes

**0**answers

11 views

### Find resizable layout for drawing mnemonic diagram (mnemonic graph), JavaFx

My task is coding mnemonic scheme (mnemonic graph) that is presented in the picture. All components of schema are GridPanes. The layout must be resizable -
all components must change their sizes ...

**-2**

votes

**0**answers

21 views

### Construct a graph using the BFS output

Does anybody know how can I create a graph using the BFs output (distance vector) ?
For example I have the input : 0 1 1 2
And i need to construct a graph with edges 1->2, 1->3, 3->4.

**0**

votes

**1**answer

10 views

### How do I sum a list with its previous entries and substitute with new and corrected entries?

I am graphing the internet connection in my apartment, and I have data for upload and download speeds, and time with it aswell. I have a list of data for all these variables, but I need to sum my time ...

**0**

votes

**0**answers

38 views

### After generating a random graph with graph-tool, it doesnt show the graph and can't find the output file either

I would like to generate and display random graphs with the help of graphtool, but the displaying part isn't working and I can't figure out why.
I have set up Phyton and Docker, with the help of ...

**1**

vote

**1**answer

23 views

### Problem Search Predicate with graph ver 3.1.1

the graph version was updated via cocoapods all 3.1.1
now however the application notifies me of errors when I use the search, I think I have solved the problem in part but it still notifies me error,...

**0**

votes

**0**answers

25 views

### Circles of different radius based on other values in d3

I am trying to create nodes whose radius depend on the amount value in the link array. The data structure is as shown below:
{ "nodes": [{"id": "site01", "x": 317.5, "y": 282.5},
{"id": "site02", "x"...

**-2**

votes

**0**answers

31 views

### How to get coordinates of a graph using opencv image processing [on hold]

I am new to image processing and am looking for guidance. I have the following image and I want to get the full (x,y) coordinates of the graph using opencv. I am going to analyse an EEG/EMG medical ...

**0**

votes

**0**answers

22 views

### Detect all nodes involved in a cycle

I'm trying to solve https://leetcode.com/problems/find-eventual-safe-states/
My approach is, to simply get all nodes involved in a cycle in the given graph.
Here's my code :
class Solution {
...

**0**

votes

**1**answer

17 views

### Shift all plotted values along one of axes after Python plot is already called

Suppose I already called
ax.plot([10, 20, 30], some_y_values)
Do I understand right that it is impossible at this point to make all x values less by e.g. 10, i.e. [0, 10, 20]? If I understand right ...

**2**

votes

**1**answer

135 views

### What is needed to use BGL algorithms on existing data structures ( edges and vertices as vector<Object *>)?

I have custom data structures like this :
vector<myVertex *> my_vertices;
vector<myEdge *> my_edges;
My class myEdge has source() and target() methods, returning myVertex*, so it should ...

**0**

votes

**0**answers

15 views

### First time visited nodes form a spanning tree that has a same number of edges in both BFS and DFS

I am trying to state, whether the statement is true:
During a DFS/BFS, first time visited nodes form a spanning tree, that has the same number of edges whether you use DFS or BFS.
Is it true? Thanks!