For starters, this code should use a Point class, consisting of an x and y location. Your variable points would then be Point rather than a two dimensional array. The Point class should have a method for reading values, printing values and calculating the distance between two points.
2 days ago · When comparing the distances, we don’t use an equality because this can be unstable for floating point values. The inequality produces the desired result, as long as no two entries of the word list are identical. Now, that our graph is set up, we’ll use a shortest path search to find the path between any two words in the graph: