path-finding

A* algorithm in python having trouble with making the final path

A* algorithm in python having trouble with making the final path Question: Full now working Code: https://docs.google.com/document/d/1j1BLe4L735nmXWR0Vnj3TeHumzI5x7Ea5yWJSc5j-8w/edit I tried to code the A* pathfinding algorithm and I got it to expand in the right way using the g and h costs. It looked really cool, however when I tried finding the final path by using …

Total answers: 1

change array consist of coordinate(x,y) to string

change array consist of coordinate(x,y) to string Question: i have path planning project with python and the result is array consist of coordinate(x,y) like this: [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (5, 2), (5, 3)] since I want to send that data to arduino to control the movement of …

Total answers: 2

Fast Pathfinder associative network algorithm (PFNET) in Python

Fast Pathfinder associative network algorithm (PFNET) in Python Question: I’ve been trying to implement a "Fast Pathfinder" network pruning algorithm from https://doi.org/10.1016/j.ipm.2007.09.005 in Python/networkX, and have finally stumbled on something that is returning something that looks more or less right. I’m not quite competent enough to test if the results are consistently (or ever, for …

Total answers: 2

How to find the shortest path between two coordinates in a 2-dimensional array?

How to find the shortest path between two coordinates in a 2-dimensional array? Question: I am trying to find the shortest way to get from one point in a 2D array (one coordinate with x and y values representing its position in the array) to another. I would like to output an array of coordinates …

Total answers: 1

Longest word chain from a list of words

Longest word chain from a list of words Question: So, this is a part of a function I’m trying to make. I don’t want the code to be too complicated. I have a list of words, e.g. words = [‘giraffe’, ‘elephant’, ‘ant’, ‘tiger’, ‘racoon’, ‘cat’, ‘hedgehog’, ‘mouse’] The idea of the word chain sequence is …

Total answers: 9

Finding shortest path in a cyclic weighted graph

Finding shortest path in a cyclic weighted graph Question: I am trying to find shortest path in a cyclic weighted graph. I have the following recursive function that is able to find shortest path between 2 points if they are not cyclic. For instance my graph looks like this: graph = { ‘A’: {‘B’: 5, …

Total answers: 1

Can I rewrite my expensive pygame functions in C?

Can I rewrite my expensive pygame functions in C? Question: Is it possible for me to find the expensive functions(for example, A* pathfinding) in my pygame game and rewrite them as extensions as outlined here? Is there a speed benefit to doing so? Is there a better (python) solution? I ask this question because I …

Total answers: 2