[PYTHON] A* Pathfinding Python randomly failing

Question:
I have an *A start path finding algorithm I’m trying to make. It works like 90% of the time but then fails randomly and I can’t figure out why.
Repl link:
https://replit.com/@InvisibleOne/PathFinder#main.py

Some images of it failing


1 Like

Solved. I found the bug in my code.

When finding the neighbors for each node I was discarding neighbors if their value was a string (Which I use to specify start and end nodes)

2 Likes

:skull: you know I’m probably the only other person here who does advanced algorithms so most of the forum wouldn’t be much help

I’m only experienced in cryptographic-hashing/encryption alg’s.

1 Like

yeah I specialize in advanced CS basics (?) like advanced CS but like… you know… the “standard” course nothing special like cryptography

How would you know you are the only one? Is pretty arrogant to say.

2 Likes

not really :laughing: because I know almost all active members don’t do it :stuck_out_tongue: idk about you since you’re not as active but I know the 10 active members specialize in ML/webdev

Pretty sad if all there is here is 10 active users.

1 Like

? I don’t really understand the point but OK XD :smiley:

what algs have you made :0

1 Like

um I’m not super good but I know DP, MST, Dikjstra’s, DFS/BFS, and Floyd-warshall (hare-tortoise)

idek what any of those are lmaoooo

1 Like

@InvisibleOne you should make a maze generator (creates giant mazes instead of these small obstacles) and have this solve it/have the player solve it and script solve it to show solution…
Collab maybe? :slight_smile:

1 Like

Those are just the names of different algo’s, the one I’m using here is called A* it’s a faster version of Dikjstra’s that uses distance to the goal to help weight the algo’s decisions. A* only works when you are looking for a single target though, just plain ole dikjstra’s can search for multiple

1 Like

I already have a dungeon generation algorithm I’m going to use this on, I just have to tweak the algo a bit and add some weights.

1 Like

I know I didn’t list A* because I don’t know it yet :sob:

EDIT: just noticed that you didn’t like any of my posts :sob:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.