Dijkstra Algorithm view (Node, Edges)

Your Node class should keep track of where that Node is.

Your array (or arrayList, probably) of Nodes has all your Nodes in it.

When you get a mouse click, you can use a loop over your array of Nodes to see if that click was near the position of any of them.

1 Like