First, I would like to make sure I got the structure correct. As far as I know, an adjacency list representing a graph looks like this:
AdjList is an ArrayList, where each element is an object. Each object contains an ArrayList inside to represent vertices connected. So for example, in the image above, Vertext 1 (first index in the AdjList) is connected to the vertex at index 2, 4, and 5 of the AdjList. Is this representation of an adjacency list correct? (ps: I know indices start at 0, i put 1 here for simplicity/ease).
If it is correct, which algorithm should I use to find the shortest path between two vertices?