Questions tagged [graph-traversal]

Graph traversal is the problem of visiting all the nodes in a graph in a particular manner, updating and/or checking their values along the way.

Two famous graph traversal algorithms are:

See also:

324 questions
0
votes
2 answers

How can I do this graph traversal?

I have a Directed Cyclic graph consisting of node a, b, c, d, e,f g, where ever node is connected to every other node. The edges may be unidirectional or bidirectional. I need to printout a valid order like this for eg. f->a->c->b->e->d->g such that…
user2316569
  • 343
  • 2
  • 8
0
votes
1 answer

The Widest Path Challenge - the most efficient way for finding path in Maximal Spanning Tree

This question is continuation of my similar earlier asked question: Find path between two nodes in graph, according to given criteria - optimization task . Problem summary: I need to find the best path in graph from vertex A to vertex B, with…
0
votes
1 answer

Sharing highly irregular job among CUDA threads

I’m working on some task related to graph traversal (Viterbi algorithm) Each time step I have a compacted set of active states, some job is done in each state, and than results are propagated through outgoing arcs to each arc’s destination state and…
0
votes
1 answer

Printing all elements of graph one by one in python

I tried to traverse a graph in this algorithm in python. What Changes should I make if I want to print all elements of graph one by one or traversing the whole graph. Any help will be very much appreciated. Thanks. grapth={'A':…
0
votes
1 answer

how many hops does it take?

Im searching for information on an experiment where it was determined how many hops it would take for a message to theoretically reach everyone on Earth (i.e. 8 billion). So if every reciever would forward the messae to X contacts, it would…
TeaOverflow
  • 2,319
  • 3
  • 22
  • 35
0
votes
1 answer

does creating order of adjacency list affect the searching performance?

I'm working on graphs and traversal techniques. However, i have a question about adjacency list. As you know in adjacency method you declare an array or a list for each vertex which keeps adjacent vertexes. So my question is "does adding order of…
0
votes
1 answer

Discover All Paths in Single Source, Multi-Terminal (possibly cyclic) Directed Graph

I have a graph G = (V,E), where V is a subset of {0, 1, 2, 3, …} E is a subset of VxV There are no unconnected components in G The graph may contain cycles There is a known node v in V, which is the source; i.e. there is no u in V such that…
inspectorG4dget
  • 97,394
  • 22
  • 128
  • 222
0
votes
1 answer

Detecting unusual path patterns in a gigantic directed graph

I have a gigantic directed graph (100M+ nodes) of nodes, with multiple path instance records between sets of nodes. the path taken between any two nodes may vary, but what I'd like to find are paths that share multiple intermediary nodes except for…
Loki
  • 5,895
  • 4
  • 22
  • 35
0
votes
1 answer

Node-level graph-style traversal visualisation?

I am looking for a JavaScript library which can do node-level traversal of a graph. The most similar thing I could find (to help explain what I want) is ThinkMap, which is used by visualthesaurus. Basically starting from a single circular node…
0
votes
2 answers

How to replace node ids with their respective properties?

I am using Neo4j for graph database, and using Java to extract the path from it. I have a path as follows: [(3)--[KNOWS,5]-->(4)--[KNOWS,6]-->(5)--[KNOWS,9]-->(6)--[KNOWS,10]-->(7)--[KNOWS,12]-->(9)] I want to replace the node ids in the path with…
0
votes
2 answers

Finding a path in a 2d grid and returning all matched nodes

Say I have an rows*columns grid, and each node on the grid has an integer (state) value. state[NUMBER_OF_ROWS][NUMBER_OF_COLUMNS] If the value of state[row][0] == state[row][NUMBER_OF_COLUMNS -1] I want to check if there is a "path" consisting of…
0
votes
1 answer

Displaying Depth-First Search Graph Traversal C++

I am working on traversing a graph which I have set up as a class, using vectors to store the vertices and edges. I am using a Depth-First Search on the graph to show paths as it is traversed, but I would like to somehow get my code to display the…
Norm
  • 31
  • 1
  • 7
0
votes
2 answers

What is the maximum number of nodes I can traverse in an undirected graph visiting each node exactly once?

So I have an un-directed un-weighted graph. It contains cycles. I would like to find the path which visits the most nodes with no repeat visits to any node. Since this is a graph traversal, you can start and end at any node you like. Background…
Chirayu Shishodiya
  • 546
  • 1
  • 7
  • 14
0
votes
1 answer

Traversal of directed acyclic weighted graph with constraints

I have a directed acyclic weighted graph which I want to traverse. The constraints for a valid solution route are: The sum of the weights of all edges traversed in the route must be the highest possible in the graph, taking in mind the second…
0
votes
1 answer

Lowest cost path of a graph

I am working on a problem which drills down to this: There is a connected undirected graph. I need to visit all the nodes without visiting a node more than once. I can start and end at any arbitrary node. How can I go about this? Shall I apply…
bdhar
  • 17,821
  • 16
  • 62
  • 84
1 2 3
21
22