Skip to main content

Questions tagged [graph-traversal]

Filter by
Sorted by
Tagged with
2 votes
1 answer
253 views

In my application, I perform a topological sort of nodes where an integer represents a node's ID using DFS and white/gray/black coloring. See https://yuminlee2.medium.com/topological-sort-cf9f8e43af6a ...
NWoodsman's user avatar
  • 195
2 votes
2 answers
459 views

I am working through an example of best-first search on a graph, and I'm having some trouble understanding exactly what the process should be. This is the graph I have: The heuristic values are in ...
Gerhardus Carinus's user avatar
0 votes
2 answers
243 views

I have several drawings from SVG files which basically contain basic outlines of figures. They are constructed in segments of various shapes (lines, ellipse arcs, Bezier curves ect.) Something like ...
DrDress's user avatar
  • 127
0 votes
1 answer
1k views

Is there a good way to search for duplicate subgraphs in an immutable directed graph, where edges and nodes may be labeled? I was thinking I could try to name the nodes according to their position in ...
Drathier's user avatar
  • 2,883
2 votes
1 answer
658 views

Setup/Intro I have 10k+ nodes in my Neo4j graph in which I need to display a sub-graph (100-500 nodes) between 2 start/end nodes on the frontend app along with info about the critical path and all ...
IamMowgoud's user avatar
2 votes
2 answers
388 views

Given a minimum spanning tree in an unweighted graph of (10 .. 500) vertices and (vertice_count .. 1000) edges. Each vertex can have up to 6 edges. Given K agents/bots/processes/etc.., all starting ...
ZogStriP's user avatar
1 vote
1 answer
237 views

I have been doing problems on LeetCode recently, and keep getting stuck on some graph or tree problems. I understand the underlying concepts of Graphs, Trees, and different methods of traversal just ...
Brian C's user avatar
  • 147
1 vote
2 answers
134 views

per the title how important is the data in assessing code coverage? As background, let's say that you're given 20% of the entire dataset to help trace the different pathways each row of data goes ...
user2105555's user avatar
0 votes
1 answer
1k views

I'm working on a class that receives a relational EDM/data model (e.g. a SQL DB or OData API manifest) and performs a couple tasks on them (not necessarily at the same time, could be two separate runs)...
Josh's user avatar
  • 170
1 vote
2 answers
126 views

