Let's say I find a way in the house using the A * algorithm. Now the run time can be O (n ^ 2).
I was wondering if the performance would improve if I found out which doors to follow, and accordingly I would use A * on it, i.e. if I have a starting position S and an ending position like F , and instead of applying A * on these two endpoints, it would be better if I applied A * on
`S` and `A1` `A1` and `A2` `A2` and F.
Where are A1 and A2 - my intermediate (doors) to be followed for the shortest path? Would it be useful to improve the search for intermediate elements, and then follow the path, and not just apply A * directly at startup and completion.
Given that searching for intermediate elements requires linear time.
user1868357
source share