Search - 2 Computation cost 1 - Computation cost 2

Suppose we live in a discrete world, the world we're going to program,

For simplicity we assume the world is divided into small grids and our initial position is in blue

At the square, it moves upward, and the small arrow indicates its direction.

We want the vehicle to go from the starting point to the ending point, and every time it moves a square or performs a turn, it needs to be

Costs one unit. So what is the minimum total cost to incur from start to finish?

 

Requires 6 grids to move and one turn so the total cost is 7.

Now let me change the motion model to another one, we have 3 motion modes, go straight, turn left to go forward, and turn right to go forward. in these sports

I will take one step forward, let's assume that these actions all take 1 time

What is the total cost of the best route to the destination now?

 

y is one step less than the previous question because it took one step forward when turning left.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324833187&siteId=291194637