Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
2 replies
34 views

I'm in college learning about DFS and BFS. I knew about this before, although what's throwing me in a loop is DFSVisit. I just want to know what's the difference between DFS and DFSVisit. Is DFS just ...
Johanna's user avatar
3 votes
3 answers
111 views

Consider this traversal algorithm in pseudocode: Traverse(G, v): S is stack stack.push(v) label v as visited while S is not empty: v = S.pop() for all w in G....
lc_vorenus's user avatar
3 votes
1 answer
156 views

I have an interesting problem but cannot find the relevant literature, so need algorithem suggestions or just the correct way to phrase the problem so I can find the literature. I'm given a vector of ...
Edgar H's user avatar
  • 1,559
2 votes
1 answer
111 views

I have undirected connected graph with one main node (denoted by M in examples below). I am trying to find efficient algorithm to following specification: input is set of edges (denoted by thick ...
Tomáš Záluský's user avatar
0 votes
0 answers
62 views

Suppose 3 sets of nodes, each corresponding to a distinct set in an undirected graph: Set-A = {1, 2, 3, 4, 5} Set-B = {6, 7, 8, 9, 10} Set-C = {11, 12, 13, 14, 15} The graph is defined by ...
Honoré De Marseille's user avatar
0 votes
0 answers
37 views

I have a Neo4j 5.26 database with graph (minimized example): CREATE (x1:L {id:1})-[:R]->(x2:L {id:2})-[:R]->(x3:L {id:3}) -[:R]->(x4:L {id:4})-[:R]->(x5:L {id:5}) and some ...
Tomáš Záluský's user avatar
2 votes
1 answer
145 views

I am trying to create a path planning algorithm for a robotic mower to cut all the grass in a defined area while avoiding obstacles or restricted areas. I am using the Python Shapely library to define ...
Tomasm64's user avatar
5 votes
5 answers
319 views

I marked my answer as the answer because it is the one that is doing what I was wanting and anyone wanting to do the same thing should start there. But I would love to see a better answer (order of ...
smichr's user avatar
  • 19.6k
2 votes
1 answer
265 views

Is it true that there are no back edges and no forward edges in a BFS of an undirected graph? I feel this is incorrect. Here is my counterexample (graph is represent using adjacency list): 0 : 1 ...
Infinite's user avatar
  • 131
0 votes
1 answer
49 views

Is it possible to dynamically construct a WITH statement? I have to do a graph traversal, but I don't know in advance which collections contain the graph nodes. I have tried to create the statement ...
Milko's user avatar
  • 43
0 votes
1 answer
76 views

I'm trying to traverse a graph (directed) where the edges have weights. How do I use the weights to define the order in which an edge is followed: the lower the weight (module of the weight to be ...
Lapin Chaman's user avatar
0 votes
1 answer
160 views

I have a postgres table with a 100K± records representing edges of graph (will grows even to 1M) defined as (I left the relevant parts only): CREATE TABLE public.collection_lineages ( id int8 NOT ...
Elad Aharon's user avatar
-1 votes
1 answer
50 views

Each node in the above graph has been numbered. I am trying to find the graph traversal algorithm that can be used to number the graph in this order. Appreciate if anyone can suggest an algorithm that ...
Isuranga Perera's user avatar
0 votes
1 answer
48 views

I have written the below AQL shortest path traversal query to find the shortest paths from a set of start vertices to a set of target vertices. In the output I would like a consolidated result. ...
Bikas Katwal's user avatar
  • 2,064
0 votes
0 answers
131 views

Title: Finding the Maximum of Minimum Costs in a Modified Kruskal's Algorithm Question: I'm working on a graph problem where I need to find the maximum of the minimum costs starting from a specific ...
Anon's user avatar
  • 1
1 vote
0 answers
37 views

I am implementing a new approximation algorithm for finding the longest simple path in a directed, unweighted graph from a starting node s to a destination node t. I would like to compare my algorithm'...
Thomas's user avatar
  • 11
1 vote
1 answer
74 views

I am trying to solve LeetCode problem 590. N-ary Tree Postorder: Given the root of an n-ary tree, return the postorder traversal of its nodes' values. I made code considering each condition. I ...
my_first_step's user avatar
1 vote
1 answer
154 views

I'm working with ArangoDB and have a graph traversal scenario where I need to skip a specific node based on a property, but still infer an indirect connection (edge) between two other nodes. My graph ...
Shahar Shokrani's user avatar
0 votes
1 answer
89 views

I'm using bfs and iddfs to find the optimal solution of the 8 tile puzzle, however, my IDDFS is missing solutions and i'm not sure why. ive checked and it seems that every node visits all it's sons, ...
Ofekino97's user avatar
0 votes
1 answer
44 views

I trying to print all the paths in a mxm matrix which terminate if I visit an already visited node. I have tried a recursive solution but i am not sure how to handle the base case def is_valid_move(x, ...
lcp's user avatar
  • 1
0 votes
0 answers
82 views

I am thinking about the problem of detecting cycles in lisp lists (based on cons cells). Traditional cycle detection algorithms like Floyd's (Tortoise and hare) or Brent's algorithm all assume that ...
Prgrm.celeritas's user avatar
0 votes
1 answer
88 views

I have a (acyclical) directed graph, which I want to traverse in the right order. The arrows indicate dependencies - a node should only be visited if all previous nodes are already visited. I tried ...
Sventies's user avatar
  • 2,826
0 votes
1 answer
21 views

I have a very large graph. My objective is the following: Return pathways related to the target 'GIPR' and also related to compounds. Where the compounds are related to the disease 'Leukemia' My ...
Guillermo Guells's user avatar
1 vote
0 answers
32 views

Can you give me adjacency list of a graph whose BFS and topological sort are not equivalent ? I visualze them the same way but googling if they both are same never quite provided a satisfactory ...
Mohak Gupta's user avatar
1 vote
0 answers
211 views

What are the details of your problem? Why is Tinkerpop-Gremlin AnonymousTraversalSource finding ArcadeDB unavailable? I looked at log/arcadedb.log.x files but they're empty. And the Log4j2 logs also ...
Zach's user avatar
  • 765
0 votes
2 answers
262 views

Is there a way to just drop() all of the Vertexes in JanusGraph like OrientDB? g.V().drop().iterate() takes about 2 minutes to traverse through 70005 basic vertices. JanusGraph's JanusGraph (interface)...
Zach's user avatar
  • 765
1 vote
1 answer
161 views

I am trying to run multiple instances of a shortest path algorithm, for independent pairs of nodes in a graph. The algorithm internally uses the bfs method, which is "sandboxed" (self-...
kil47's user avatar
  • 85
0 votes
1 answer
509 views

Problem How do you connect to an external JanusGraph Server with JanusGraphFactory? I don't know what I'm doing and new to JanusGraph and Graph-Databases in-general. What is the JanusGraph > ...
Zach's user avatar
  • 765
0 votes
2 answers
437 views

I have an undirected and unweighted graph with about a million nodes - visualized in a matrix format. Representation of a sample graph: The red cells are blocked. My problem is to find the shortest ...
kil47's user avatar
  • 85
0 votes
1 answer
183 views

In the game EVE Online there is a map with systems, these systems can be traversed by gates or jump drives but there are some limitations: If the system is in range (jump drives have a max range ...
Jamie's user avatar
  • 724
3 votes
1 answer
217 views

#Breadth First Search graph = { 'S' : ['A','B'], 'A' : ['B','C','D'], 'B' : ['C'], 'C' : ['D'], 'D' : [] } visited = [] queue = [] goal = 'D' def bfs(visited, graph, node): ...
vernonnn's user avatar
0 votes
1 answer
214 views

I have the following graph: https://gremlify.com/vxkibjtoz3b if u can't open the link the graph is lloking the following: You can see there 2 queries. The first one: g.V().out("r").as("...
Ste fan's user avatar
  • 31
1 vote
0 answers
390 views

I have been able to find the number of subgraphs in a collection using the below query, after much trial and error and documentation consultation. It seems to work ok. It's crafted to work in the ...
Robin Bruce's user avatar
-2 votes
1 answer
91 views

I recently wrote a function to traverse a graph, along those lines: def traverse(batch: list[str], seen: set[str]): if not batch: return new_batch = [] for node in batch: ...
Weier's user avatar
  • 1,439
0 votes
0 answers
97 views

This is more a theoretical question because I can see this question being asked in an exam. Assuming we have a directed graph G(V,E) with |V| = 10 and we want to know the shortest path from S to all ...
thestudi's user avatar
0 votes
1 answer
86 views

I create a digraph of 14 nodes using the Networkx module. I am getting the same output paths irrespective of changing distances when using the in-built functions. Assume the weights are as follows for ...
knowledge_seeker's user avatar
0 votes
1 answer
490 views

I've seen the following code to traverse a graph depth first, in Scala: def dfs(node: Node, seen: Set[Node]) = { visit(node) node.neighbours.filterNot(seen).foreach(neighbour => dfs(node, ...
Weier's user avatar
  • 1,439
1 vote
1 answer
407 views

Intended Function of code: Takes a user input for the volume of 3 jars(1-9) and output the volumes with one of the jars containing the target length. jars can be Emptied/Filled a jar, or poured from ...
zburner's user avatar
  • 13
1 vote
1 answer
219 views

We have an allocation problem: each node is a fuel source, and every edge contains a number of evenly spaced out lamps (think of them as being 1 m apart from each other). Each fuel source can power ...
GalBrot's user avatar
  • 35
-1 votes
2 answers
105 views

We have an undirected acyclic graph where there is only a single path between two connected nodes that may look something like this. Simple guide to the image: Black numbers: Node id's (note that ...
John Smith 's user avatar
0 votes
0 answers
44 views

I've created a query to return all "descendant" edges and vertices for a particular queried vertex. The query works, but it duplicates edges and vertices with each iteration of the repeat ...
N-ate's user avatar
  • 7,123
2 votes
1 answer
558 views

I'm new to Golang and need to find an analog to org.apache.tinkerpop.gremlin.tinkergraph.structure. TinkerGraph to use gremlin methods for traversing embedded graphs without connection to graph ...
Alex_v8's user avatar
  • 23
0 votes
1 answer
440 views

A DFS starting at some vertex v explores the graph by building up a tree that contains all vertices that are reachable from v and all edges that are used to reach these vertices. We call this tree a ...
mimmolg99's user avatar
0 votes
2 answers
556 views

I'm looking for an algorithm to find the longest path through an edge weighted tree. The graph is acyclic and connected, but not directed and only sparsely connected, doesn't have a defined start ...
yowiee's user avatar
  • 1
-1 votes
2 answers
406 views

Background Looking to trace a path between two points on a hexagonal grid while following the nearest edge. Problem Determining the algorithm to constrain the all iterations after the first one to the ...
Dave Jarvis's user avatar
  • 31.3k
4 votes
1 answer
87 views

I have this traversal: TraversalDescription td = graph.traversalDescription() .depthFirst() .relationships(RelationshipTypes.CHILD, Direction.INCOMING) ....
rabolfazl's user avatar
  • 562
1 vote
1 answer
368 views

How can I determine whether selected nodes on a graph are directly connected? I think, I need to calculate paths for each selected node to all of the other selected nodes. Then, when I have the path, ...
feerlay's user avatar
  • 2,668
0 votes
1 answer
290 views

In an undirected graph the running time of BFS is O(m+n). Is it possible to get a running time of O(m) in a directed graph? (|V|=n, |E|=m)
andy's user avatar
  • 101
0 votes
1 answer
483 views

I have a case of scenario that there are TOURIST who wants to travel and every country has VISA control and there is a path along countries so some of connections you are not allowed to visit that ...
Winslet's user avatar
1 vote
1 answer
58 views

I'm trying to implement a Directed graph in python by creating a class Vertex. A vertex has the name and the adjacent as a list containing another instance of class Vertex . below is the code. The ...
dumb dirty's user avatar

1
2 3 4 5
8