Currently the graph positions the vertices at random. Each vertice is already generated with an x and y position and the heuristic cost is generated using the the straight line distance from each vertice to the goal. In order to have an accurate heuristic costs, the vertices need to be positioned at the provided x and y coordinates.
OR
Once the graph visualization is generated, get the coordinates and calculate the heuristic cost based on them.
Currently the graph positions the vertices at random. Each vertice is already generated with an x and y position and the heuristic cost is generated using the the straight line distance from each vertice to the goal. In order to have an accurate heuristic costs, the vertices need to be positioned at the provided x and y coordinates.
OR
Once the graph visualization is generated, get the coordinates and calculate the heuristic cost based on them.
https://js.cytoscape.org/#collection/position--dimensions