8. Consider modeling Facebook friendships by an undirected graph G (V, E), where V- a set of n vertices, each of which represents a Facebook user; and E isa set of edges, such that (4, u) E if and only if users u and u are Facebook friends. Let n IVI and m El. We want to compute an n-by-n matrix S, such that for all 1 if users t and uj are within 2 hops from each other in G, S.1-U10 otherwise. (a) (3%) what data structure will you use to represent G? Explain your choice. (b) (13%) Based on the data structure you used in (a), give an algorithm that conputes the matrix S. What is the complexity of your algorithm? (c) (10%) we want to perform friend-recommendation on Facebook. Specifically given a user u and a positive integer k, we want to return a set Fe(ui), such that v e Fe(u4) if and only if u and v share at least k common friends. Give an algorithm FriendRec(i, k) that returns the set F(u) 8. Consider modeling Facebook friendships by an undirected graph G (V, E), where V- a set of n vertices, each of which represents a Facebook user; and E isa set of edges, such that (4, u) E if and only if users u and u are Facebook friends. Let n IVI and m El. We want to compute an n-by-n matrix S, such that for all 1 if users t and uj are within 2 hops from each other in G, S.1-U10 otherwise. (a) (3%) what data structure will you use to represent G? Explain your choice. (b) (13%) Based on the data structure you used in (a), give an algorithm that conputes the matrix S. What is the complexity of your algorithm? (c) (10%) we want to perform friend-recommendation on Facebook. Specifically given a user u and a positive integer k, we want to return a set Fe(ui), such that v e Fe(u4) if and only if u and v share at least k common friends. Give an algorithm FriendRec(i, k) that returns the set F(u)