All Questions
Tagged with pathfinding python-3.x
16 questions
5
votes
5
answers
1k
views
Faux Random Maze Generator
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....
6
votes
3
answers
535
views
The shortest path between airports
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 ...
1
vote
0
answers
385
views
Directed graph and Dijkstra algorithm using heap
I have implemented directed graph and Dijkstra algorithm using heap in Python.
I first implemented an abstract base class WeightedGraph, of which ...
10
votes
2
answers
1k
views
Path finding solution for a maze whose state changes during the solve
This is not a traditional maze where you find the shortest path (like the gif on the left). In order to solve it, you need to visit every available node before reaching the end, where once a node is ...
7
votes
2
answers
3k
views
Find the closest enemy in a 2D grid with wrapping allowed
I'd like feedback on my solution to the outlined programming challenge. Is numpy a good candidate module for this? What might be a more efficient or Pythonic solution?
Closest Enemy II
Have the ...
8
votes
1
answer
2k
views
Speeding up Dijkstra's algorithm
I have Dijkstra's algorithm:
...
7
votes
2
answers
6k
views
Find the correct path through a 5 x 5 grid (coderbyte 'Correct path')
I've completed the following coderbyte question and would like feedback as to whether it follows Python best practices, is efficient and so forth.
The coderbyte problem:
Have the function ...
7
votes
1
answer
290
views
Random Maze Pathfinder
I just finished a huge project of mine; a maze pathfinder. At the start, the maze that the program is traversing is randomly generated, with a 25% change to place a wall (...
5
votes
1
answer
786
views
Shortest pathway across a snakes and ladders board (Update)
Earlier I posted a fairly inefficient recursive solution to the problem of getting across a snakes and ladders board in the smallest number of moves.
I have created a much faster solution to this ...
7
votes
1
answer
2k
views
Python program to find a word ladder transforming "four" to "five"
I saw this Puzzling problem and thought I would try to write a Python program to solve it. The task is to transform "four" to "five", forming a new four-letter word at each step, replacing one letter ...
3
votes
0
answers
195
views
Lowest cost path through elements in a matrix
I've developed a program in Python that calculates the lowest possible costing path between two points in a matrix, including the values contained in the start and finish cells. The code is below. ...
2
votes
1
answer
585
views
Python A Star with fewest turns and shortest path variations
I had a lot of fun writing these. I haven't seen a version minimizing turns, so that was a neat challenge. Any suggestions are very welcome.
Is there anything to gain by making more method variables ...
4
votes
1
answer
6k
views
2D Maze solver using recursion in Python
A company I interviewed for sent me a coding problem to solve. The problem was to find a solution to a maze, not necessarily the shortest one. The input would be like so:
...
10
votes
2
answers
2k
views
2D grid Hamiltonian path puzzle solver
The puzzle goes like this: in a rectangular 2D grid there are empty spaces (.), exactly one starting point (S, ...
5
votes
1
answer
1k
views
Pathfinder from image file
I've created a simple pathfinder programme that receives its input from a very small .png file.
Example file here:
Here's a link to the file (note that the green pixel represents the start, the red ...