Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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....
Ben A's user avatar
  • 10.8k
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 ...
KermitTheFrog's user avatar
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 ...
user141240's user avatar
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 ...
alec's user avatar
  • 109
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 ...
Dave's user avatar
  • 753
8 votes
1 answer
2k views

Speeding up Dijkstra's algorithm

I have Dijkstra's algorithm: ...
Alexey's user avatar
  • 183
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 ...
Dave's user avatar
  • 753
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 (...
Ben A's user avatar
  • 10.8k
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 ...
MrJoe's user avatar
  • 2,163
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 ...
Alex F's user avatar
  • 443
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. ...
MrJoe's user avatar
  • 2,163
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 ...
Paul K's user avatar
  • 413
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: ...
Apoorva Vinod's user avatar
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, ...
shooqie's user avatar
  • 201
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 ...
user2635139's user avatar

15 30 50 per page