Skip to main content

Questions tagged [pathfinding]

Pathfinding or pathing is the plotting of the shortest route between two points. It is a more practical variant on solving mazes. This field of research is based heavily on Dijkstra's algorithm for finding the shortest path on a weighted graph.

Filter by
Sorted by
Tagged with
1 vote
1 answer
111 views

(Refer to the entire repository in GitHub.) How it looks like Intro This time, I present my take on Jump point search that I translated from Javascript (PathFinding.js/src/finders/JumpPointFinderBase....
coderodde's user avatar
  • 32.3k
4 votes
1 answer
92 views

Intro (See the full repository here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as \$H = (X, E)\$, where \$X\$ is the set of vertices and \$E \...
coderodde's user avatar
  • 32.3k
4 votes
2 answers
144 views

Intro (Repo here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as \$H = (X, E)\$, where \$X\$ is the set of vertices and \$E \subseteq \mathcal{P}(X)\$...
coderodde's user avatar
  • 32.3k
0 votes
0 answers
62 views

Intro (See MostProbablePath.java.) This time, I elaborate on Computing most probable (reliable) path in a probabilistic graph (take II): instead of computing the most reliable path I now return \$k\$ ...
coderodde's user avatar
  • 32.3k
4 votes
1 answer
291 views

Intro A probabilistic graph \$G = (V, E)\$ is an undirected graph with weight function \$w \colon E \rightarrow [0, 1]\$. In the most reliable path problem we -- given two terminal nodes \$s \in V\$ ...
coderodde's user avatar
  • 32.3k
1 vote
0 answers
64 views

Intro Still working on PathFinding.java. This time I concentrate on three private methods of GridModel that are responsible for generating random perfect mazes. A maze is perfect if for each two cells ...
coderodde's user avatar
  • 32.3k
0 votes
0 answers
23 views

Intro I am still working on PathFinding.java. This time I need to get reviewed the class responsible for choosing the heuristic function, the finder implementation, just to mention a few of settings ...
coderodde's user avatar
  • 32.3k
4 votes
1 answer
137 views

Intro I am currently working on this project (PathFinding.java). This time, I need to get the following class reviewed: Code ...
coderodde's user avatar
  • 32.3k
1 vote
0 answers
71 views

Intro I have this GitHub repository for doing pathfinding in directed unweighted graphs. This post is about BIDDFS proposed by Richard Korf in his paper. Code ...
coderodde's user avatar
  • 32.3k
1 vote
0 answers
40 views

Intro I have this GitHub repository containing some iterative deepening pathfinding algorithms. Code ...
coderodde's user avatar
  • 32.3k
3 votes
1 answer
86 views

This is a part two. The problem originates from here, it is solved for \$n<11\$. A GitHub repository for this code, printing paths, and a collection of all proven best paths, it is open to ...
tomka700's user avatar
  • 203
7 votes
1 answer
756 views

The goal is to brute force the length of the shortest unrestricted path that touches any part of each square within an n by n square grid. Unrestricted path meaning any continuous curve between two ...
tomka700's user avatar
  • 203
5 votes
5 answers
1k views

For a personal project, I've written a maze generator in Python that I will be using A* to navigate through (using C++). The biggest points of improvements I'm looking for are in the generation itself....
Ben A's user avatar
  • 10.8k
3 votes
1 answer
149 views

This program primary effort is the pathfinding of an 8x8 grid without the use of Java Collection Framework. The starting cell is at the top left corner and the end is the bottom left corner. All valid ...
Tuan Minh Tran's user avatar
0 votes
1 answer
238 views

...
Mubashir Waheed's user avatar
4 votes
1 answer
702 views

I would like to modify my shortest path finding code to use multithreading and improve its performance. The algorithm must be able to work with negative weights, and as a result, we cannot use ...
c.leblanc's user avatar
  • 263
6 votes
2 answers
354 views

I am trying to code an optimized version of Bellman-Ford algorithm. This post is a continuation of the following post Bellman-Ford optimisation in C in which I posted a first version of the classic ...
c.leblanc's user avatar
  • 263
6 votes
2 answers
2k views

Here is my current code: ...
c.leblanc's user avatar
  • 263
5 votes
2 answers
1k views

...
FailingCoder's user avatar
1 vote
0 answers
194 views

I have a problem that needs path finding to solve. It is a vector of ints; 1 for passable terrain and 0 for non-passable. My implementation is not fast enough for the test. How could I make it faster? ...
Isak True's user avatar
1 vote
2 answers
243 views

I am trying to use Dijkstra to find the cheapest path between two pixels in an image. Implementation: ...
user877329's user avatar
2 votes
2 answers
454 views

On input i get width and height of matrix, string of text and another string of finalText I want to reach. The characters of the first string are assigned to matrix. My goal is to find shortest way to ...
Levyi's user avatar
  • 21
5 votes
0 answers
210 views

I have this Perl module project. My implementation of the Dijkstra's algorithm follows: ...
coderodde's user avatar
  • 32.3k
6 votes
3 answers
551 views

Airlines need to provide their customers with flights to every corner, so they need an app that allows them to do so. The customer must be able to transfer when there is no direct connection. The ...
KermitTheFrog's user avatar
3 votes
1 answer
209 views

I have this CLion project on GitHub. It constructs a directed, weighted graph consisting of 100 thousand nodes and 500 thousand directed arcs, picks two random nodes, and computes the shortest paths ...
coderodde's user avatar
  • 32.3k
2 votes
1 answer
125 views

So, I needed a priority queue for D* lite and I wanted to know whether this is an acceptable implementation or not. ...
a a's user avatar
  • 157
4 votes
1 answer
397 views

I have followed some advice in the previous iteration, yet even the current version is too slow compared to the Java implementation of the same algorithm. (C++ version with ...
coderodde's user avatar
  • 32.3k
4 votes
1 answer
203 views

(See the next iteration.) I have this pathfinding algorithm: DirectedGraph.hpp ...
coderodde's user avatar
  • 32.3k
1 vote
1 answer
132 views

I have this Visual Studio 2022 project, in which I compared the performance of 4 point-to-point shortest path algorithms. This one presents the Dijkstra's algorithm: ...
coderodde's user avatar
  • 32.3k
2 votes
2 answers
500 views

Graph Interface: ...
GodLike's user avatar
  • 51
4 votes
3 answers
475 views

Here is my A* algorithm. I tried hard to implement it generically, but come up only with one idea to use lambdas for heuristic and next nodes (neighbours / successors) functions. I know that using ...
David's user avatar
  • 51
2 votes
1 answer
135 views

First post. I posted this on stack as well but somebody suggested I post it here too/instead. I wrote a shortest-path script for a Unity game project, and while it works, it gets so slow when applied ...
Colin's user avatar
  • 21
5 votes
3 answers
663 views

In a recent coding interview I was asked to write a program which takes as input two text lines: The first one represents a graph, formatted as a sequence of undirected edges like ...
InfiniteSnow's user avatar
1 vote
1 answer
389 views

I am trying to solve Google Foobar challenge prepare-the-bunnies-escape using my own approach, instead of BFS. I attempt to solve two ends of the maze and try to ...
Jeff Wu's user avatar
  • 146
2 votes
0 answers
125 views

This is my implementation of an AStar-like algorithm for maze solving. A quick summary of the problem I am trying to solve with my algorithm might be: A simple binary maze is given to you to solve, ...
ZeroMaxinumXZ's user avatar
2 votes
0 answers
77 views

I implemented the Dijkstra algorithm from scrath and wonder if I can save some code? The whole algorithm is here. n is the number of nodes, and m the number of edges. 1 ≤ 𝑛 ≤ 10^4, 0 ≤ 𝑚 ≤ 10^5, 𝑢 ...
Lerner Zhang's user avatar
3 votes
1 answer
849 views

I'm trying to solve the N-Puzzle problem using IDA* algorithm with a Manhattan heuristic. I already implemented the algorithm from the pseudocode in this Wikipedia page (link). Here's my code so far : ...
cuzureau's user avatar
  • 191
5 votes
1 answer
536 views

I have programmed a A* Pathfinding algorithm in the Console. I would now like to know if there are any things that I could do to improve the time it takes, to find a path. Right now it takes around ...
Pablu's user avatar
  • 59
8 votes
3 answers
2k views

Problem You are given an HxW matrix. Each element is either 0 (passable space) or 1 (wall). Given that you can remove one wall, find the shortest path from [0,0] (start) to [width-1, height-1] (end). ...
Martin's user avatar
  • 183
4 votes
1 answer
94 views

I have this task where I have to make my robot find the shortest way when I enter a destination point. I've created some functions to assign numbers (distances) for each square and counts its way back ...
Mert's user avatar
  • 49
10 votes
2 answers
4k views

I have implemented Dijkstra's algorithm for my research on an Economic model, using Python. In my research I am investigating two functions and the differences ...
O.B.'s user avatar
  • 103
6 votes
1 answer
1k views

I have implemented Astar algorithm for a problem on an online judge relating to maze given start and end positions along with a grid representing the maze. I output the length of the path along with ...
V_head's user avatar
  • 575
5 votes
1 answer
208 views

I adding some pathfinding to a game I'm working on. It primarily used A* with as suggested in the pathfinding articles at reb blob games. It works, but isn't very fast. It is a square grid map that (...
cajomar's user avatar
  • 161
7 votes
2 answers
819 views

Yet another implementation of A* pathfinding. It is focused on: Performance (both speed and memory allocations). Readability and simplicity. Well defined objects and methods. Accordance with general ...
Xamtos's user avatar
  • 390
4 votes
2 answers
360 views

I am slowly creating a flow field pathfinding solution for Unity3D. I'm trying to follow Elijah Emerson's description, which appears in the book 'Game AI Pro' (volume 1). In this question I ask about ...
inappropriateCode's user avatar
3 votes
1 answer
126 views

I am slowly creating a flow field pathfinding solution for Unity3D. I'm trying to follow Elijah Emerson's description, which appears in the book 'Game AI Pro' (volume 1). The map is divided into ...
inappropriateCode's user avatar
4 votes
2 answers
658 views

I'm currently writing a small game in Lua, using the Love2d framework. I guess I'm doing it as a practice of sorts, but it did give me the opportunity to write my first pathfinding algorithm. I wrote ...
Rebecca's user avatar
  • 41
2 votes
1 answer
389 views

Problem For the given binary tree return the list which has sum of every paths in a tree. i.e Every path from root to leaf. I've written following solution. ...
Ashish Pawar's user avatar
1 vote
0 answers
393 views

I have implemented directed graph and Dijkstra algorithm using heap in Python. I first implemented an abstract base class WeightedGraph, of which ...
user141240's user avatar
5 votes
2 answers
123 views

I have the below code for a A* pathfinder, however it is taking upwards of 10 minutes to find a solution using a simple 1024 x 1024 array. I had to comment out ...
Ian Taylor's user avatar

1
2 3 4 5 6