Why is the correct option D and not option B?

I am not able to understand how can we represent the undirected graph having n nodes using a vector of type int of size n+1