Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Question
Chapter 27.2, Problem 1E
Program Plan Intro
To analyse the work, span, and parallelism of the computation dag computing P-SQAURE-MATRIX-MULTIPLY on 2X2 matrices.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Modify the Chebyshev center coding with julia in a simple style using vectors, matrices and for loops # Given matrix A and vector bA = [2 -1 2; -1 2 4; 1 2 -2; -1 0 0; 0 -1 0; 0 0 -1]b = [2; 16; 8; 0; 0; 0]
A small sample:Let t_(l),t_(o),t_(m),t_(n),t_(t),t_(s) be starttimes of the associated tasks.Now use the graph to write thedependency constraints:Tasks o,m, and n can't start until task I is finished, and task Itakes 3 days to finish. So the constraints are:t_(l)+3<=t_(o),t_(l)+3<=t_(m),t_(l)+3<=t_(n)Task t can't start until tasks m and n are finished. Therefore:t_(m)+1<=t_(t),t_(n)+2<=t_(t),Task s can't start until tasks o and t are finished. Therefore:t_(o)+3<=t_(s),t_(t)+3<=t_(s)
Consider the graph shown in Figure 2 consisting of vertices 1, 2, .., 9. Construct a matrix
with 9 rows (one for each vertex) and 10 columns labeled k= 0, 1, 2, ..., 9. Fill the table with the
distance results of the Djikstra algorithm when running it on iterations k = 0, 1, 2,...,9. The source
vertex is 1.
Assume for an undirected graph with 6 vertices and 6 edges that a vertex index requires 3 bytes, a pointer requires 5 bytes, and that edge weights require 3 bytes. Since the graph is undirected, each undirected edge is represented by two directed edges. Calculate the byte requirements for an adjacency matrix.
Chapter 27 Solutions
Introduction to Algorithms
Ch. 27.1 - Prob. 1ECh. 27.1 - Prob. 2ECh. 27.1 - Prob. 3ECh. 27.1 - Prob. 4ECh. 27.1 - Prob. 5ECh. 27.1 - Prob. 6ECh. 27.1 - Prob. 7ECh. 27.1 - Prob. 8ECh. 27.1 - Prob. 9ECh. 27.2 - Prob. 1E
Ch. 27.2 - Prob. 2ECh. 27.2 - Prob. 3ECh. 27.2 - Prob. 4ECh. 27.2 - Prob. 5ECh. 27.2 - Prob. 6ECh. 27.3 - Prob. 1ECh. 27.3 - Prob. 2ECh. 27.3 - Prob. 3ECh. 27.3 - Prob. 4ECh. 27.3 - Prob. 5ECh. 27.3 - Prob. 6ECh. 27 - Prob. 1PCh. 27 - Prob. 2PCh. 27 - Prob. 3PCh. 27 - Prob. 4PCh. 27 - Prob. 5PCh. 27 - Prob. 6P
Knowledge Booster
Similar questions
- Consider the un-directed graph shown in the Fig. The values inside the node refer to the feature value of the node. The order of the nodes is A,B,C,D when following the matrix form in below questions.(You can use python or other languages to find the eigen values and other operationfor this question):1. For the given graph, write down the degree matrix, adjacency matrix, and Laplacian matrix representation.2.Find the eigenvalues and eigenvectors of the graph Laplacian matrix. Do you see any pattern pertaining to the signs of the eigenvalues (all positive or negative or no such pattern). Will it be same for all such graph Laplacianmatrices, and why?arrow_forwardI am eager to learn. Please explain too. For each graph representation, what is the appropriate worst-case time complexity for printing the vertex label of all the neighbors of a given vertex. Assume that vertex label retrieval from a typical integer vertex representation is O(1). The choices are: O(V+E), O(E), O(V), or O(1). Adjancy Matrix = ____ Edge List = ____ Adjacency List = ____arrow_forwardFor each graph representation, select the appropriate worst-case time complexity for printing the vertex label of all the neighbors of a given vertex. Assume that vertex label retrieval from a typical integer vertex representation is O(1). Adjacency Matrix: ________ Edge List: ________ Adjacency List: _________ Choices: O(V+E), O(E^2), O(V^2), O(E)arrow_forward
- Consider the following graph and Dijkstra's algorithm to find the shortest paths from the vertex A. (See image attached) The distances / weights in the incident edges at the vertex F are given in the table: edge: (B, F) (C, F) (E, F)distance: 8 11 4.5 At the end of the algorithm, what is the value of the distance for the vertex F?arrow_forwardThe Algorithm of AlgebraThe adjacency matrix A of a graph G = is used by the algebraic BFS algorithm (V, E).First, we create a vector x with all zeros except for the index of the source vertex s that we wish to use as the starting point for the algorithm; next, we create the matrix A = A+ I; last, AT x chooses all nodes that are at a distance of 1 (level 1) from the source vertex. The vertices with the fewest number of hops are obtained by multiplying the vector x by the matrix A2. As a rule, the product Ak x will produce neighbours that are at most k hops distant, and the multiplication should be done in a boolean manner as in the algorithm shown below. Algorithm for Algebraic BFS1: Input : Adjacency matrix An,n of a graph G = (V, E) connected, unweighted graph G and asource vertex s2: Output : N, visited, levels a matrix that shows level i vertices at its column i, the visitedvertices in sequence and their levels3: x[n] ← 04: x[s] ← 15: A ← A + I6: for i = 1 to n do7: N ← AT · x8:…arrow_forwarda) Illustrate the sequence of vertices of this graph visited using depth-first search traversal starting at vertex g. b) Illustrate adjacency list representation and adjacency matrix representation, respectively, for this graph. What are the advantages and disadvantages of those two representations? c) Describe an algorithm to find in the graph a path illustrated below that goes through every edge exactly once in each direction.arrow_forward
- Simplify the following k-map and compare it to boolean simplification. Answer both item.arrow_forwardDO NOT COPY FROM GOOGLE AND BARTLEBY Prove or find a counter example. If G1 and G2 are planar and have the same number of nodes, edges, and regions then G1 and G2 are isomorphic.arrow_forwardplease answer both of the questions. 7. The Bellman-Ford algorithm for single-source shortest paths on a graph G(V,E) as discussed in class has a running time of O|V |3, where |V | is the number of vertices in the given graph. However, when the graph is sparse (i.e., |E| << |V |2), then this running time can be improved to O(|V ||E|). Describe how how this can be done.. 8. Let G(V,E) be an undirected graph such that each vertex has an even degree. Design an O(|V |+ |E|) time algorithm to direct the edges of G such that, for each vertex, the outdegree is equal to the indegree. Please give proper explanation and typed answer only.arrow_forward
- Give the sequence of edges involved in DFS and BFS in relation between visiting all the edges in alphabetical order starting from A. Show only the final sequence of elements.arrow_forwardCorrect answer will be upvoted else downvoted. Computer science. Consider an undirected weighted diagram of n vertices numbered from 1 to n for which the edges between the vertices I and j (i<j) are included the accompanying way: Assuming gcd(ai,ai+1,ai+2,… ,aj)=min(ai,ai+1,ai+2,… ,aj), there is an edge of weight min(ai,ai+1,ai+2,… ,aj) among I and j. Assuming i+1=j, there is an edge of weight p among I and j. Here gcd(x,y,… ) signifies the best normal divisor (GCD) of integers x, y, .... Note that there could be numerous edges among I and j if both of the above conditions are valid, and assuming both the conditions come up short for I and j, there is no edge between these vertices. The objective is to find the heaviness of the base traversing tree of this chart. Input The principal line contains a solitary integer t (1≤t≤104) — the number of experiments. The primary line of each experiment contains two integers n (2≤n≤2⋅105) and p (1≤p≤109) — the number…arrow_forwardAs we know, the time complexity of the BFS traversal on a graph with n vertices and m edges that is represented with the adjacency list structure is O(n + m). Calculate the time complexity in the case of a graph represented with adjacency matrix structure. Demonstrate the steps in your calculation.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education