In an unweighted graph G:
Mij>0 indicates that there is a path of length 1 between vertex i and vertex j.
Pij=(M2)ij>0 indicates that there is a walk of length 2 between vertex i and vertex j.
Thus, an edge (i,j) exists in graph G2 if and only if the shortest path distance between i and j in G satisfies 1≤dG(i,j)≤2.
For any two vertices u,v∈V, let dG(u,v)=k be the shortest path distance between them in G. Along this shortest path of length k, we can jump up to 2 edges per step in G2. Therefore, the shortest path distance between u and v in G2 satisfies:
dG2(u,v)≤⌈k/2⌉=⌈dG(u,v)/2⌉ Taking the maximum over all pairs u,v∈V:
diam(G2)=u,v∈VmaxdG2(u,v)≤u,v∈Vmax⌈2dG(u,v)⌉=⌈2diam(G)⌉ Hence, diam(G2)≤⌈diam(G)/2⌉, which matches Option (A).