I have an Edge class which stores: source (vertex), target (vertex) and weight.
I have a Vertex class which stores: name, x-coordinates, y-coordinates, and Edge[] adjacentList.
I also have a Graph class which stores two ArrayLists: edges and vertices.
Currently when a vertex/node and edge is plotted it is automatically added to the vertices and edges list respectively.
Now I would like to fill the Edge[] adjacentList using these two array lists but I am not sure how to do this. I would appreciate it if someone is able to give me pointers or an outline of how the code would look like.
Thank you.