A-Star-Java-Implementation icon indicating copy to clipboard operation
A-Star-Java-Implementation copied to clipboard

Bug Fix

Open semenshestakov opened this issue 1 year ago • 1 comments

Problem

I noticed that on large graphs, where there are no obstacles, the algorithm checks many more points than necessary

Source

calculate Heuristic was considered relative to the indexes, and "g" relative to the length (int), which for HV = 10 (1.0), and for the diagonal 14 (square(2.0))

fix

in calculateHeuristic: ... this.h *= 10

Сurrent version: We explore too many routes

Screenshot 2024-09-19 at 23 39 10

with correction N1:

Screenshot 2024-09-20 at 11 02 37

with correction N2:

Screenshot 2024-09-20 at 11 03 43

semenshestakov avatar Sep 19 '24 21:09 semenshestakov