Adjacency List Algorithm. Therefore, iterating over all vertices’ neighbors and updating