Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 25, Problem 1P

(a)

Program Plan Intro

To show that the updation procedure of transitive closer G * ( V , E *) of graph G ( V, E ) will take O ( V2 ) time, while an edge is added to the graph G .

(a)

Expert Solution
Check Mark

Explanation of Solution

Here, in the graph G , if the updation of transitive closure takes O ( V2 ) time. To understand this scenario, suppose, addition of an edge ( x1 , x2 ) is performed in the graph G . Now, take the set of vertices ( u, v ) in order to get the path from u to x1 and x2 to v . If there is a possibility of having an edge that contains vertices in such manner like ( u , x1 ) and ( x2 , v ).

Therefore, perform addition of an edge ( u, v ) in transitive closure only if the closure holds the edges in ( u, x1 ) and ( x2, v ) manner. So, the consideration of pair required only once and the total run time of this procedure will be O ( V2 ).

(b)

Program Plan Intro

To give an example that the update of transitive closer will take O ( V2 ) time, when a new edge ‘ e’ is added to the graph G .

(b)

Expert Solution
Check Mark

Explanation of Solution

Consider the condition where there aretwo strongly connected components with sizes | V |/2 and there is no common edge between them. The transitive closure can be computed by adding these two connected components of the graph.

Now, perform addition of a single edge between two connected components that provide connectivity between two separate components of the graph. Here, it is clearly visible that the total no. of edges will be increased by | V |/4 and the total no of edges will be [| V |/2 + | V |/4]. So, every time while adding a new edge required a constant time at least.

Therefore, the update of transitive closer will take O ( V2 ) time, when a new edge ‘ e’ is added to the graph G .

(c)

Program Plan Intro

To define an algorithm that takes O ( V3 ) time to update the transitive closure of graph G , when an edge is inserted in to the graph.

(c)

Expert Solution
Check Mark

Explanation of Solution

Consider a set of vertices in the graphG , and there is a path between every pair of vertices. Now, while performing an addition of an edge ( u, v ), look at the ancestor of vertex u and add it there. The reason of looking at the ancestor of an edge is to explore the branches of the tree. This procedure will also applicable for the vertex v. through this, it will be very easy to get the already added edges and will only consider those edges in n times mostly.

Since, the edges in the tree required O ( V2 ) time for consideration. Therefore, the total time taken by the algorithm will be O ( V3 ).

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
My professor went over the proof on this slide and I don't really understand it. Can you explain it in detail step by step?
In Computer Science a Graph is represented using an adjacency matrix. Ismatrix is a square matrix whose dimension is the total number of vertices.The following example shows the graphical representation of a graph with 5 vertices, its matrixof adjacency, degree of entry and exit of each vertex, that is, the total number ofarrows that enter or leave each vertex (verify in the image) and the loops of the graph, that issay the vertices that connect with themselvesTo program it, use Object Oriented Programming concepts (Classes, objects, attributes, methods), it can be in Java or in Python.-Declare a constant V with value 5-Declare a variable called Graph that is a VxV matrix of integers-Define a MENU procedure with the following textGRAPHS1. Create Graph2.Show Graph3. Adjacency between pairs4.Input degree5.Output degree6.Loops0.exit-Validate MENU so that it receives only valid options (from 0 to 6), otherwise send an error message and repeat the reading-Make the MENU call in the main…
Let T:V→V be the adjacency operator of the Petersen graph as illustrated in the enclosed file. Here Vis the vector space of all formal real linear combinations of the vertices v1,..,v10 of the Petersen graph. Question: compute the spectrum of the adjacency operator Tof the Petersen graph. What do you observe?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education