Adjacency list logic is much simpler.