I need help with a problem which I have been working for the last month. I have a group of documents, each document has a set of unique words (if the word appears more than once in the document, I ...
julodnik's user avatar
  • 119
1 vote
1 answer
71 views

This question is most easy to describe as a modification of that my question. Suppose that question is solved as the following Python class: class Traversal(object): # ... def next(self): # ...
porton's user avatar
  • 791
0 votes
1 answer
129 views

I have a system i've written on paper and am trying to write this into C# in a easy to use manner. I want a series of connected waypoints (where by waypoints can be connected to any number of other ...
WDUK's user avatar
  • 2,092
2 votes
2 answers
429 views

If we have different objects, [A1, A2, A3, B1, B2, B3, B4, B5] Some calculations will be performed to find compatible objects. For example, lets assume following 3 sets were formed and every set ...
Zohaib's user avatar
  • 131
6 votes
1 answer
689 views

I'm working on a problem that reduces to something like toll plaza placement on a set of highways. Given a large undirected graph and a list of node pairs with a toll value between them, I need to ...
user3298142's user avatar
0 votes
1 answer
748 views

I have a large data set (more than 3 Million distinct data points that have 6 integer numbers). I want to compute the shortest route in terms of hamming distance. (amount of numbers that change ...
FSMaxB's user avatar
  • 103
0 votes
2 answers
310 views

Let we have a (finite or infinite) directed graph and a start vertex. For each vertex we have the set of edges from this vertex totally ordered to specify the traversal order. Let we also have a set P ...
porton's user avatar
  • 791
25 votes
3 answers
6k views

This is an example of what I want to do via code. I know you can use jump point search to easily get from the green node to the red node with no problems, or even A*. But how do you calculate this ...
Jeff smith's user avatar
1 vote
1 answer
699 views

In my current project I have a situation where I would need to use an edge collection as vertex collection. I would like to find a way to avoid it. This is the (reduced) scenario. These are the ...
Richard Burkhardt's user avatar
0 votes
3 answers
253 views

This is not (supposed to be) an opinion question, but it is a newbie question, so if there is just a resource I haven't found that I need to read, point me there :) I am in the design stages of a ...
Apollo's user avatar
  • 111
1 vote
1 answer
227 views

The use case I am trying to solve is, assigning millions of users to their groups/segments. I have thousands of different criteria from which buckets of users are created. E.g. bucket criteria: All ...
PUG's user avatar
  • 111
2 votes
1 answer
2k views

I am trying to solve a problem in which I have a list of two-dimensional coordinates, and I want to find the shortest path that connects all of them. At first I thought this was a case of the ...
Qqwy's user avatar
  • 4,947
6 votes
1 answer
149 views

In my contrived example, I have a rectangular grid of nodes, where each node is either empty, of Type 1 or of Type 2. All nodes are directed to the eight nodes around them (horizontal, vertical, ...
Qqwy's user avatar
  • 4,947
3 votes
1 answer
156 views

I am working on writing a code for Hilbert algorithm to solve a Traveling Salesmen Problem. Although there are several efficient methods out there, I am just curious about the implementation of ...
jhon_wick's user avatar
  • 141
0 votes
2 answers
423 views

I've been reading the 3rd edition of [Algorithms][1] by Cormen, Leiserson, Rivest and Stein. For DFS and BFS their algorithm loops through all the vertices first and colors them white. 1) If the ...
drewsmug's user avatar
  • 111
1 vote
1 answer
270 views

I'm curious about how the flight/train search engines combine the results from multiple sources. For example, let's say I'm asking to go from London to Paris, and let's assume there are no direct ...
André Borie's user avatar
0 votes
1 answer
1k views

Given a simple directed graph G=(V,E) an induced cycle is a cycle where no two vertices of the cycle have an edge that is not in the cycle. (Chordless cycles are induced cycles with at lease 4 ...
stardust's user avatar
  • 101
2 votes
0 answers
419 views

I have a question regarding finding relevant events in a line graph. The following graphs show the views (y-axis) of a video over time (x-axis). Certain events lead to an huge increase in views and ...
thpl's user avatar
  • 121
3 votes
1 answer
1k views

Most of the static code analysis tools which analyse class dependencies generate dependency pairs of classes where each pair represents a direct dependency between two classes. Given those dependency ...
Heramb Deware's user avatar
1 vote
1 answer
986 views

I must implement , in Lisp , a depth-search algorithm in an implict graph (namely a graph where I have the starting node, the goal node, and the successor function ,f, that give a node create his ...
Nick's user avatar
  • 11
4 votes
1 answer
578 views

Wikipedia states that the following algorithm works for any tree (not necessarily binary trees) Perform pre-order operation For each i (with i = 1 to n) do: Visit i-th, if present ...
9a3eedi's user avatar
  • 2,109
4 votes
2 answers
806 views

I need help help for defining mutation operator for traveling salesman problem. I'm currently using this now (pseudocode): mutate ( strand ): for n in random_interval ( min_gene_index, ...
Jossi's user avatar
  • 153
2 votes
2 answers
763 views

I'm trying to solve a algorithmic contest's problem. I have a matrix 2000x2000. I want to represent it as graph and traverse it with BFS/DFS. I have time limits on app running (2s). Simple vertices ...
Michael Z's user avatar
  • 123
7 votes
3 answers
1k views

I am currently working on a project inspired by the Ticket to Ride board game. This board game is played on an undirected graph where each vertex represents a city and each edge represents a ...
sadakatsu's user avatar
  • 109
6 votes
1 answer
1k views

I have a graph in which each node is a geographical point on the surface of the earth, defined by it's latitude / longitude coordinates. Correct ways to calculate the distance between two such points ...
Tiborg's user avatar
  • 293
0 votes
1 answer
2k views

I am given a set of tourist attractions(nodes identified by x, y) and i need to find the shortest path to visit them. The way i thought of it, is i will ignore if there are streets available and ...
SummerCode's user avatar
5 votes
1 answer
210 views

A little explanation might be needed. I mean mutual credit the way that it's defined here: a type of alternative currency in which the currency used in a transaction can be created at the time of ...
Greg's user avatar
  • 389
0 votes
1 answer
829 views

I came across this one problem, There is a particular sequence only uses the numbers 1, 2, 3, 4 and no two adjacent numbers are the same. Write a program that given n1 1s, n2 2s, n3 3s, n4 4s will ...
dharakk's user avatar
1 vote
1 answer
2k views

In an n-ary tree... Given a reference to some child node And a reference to a distant parent of the referenced child node Is there a method that a parent node can use to figure out which of its ...
Eric's user avatar
  • 113
1 vote
2 answers
5k views

I have written a program to solve a special puzzle, but now I'm kind of stuck at the following problem: I have about 3200 points/nodes/dots. Each of these points is connected to a few other points (...
e4ch's user avatar
  • 11
3 votes
4 answers
7k views

I am trying to find the shortest possible path that visits every node through a graph (a node may be visited more than once, the solution may pick any node as the starting node.). The graph is ...
Boluc Papuccuoglu's user avatar
1 vote
1 answer
653 views

The purpose of the algorithm is to create n routes on a geographical map, where n is being given, whereas all routes take no longer than t time units by foot and end where they start, while trying to ...
Timo Theobald's user avatar
3 votes
1 answer
3k views

Tarjan's algorithm for finding bridges in a graph is found here: http://en.wikipedia.org/wiki/Bridge_(graph_theory)#Tarjan.27s_Bridge-finding_algorithm. However, I don't understand the condition for ...
Lawrence's user avatar
2 votes
1 answer
1k views

We are given an array of integers where all elements are between 0-9. have to start from the 1st position and reach end in minimum no of moves such that we can from an index i move 1 position back and ...
user45957's user avatar
12 votes
1 answer
503 views

I have created a DIFF implementation to compare document revisions at work. It is based on An O(ND) Difference Algorithm and Its Variations. One thing that has become important is to take the list ...
ptpaterson's user avatar
22 votes
4 answers
44k views

It seems to me like pre-order traversal and DFS are same as in both the cases we traverse from root till the left branch and back to root and then to the right branch recursively. Could any please ...
Srikanth Kandalam's user avatar
7 votes
6 answers
9k views

I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at ...
Srikar Appalaraju's user avatar
0 votes
2 answers
2k views

I would like to write an algorithm which can traverse a graph and hopefully later I can implement it to use for an indoor navigation system. The graph would come from floor plans of a building and ...
NKK's user avatar
  • 21
2 votes
2 answers
910 views

Which of the following options take less processing time/is less expensive in a graph traversal algorithm for a (indoor)navigation system? a) To produce all possible paths between start and ...
NKK's user avatar
  • 21
3 votes
2 answers
4k views

I thought I was doing breadth-first graph search correctly, but my instructor's grading script is telling me that my answer is incorrect. From the instructions: Consider a breadth-first graph ...
user93172's user avatar
7 votes
4 answers
373 views

I am trying to solve the following kind of problem. I do not know if there is already a name for this, or a solution; however, I'm willing to bet there is. I was hoping someone could point me in the ...
Serge's user avatar
  • 173