Question: Problem 1. (20 pts) Given a graph G (directed or undirected) it's 2-closure is the graph H such that V(H) = V(G) and for any

 Problem 1. (20 pts) Given a graph G (directed or undirected)

Problem 1. (20 pts) Given a graph G (directed or undirected) it's 2-closure is the graph H such that V(H) = V(G) and for any two nodes u, u E V(H) we put an edge if in G we have that u is reachable from u by a path of length 1 or 2. (Therefore, it is clear that any e E E(G) will remain an edge also in E(H).) (a) (10 pts) Give a deterministic algorithm that takes as an input a graph G with max-degree of in the adjacency list model and outputs its 2-closure in O(n2)-time. Note: our construction of a Hash-Table, for example, is inherently random (b) (10 pts) Give an algorithm that takes as an input a graph G in the adjacency matriz model and outputs its 2-closure in o(n)-time Hint: We call it an adjacency matrix for a reasoin

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!