Click here to Skip to main content
15,892,674 members
Everything / Graph

Graph

graph

Great Reads

by Bharat Mallapur
Sample project to host MS-Chart in your WPF application
by Dmitrii Nemtsov
A way to build a finite-state machine identifying predefined sequences in a stream of characters
by Chris La
A 2D/3D force directed graph algorithm in C#
by saransh89
How to create stack bar chart using AngularJs and ChartJS

Latest Articles

by Dmitrii Nemtsov
A way to build a finite-state machine identifying predefined sequences in a stream of characters
by IAmJoshChang
Today we are going to demonstrate how to use Top Down Dynamic Programming to solve the problem, Coin Change.
by IAmJoshChang
Graphs are one of the most common questions that might show up in a technical interview, especially in these days where many real-world applications can be represented by nodes and edges such as the social networks!
by IAmJoshChang
How to traverse a postorder binary tree

All Articles

Sort by Updated

Graph 

29 Jun 2021 by Aditya Gupta 2021
Arif runs an NGO for the welfare of animals. There are N workers in his NGO and they have been assigned the task to collect funds for the smooth running of the NGO. Arif has the information for each worker of how much amount they could collect...
6 Nov 2014 by Afzaal Ahmad Zeeshan
There might be a change on the Facebook Graph or their API. You can consult a client from their API to get help in this, if there is no problem in the code execution but just an unsual result, you can try asking them out for help. Or a better option is to check their API, they might have...
29 Jun 2018 by Alexandre Cornet
In my economics research I am currently dealing with a specific shortest path problem: Given a directed deterministic dynamic graph with weights on the edges, I need to find the shortest path from one source S, which goes through N edges. The graph can have cycles, the edge weights could be...
22 Sep 2016 by Alexandros Pappas
This project provides utilities for SQL server, such as executing a list of SQL scripts, exporting data to an SQL script, and displaying relationships between records.
16 Oct 2016 by Alireza Shokrizadeh
Here is my codeimport networkx as nximport pylab as pltfrom collections import Counterwebg = nx.read_edgelist('web-graph.txt',create_using=nx.DiGraph(),nodetype=int)in_degrees = webg.in_degree()in_values = sorted(set(in_degrees.values()))in_hist = [in_degrees.values().count(x)for...
27 Dec 2021 by Andy Bantly
This problem is discussed in the book Algorithms in C++ volume 5 - Graph Algorithms. I believe your solution is going to be based on minimal spanning trees. The chapter on this topic (chap 20) is very detailed. I think if you can see it, then...
7 Jan 2022 by Annaarddy
Genetic algorithm will work for generating random pairs
30 Mar 2015 by Averla
How to add both click and double click event in svg D3charts. I tried this code. Iam using D3 charts.. I devoleped Tooltip but i need to create a div to show the data on double click to copy data, i have a click event where in that event child-parent hiding take place. I want to implement double...
2 Jul 2015 by Bharat Mallapur
Sample project to host MS-Chart in your WPF application
8 May 2022 by Bornita Das
I am new to Graph Theory. I am trying to understand the relationship between Strongly connected graphs and Strongly connected components(SCC). Please explain why if there are k SCCs in a graph, we can add atmost 2k edges to make the graph a...
28 Jul 2020 by bswarrior
ı need make a loop from data coordinates for graph, for example ı want to change the plot's color in graph one by one and starts again from the firs one.I'll be glad if you can help me. What I have tried: import numpy as np from matplotlib...
14 Jan 2015 by Chetan Saini
From a long time i am trying to generate graph like this Image Url Codes i tried. Excel.Range chartRange1; Excel.ChartObjects xlCharts1 = (Excel.ChartObjects)worksheet.ChartObjects(Type.Missing); Excel.ChartObject myChart1 =...
28 Jan 2015 by CHill60
Whenever you are trying to sort out problems in your code start at the very first error reported not somewhere in the middle!The first error reported is not on that line at all - it's on public void Form1_Load(object sender, CpuUsage e) and states Quote:The type or namespace name 'CpuUsage'...
25 Apr 2019 by Christian Graus
PHP runs on the server. Javascript runs on the client and is precisely what you need to use, unless you're determined to generate a static bitmap on the back end and then serve it. I'v never used PHP, but, I imagine it could only do that via a COM object?
14 Jan 2024 by Code Artist
Consider this algorithm Implementation Downsampling Algorithm in MSChart Extension[^] to plot large data size without loosing details of trends and performance impact.
26 Nov 2014 by CPallini
MSDN provides tutorials about: "Getting Started"[^]
29 Jun 2015 by CPallini
Assuming you are able collecting input from the user, then drawing the polygon is trivial:call moveto(x0,y0); lineto(x1,y1);...;lineto(x0,y0);Computing the perimeter is relatively easy, since, for instancel01 = sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));gives the length of the side connecting...
16 Nov 2018 by CPallini
Let's try a bit of experimental evidence. The program #include #include struct Queue { int data; int priority; struct Queue *next; }; void dump_pointers( struct Queue ** phead) { printf("-- dump_pointers --\n"); printf("phead=%p, *phead=%p &(*phead)=%p\n", phead,...
26 Aug 2021 by CPallini
Suppose you have a way to compute the nth combination of two indices of your list. E.g. list { 4, 8, 9 } combination number pair 0 (4,8) 1 (4,9) 2 (8,4) Then you have two (or...
25 Mar 2019 by Daniele Fontani, keggyy
In this article, we explain GraphQL and show how to use it with an unstructured database (MongoDB)
15 Mar 2019 by Darryl Bryk
A software application is presented which facilitates the analysis of crash test data, automatically generates graphs with injury criteria, and generates reports
16 Apr 2017 by Dave Kreskowiak
OK, have fun getting support for OxyPlot from the people who are writing it. Support · OxyPlot[^]
27 Dec 2021 by Dawood Ahmad 2021
Hi everyone, I am struggling with a graph algorithm problem in my Data Structures Lab assignment. I am given a weighted graph with N number of vertices. We have a starting point and we want to travel and visit as much vertices as possible, but...
19 Oct 2015 by devandprog
I have implemented dbscan algorithm in c#.net since this algorithm deals with datasets which contains d-dimensional points e-g the datasets it use are of the following formatexample:10,10020,3050,8469,74............I want to modify this algorithm for graphs datasets....
13 May 2023 by Dmitrii Nemtsov
A way to build a finite-state machine identifying predefined sequences in a stream of characters
29 Oct 2014 by DoomedOne
Hi everyone, I have a trouble modifying an old report, client wants to add a graphic in a report, Visual studio reporting services (no Crystal), not so hard I think myself, but now i'm struggling with an error: Could not load file or assembly 'Miscosoft.ReportViewer.DataVisualization,...
10 Nov 2014 by DoomedOne
I solved it, by replacing Microsoft.ReportVierwer.DataVisualization.dll from other development PC, delete reference to it from the proyect, re-add reference in the proyect.Now works.Regards
26 Sep 2022 by Dvdscot
Hello, I am trying to implement Zoom on this example: How to create a line chart using D3[^] I found several examples of zoom, with axes and without. Generally you need to select an area, call zoom there and this zoom is a d3.zoom which then...
17 Apr 2021 by Dương Dương
An intranet has n computers numbered 1 through n and m one-way communication links between several servers. A path of the form u, v, t represents the time it takes to transfer a file from server u to server v as t. When a computer receives a file...
6 Nov 2014 by Elgars Logins
I was using facebook graph api "/me/home" for my app. But now it returns just 1 record. It happened just in 2 days. Does anyone run into the same issue? How to fix it?
28 Jan 2015 by Eric@Fibonacci
Hi there!I am working on a C# application that monitor CPU Usage. The raw data must flow through a Graph and display on a form application. I'm quite new with C# and this error "Does not contain a definition for..." bullies me for a few days now haha. I've done tons of research on the problem,...
9 Aug 2017 by Espen Harlinn
Google gave me this:Chess Knight Problem | Find Shortest path from source to destination[^] It's pretty close to what you need, as you know where the pawn is going to be in x number of steps ... Best regards Espen Harlinn
10 Dec 2014 by Garth J Lancaster
in the old days of simple html, since I was never a web expert, I used to produce pages that looked like this :- Karthik Ravi - Graph of x vs y
5 Aug 2019 by geek code
I came across this problem while giving a sample test. The problem was that we have given a tree which is undirected. We can start from any node of our choice. Initially we have power "P" and while going from one node to other node we loose some power "X" (consider as cost of travelling) and...
30 Sep 2020 by Gerry Schmitz
You have 3 "components": 1) One to collect the data into a queue / collection. (e.g. BackgroundWorker) 2) Another that updates the Grid 3) Another that updates the chart. If #1 uses an observable collection, #2 and #3 can subscribe to the...
19 Mar 2021 by Greg Utas
By connected components, I assume you mean the number of disjoint subgraphs. If so, I would use an edge deletion algorithm. Put each vertex in a separate set and then iterate over the edges. For each edge, combine the two sets that contain the...
21 May 2021 by Greg Utas
An interesting problem, which is described here[^], including how to use a heap. I wasn't sure if the question meant "use the C++ heap" (dynamic memory allocation) or "use a heap data structure" (which is what the article suggests to improve the...
26 Dec 2021 by Greg Utas
I can't see a way to do this except for an exhaustive search (depth-first recursion) from the starting point. Exclude an edge when it has already been traversed in the same direction. When you can't add another edge, compare the number of...
16 Jan 2022 by Greg Utas
It is very unlikely that anyone will write this code for you. I assume that DFS = depth-first search. That will work, but you have to do a DFS starting from each node in the graph. During the search, you'll need to pass a vector of the nodes...
8 May 2022 by Greg Utas
O(n) algorithms for finding strongly connected components are referenced here[^]. I think your intuition is correct. However, the wording "we can add at most 2k edges to make the graph a strongly connected one" is confusing. In many such graphs,...
8 Mar 2020 by grvgrvgrv
Ada took a standard chessboard with 8 rows (numbered 1 through 8) and 8 columns (numbered 1 through 8); let's denote a cell in row r and column c by (r,c). Then, Ada placed a bishop in a cell (r0,c0) ; it is guaranteed that this cell is black....
4 Dec 2020 by IAmJoshChang
Graphs are one of the most common questions that might show up in a technical interview, especially in these days where many real-world applications can be represented by nodes and edges such as the social networks!
17 Dec 2020 by IAmJoshChang
Today we are going to demonstrate how to use Top Down Dynamic Programming to solve the problem, Coin Change.
15 Jun 2020 by imabadjoke
public static void main (String [] args){ Scanner sc= new Scanner (System.in); System.out.println("Enter no. of Islands"); int n= sc.nextInt(); Graph g = new Graph (n); System.out.println("Enter no. of...
8 Nov 2017 by JayyMehta
I am new to VB and am trying to learn how to create a pie chart out of certain values on the excel spreadsheet. I know how to do the bar charts but i was wondering whether you guys are aware of online resources or tutorials for this.. Thanks. What I have tried: Charts.Add ActiveChart.ChartType...
8 Oct 2015 by Jesús Álvarez
I have problem whit the chart when i resize other controls, i have a seri with N point added to my chart, then i paint a line graph.DrawLine(new Pen(Color.Yellow, 1), point3, point4); when i resize other control o de form this line disapear, then when i zom in the chart appear again. I need to...
5 Mar 2022 by Junaid Ihsan
I have data in excel sheet, having two columns (YEAR, nT), now I want to plot these two but I'm not getting the required graph, the code is import numpy as np import pandas as pd import matplotlib.pyplot as plt M1 = pd.read_csv('MF.csv',...
8 Apr 2016 by jurhas
Solving graph on linear time
29 Jun 2015 by KarstenK
The areas can get computed via triangulation: you seperate the polygon in triangles and add their areas. The perimeter is more complex. You need to find all outsides and add them.For that you may look for some algorhitm. I would write a test function to proof that a points is NOT in a...
5 Dec 2020 by KarstenK
you must seperate each condition or state into a seperate block or function and than solve it. For that you need some C++ from some C++ tutorial. Use class design like for the robots and the standard library. Make a lot of output, ev write a...
17 Apr 2021 by KarstenK
Nice try, but it isnt a C++ solution worth its name. You need more structure like with classes, structs and functions. It is used to gain some clean code for beginners. Be aware that your homework will be read by your teacher or tutor and he...
27 Mar 2023 by KarstenK
It sounds similar like the Travelling salesman problem. So you might look at this problem and its solution. The best solution may be some heuristic approach by trying each combination and evaluate them. Tip: use structs and arrays to write...
26 Nov 2014 by Karthik Ravi
Hi All,I working in a project done in .net Framework 2.0, I need chart control for displaying chart in web application i can't use chart control its hidden in tools.I also referenced "system.web.datavisualization.dll" , even its not working.can anyone suggest any solution for...
10 Dec 2014 by Karthik Ravi
Hi all I am generating dynamic graph using Graph control in dot net with good look and feel that will refresh for every 30 seconds(Every 30 seconds values are automatically inserted in db) in asp.net web application. I'm doing it in Framework 4.I'm using only Graph control in dot net,...
25 Sep 2018 by kavinderrana121
I'm studying graphs at the moment, and I'm using C. When I represent a graph with an adjacency list, I need a queue for a BFS traversal. However, I'm having some issues with the code - I'm not sure if I grasped the concept of a bfs traversal with queues well. I pasted the commented code below,...
16 Nov 2018 by kavinderrana121
My doubt is regarding pointer only,Here head is a double poiner to Queue if we are using *head than we are accessing the location(or address passed) inside main but when we are using simply head than we are using head in the current function only which will hold the address of pointer to Queue...
26 Nov 2014 by King Fisher
Try this Free Source :http://www.chartingcontrol.net/[^]http://www.fusioncharts.com/goodies/fusioncharts-free/[^]
9 May 2016 by leon de boer
Lets start with the most obvious problem I can see, that you haven't initialized the bool array visitedbool *visited = new bool[V]; // this leaves all the values in the array random are you sure you didn't mean to initialize it like so?bool *visited = new bool[V](); // this zeros the...
9 Aug 2017 by Lê Nguyễn thị hoa
[HELP] A chess have infinite size, Knight is at Mx, My and can move for 8 directions ( As rules of chess ) and the Pawn is at Tx, Ty but just go up (Tx, Ty -> Tx + 1, Ty) . The question : If the Knight move first, how many steps do we need to make Knight eat Pawn ? Link question :...
2 Jun 2020 by Maciej Los
Check this out: Graphs and Dijkstra’s Algorithm (C#) – Bits and Pieces of Code[^] For further details, please see: Shortest path problem - Wikipedia[^]
1 Mar 2021 by Maciej Los
Quote: I want a condition to say if the txtTest2.Text value is greater than the lblvalue then it doesn't show in the chart Stop! Think of it. Label, textbox, etc. is just a control. You have to work on data (graph data). So, all what you need...
26 Apr 2019 by MadMyche
Separation of Concerns comes into play here. The Chart is presentation layer and should be one of the last things to do; easiest way to do it would be via JavaScript on the actual webpage. PHP is server-side, and will play the roles of the Business Layer as well as the Data Layer. So how do...
23 Feb 2015 by manchanx
I'm no AI expert but I'd say AI isn't required to solve this and most probably wouldn't be the quickest way. I would try this approach:Imagine a cube - axis X is the day of the week, axis Y is the time spent studying and axis Z is the frequency of that happening (reflecting the "mostly" and...
3 Mar 2020 by Manujaya Premathilaka
Can a control flow graph contain multiple start and end nodes? If so, what will happen when multiple start and end nodes contain in a control flow graph? Thanks in advance What I have tried: I tried googling but I couldn't find an answer.
25 Oct 2014 by Marc Clifton
No word has a value that can be identified independently of what else is in its vicinity.
23 Feb 2015 by Matt T Heffron
Is the graph image what you actually have as input (i.e., you have image files as the input)?Or do you have the data points that were used to generate the image(s)?If you really want to learn about Machine Learning and Classification systems, check out the Free, introductory Machine...
2 Dec 2015 by Member 10243484
Hi all, I used canvas line chart with HTML5. I have a trouble with clear data and redraw the data. Example I drawn the random data on Y-Axis and the X-Axis increased one value in updateInterval times. I want when the X value had 200 and clear all data displayed on line chart and redraw again...
10 Jun 2015 by Member 10527566
I have a graph with nodes that have a time property. I was wondering if there is a control that displays a timeline according to the nodes.Something like the below picture:http://s3.picofile.com/file/8192248918/TimeLineGraph.png[^]For example in the picture the first node’s time is...
22 Feb 2015 by Member 11065384
I need to recognize a pattern in the following diagram/example:Image LinkI need to recognize that students spend a lot of time studying for 40-55mins ON Monday, Tues, wed. And rarely studies on another date and so forth. Can I use Machine Learning to do this or is there an easier and...
4 Sep 2015 by Member 11082591
i have Facebook application and business manger account i want to get access of Facebook page which is not my own. so i want to send request to page admin to get access on that page using Graph API. can it possible using graph API.which Facebook page i want to access that page admin need a...
3 Jul 2017 by Member 11247684
I need to extract the best path in terms of its length from a rectangular array like this array: Quote: |1||0||1||0| |1||0||0||1| |1||1||0||1| |0||0||1||1| The pathfinding rules: 1- Start from the indexes provided in the method signature where the rowIndex and colIndex are the positions of...
22 May 2015 by Member 11712614
#include using namespace std;int main (){ double dt = 0.10; //(it is constant) double t = 0.00; double dx = 0.10; //(it is constant) double x = 0.00; double ddy = 1.00; //(it is constant) double dy = 0.00; double y =...
29 Jun 2015 by Member 11801907
like i want to draw a polygon in c++ using graphics.h . then ask for coordinates and sides. x1, x2 ,y1 ,y2. then draw the polygon and show its area and perimeter as output. using their mathamatical formulas. I have done this. #include #include #include ...
30 Jun 2015 by Member 11801907
#include #include #include #include void show_screen( ); void Polygon(const int,const int []); void Line(const int,const int,const int,const int); int main( ) { int driver=VGA; int mode=VGAHI; ...
4 Aug 2015 by Member 11845912
Hi,I want x-axis to display non uniform data. My x-axis data is not uniform. Below are the data:7, 15, 20, 30, 32, 40, 56 etc....How can I make the x-axis take only these values. I am using graphlib, and I have set the grid distance as 1. It is displaying the x-axis as...
7 Jan 2022 by Member 12085717
I have a discontinuous list of numbers N (e.g. { 1, 2, 3, 6, 8, 10}) and i need to progressively create random pairs of numbers in N and store them in a list in which there can't be twice the same pair. For example for a list of 3 different of...
31 Oct 2015 by Member 12094885
i am using graphSharp lib for my project . in which i need to represent more than 10 elements but it did not view properply . here is the code private void CreateGraphToVisualizenode() { var g = new BidirectionalGraph>(); ...
25 Dec 2019 by Member 12128269
We have some data in both influxDb and dynamoDb. Now we want to fetch the data from both the DataStores into GraphDB free and make a sparql query by joining the results. What I have tried: We tried to fetch it using the URL directly in the import section of GraphDB Free but we are unable to do...
20 Dec 2015 by Member 12160712
So if I have two nodes in a graph, and they are connected through more than one edge while having the same shortest path between them (i.e if I have node A and node B and they are connected directly through three edges : edge 1, edge 2, edge 7 (there are 3 shortest paths between them each of...
20 Dec 2015 by Member 12160712
So, I'm trying to implement a program that calculates the degree of separation between 2 actors, for example if they both starred in the same movie then the degree of separation between them is 1. The problem is not how to calculate the degree of separation as I was able to demonstrate it, my...
1 Feb 2016 by Member 12300805
graph = {'A': set(['B', 'C']), 'B': set(['A', 'D', 'E']), 'C': set(['A', 'F']), 'D': set(['B']), 'E': set(['B', 'F']), 'F': set(['C', 'E'])} def dfs(graph, start): visited, stack = set(), [start] ...
15 May 2016 by Member 12512211
I need to make a program that searches for node with two arches to it. ->(). #include using namespace std;const int n=8;struct link{ char key; link...
3 Feb 2017 by Member 12613265
// Implementing BFS Algorithmimport java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; public class BFS { private Queue queue; // Queue that will contain some of Nodes static ArrayList nodes=new...
13 Sep 2016 by Member 12731860
problem explained here Keyboarding – Kattis, ICPC World Finals[^]What I have tried:What I did first was to put all characters in a 2-D array, find where all the letters are in array and adding the absolute value of the difference of the indexes to get shortest path, this only...
18 Sep 2016 by Member 12731860
I found this solution but its in c++ and I know c#, I dont understand it, can someone please explainusing namespace std;int dx[4] = { 1, 0, -1, 0 }, dy[4] = { 0, -1, 0, 1 };int mv[50][50][4];int best[50][50];int _tmain(int argc, _TCHAR* argv[]){ int Y, X; while (cin...
7 Jan 2017 by Member 12847424
Given an array C of n integers C1, C2, ... Cn and n-1 pairs of integers (p,q) which represents bi-directional links between p & q.Our task is to find for every index i from 1 to n the index j of the array C such that the value of Cj is largest and j is not equal to i and is also not linked...
22 Jan 2017 by Member 12962833
i am trying to get the license details of each user on my azure tenant on this webapp and i want to provide an edit option like the one you find in office 365 for user licenses how can i do this right? my details.cshtml page
10 May 2017 by Member 13191541
In R programming - How do I plot a network visualization graph given a matrix X with a 2 column coordinate system: coordinates
3 Jul 2017 by Member 13291909
using System; using System.Collections.Generic; namespace Prim { class PriorityQueue { int heapSize; List nodeList; public List NodeList { get { return nodeList; } }...
11 Jul 2017 by Member 13304699
Thank you for taking the time to read my message. (Using the **logit** function in package **car**) My Statistical analyses were conducted on probability estimates ranging from 0% to 100%. As it's not ideal to run linear models on percentages that are bounded between 0 and 1, these...
20 Nov 2017 by Member 13468650
I am trying to figure out how to find all paths between to nodes through all edges, not vertices. Was thinking about visited[][], to check did edge was visited, but I came up with some problems. Maybe I there is simple way and I can't see it. Any ideas? void allPathsDFS(int verticeFrom, int...
25 Nov 2017 by Member 13485513
I am doing a project to code the A* algorithm in the shortest path problem. In able to determine the shortest path using A* algorithm, I acknowledge that we have to get the heuristic value first. Do anyone know how to calculate and determine the heuristic value for each nodes? [i made up the map...
18 Jun 2018 by Member 13647869
I have a csv file that contains the following: the date a tweet is published, the sentiment value (0=negative and 1=positive), and then the tweet in the third column, all seperated by commas. I need to plot the date on the x-axis and the sentiment value on the y-axis to see the change of...
14 Oct 2020 by Member 13650651
Excel.ChartObjects xlCharts = (Excel.ChartObjects)oSheet.ChartObjects(Type.Missing); Excel.ChartObject myChart = (Excel.ChartObject)xlCharts.Add(10, 80, 450, 275); oSheet.Shapes.Item("Chart 1").Top = (float)(double)oSheet.get_Range("A15", "A16").Top; ...
17 Aug 2018 by Member 13952951
I have two plots. One is a plot of ten basketball players' paths and because of the coordinate system is scaled to a roughly 50x50 graph. The other is of some basketball half-court plotting code that I found online that is plotting on a roughly 500x500 graph scale. I want to superimpose the...
11 Sep 2018 by Member 13981298
Need to print labels on a GlControl box for a graph. This can be done easily with Glut. However, OpenGL.Net does not seem to support GLUT. What I have tried: Tried writing the string on a bitmap and then print it on the Glcontrol but it prints some garbage value. The application is in WinForm....
23 Jan 2019 by Member 14042924
I'm practicing for National programming competition and I came on this problem: We are given undirected complete graph with N vertices. Every edge in graph has color red or green. We should find number of triplets(i,j,k) of vertices such that edges(i,j),(j,k)and(i,k) all have same color. We are...