Question: 1. Using Python, create a script to find the shortest path from point S (start) to point G (goal) through a discretized workspace (6

1. Using Python, create a script to find the shortest path from

1. Using Python, create a script to find the shortest path from point S (start) to point G (goal) through a discretized workspace (6 rows by 12 columns) such as this ("." designates a cell of free space, "X" represents a cell fully occupied by an obstacle). Use 4-connectivity (research the subject of connectivity, e.g., here): X X X X X X X X X X X X 2. Find a way to visualize the calculated path, including the path length, with the final state of the wave expansion. 3. Change to 8-connectivity, recalculate, visualize, and interpret the results. 4. Modify the code so that the coordinates of "S" and "G" are randomly generated (obviously, the locations of those cannot be in the obstacle area). Run this simulation in a loop. At the end of each simulation, display the path. For the sake of the exercise, repeat the loop just three times. Either connectivity (4 or 8) is acceptable. For simplicity, you can restrict randomly generated "S"s to the left half and "G"s to the right half.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve the problem well use the A algorithm to find the shortest path from the start point S to th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!