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 24.3, Problem 7E
Program Plan Intro
To calculate the total number of vertices in directed graph having weight function as
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Consider a connected undirected graph G=(V,E) in which every edge e∈E has a distinct and nonnegative cost. Let T be an MST and P a shortest path from some vertex s to some other vertex t. Now suppose the cost of every edge e of G is increased by 1 and becomes ce+1. Call this new graph G′. Which of the following is true about G′ ? a) T must be an MST and P must be a shortest s - t path. b) T must be an MST but P may not be a shortest s - t path. c) T may not be an MST but P must be a shortest s - t path. d) T may not be an MST and P may not be a shortest s−t path.
Pls use Kruskal's algorithm to reason about the MST.
Consider a directed graph G = (V, E), and two distinct vertices u, v V.
Recall that a set of U-V paths is non-overlapping if they have no edges in common
among them, and a set C of edges disconnects from U if in the graph
(V, E-C) there is no path from U to V.
Suppose we want to show that for any set of non-overlapping paths P and any
disconnecting set C, |P| ≤ |C|.
Consider the proof that defines A = P, B = C and f(path q) = qC,
and applies the Pigeonhole Principle to obtain the result.
True or False: f is a well-defined function (i.e. it satisfies the 3 properties of a well-
defined function).
True
False
4. Let G (V, E) be a directed graph. Suppose we have performed a DFS traversal of
G, and for each vertex v, we know its pre and post numbers. Show the following:
(a) If for a pair of vertices u, v € V, pre(u) < pre(v) < post(v) < post(u), then there
is a directed path from u to v in G.
(b) If for a pair of vertices u, v € V, pre(u) < post(u) < pre(v) < post(v), then there
is no directed path from u to v in G.
Chapter 24 Solutions
Introduction to Algorithms
Ch. 24.1 - Prob. 1ECh. 24.1 - Prob. 2ECh. 24.1 - Prob. 3ECh. 24.1 - Prob. 4ECh. 24.1 - Prob. 5ECh. 24.1 - Prob. 6ECh. 24.2 - Prob. 1ECh. 24.2 - Prob. 2ECh. 24.2 - Prob. 3ECh. 24.2 - Prob. 4E
Ch. 24.3 - Prob. 1ECh. 24.3 - Prob. 2ECh. 24.3 - Prob. 3ECh. 24.3 - Prob. 4ECh. 24.3 - Prob. 5ECh. 24.3 - Prob. 6ECh. 24.3 - Prob. 7ECh. 24.3 - Prob. 8ECh. 24.3 - Prob. 9ECh. 24.3 - Prob. 10ECh. 24.4 - Prob. 1ECh. 24.4 - Prob. 2ECh. 24.4 - Prob. 3ECh. 24.4 - Prob. 4ECh. 24.4 - Prob. 5ECh. 24.4 - Prob. 6ECh. 24.4 - Prob. 7ECh. 24.4 - Prob. 8ECh. 24.4 - Prob. 9ECh. 24.4 - Prob. 10ECh. 24.4 - Prob. 11ECh. 24.4 - Prob. 12ECh. 24.5 - Prob. 1ECh. 24.5 - Prob. 2ECh. 24.5 - Prob. 3ECh. 24.5 - Prob. 4ECh. 24.5 - Prob. 5ECh. 24.5 - Prob. 6ECh. 24.5 - Prob. 7ECh. 24.5 - Prob. 8ECh. 24 - Prob. 1PCh. 24 - Prob. 2PCh. 24 - Prob. 3PCh. 24 - Prob. 4PCh. 24 - Prob. 5PCh. 24 - Prob. 6P
Knowledge Booster
Similar questions
- ........arrow_forward2. Let G = (V, E) be a directed weighted graph with the vertices V = {A, B, C, D, E, F) and the edges E= {(A, B, 12), (A, D, 17), (B, C, 8), (B, D, 13), (B, E, 15), (B, F, 13), (C, E, 12), (C, F, 25)}, where the third components is the cost. (a) Write down the adjacency list representation the graph G = (V, E).arrow_forwardConsider a weighted, directed graph G with n vertices and m edges that have integer weights. A graph walk is a sequence of not-necessarily-distinct vertices v1, v2, ... , Vk such that each pair of consecutive vertices Vi, Vi+1 are connected by an edge. This is similar to a path, except a walk can have repeated vertices and edges. The length of a walk in a weighted graph is the sum of the weights of the edges in the walk. Let s, t be given vertices in the graph, and L be a positive integer. We are interested counting the number of walks from s to t of length exactly L. Assume all the edge weights are positive. Describe an algorithm that computes the number of graph walks from s to t of length exactly L in O((n+ m)L) time. Prove the correctness and analyze the running time. (Hint: Dynamic Programming solution)arrow_forward
- We are given a graph G = (V, E); G could be a directed graph or undirected graph. Let M bethe adjacency matrix of G. Let n be the number of vertices so that the matrix M is n ×n matrix. For anymatrix A, let us denote the element of i-th row and j-th column of the matrix A by A[i, j].1. Consider the square of the adjacency matrix M . For all i and j, show that M 2[i, j] is the number ofdifferent paths of length 2 from the i-th vertex to the j-th vertex. It should be explained or proved asclearly as possible.2. For any positive integer k, show that M k[i, j] is the number of different paths of length k from the i-th vertex to the j-th vertex. You may use induction on k to prove it.3. Assume that we are given a positive integer k. Design an algorithm to find the number of different paths of length k from the i-th vertex to j-th vertex for all pairs of (i, j). The time complexity of your algorithm should be O(n3 log k). You can get partial credits if you design an algorithm of O(n3k).arrow_forward4. Graphs represented in Matrixarrow_forwardGiven N cities represented as vertices V₁, V2, un on an undirected graph (i.e., each edge can be traversed in both directions). The graph is fully-connected where the edge eij connecting any two vertices vį and vj is the straight-line distance between these two cities. We want to search for the shortest path from v₁ (the source) to VN (the destination). ... Assume that all edges have different values, and €₁,7 has the largest value among the edges. That is, the source and destination have the largest straight-line distance. Compare the lists of explored vertices when we run the uniform-cost search and the A* search for this problem. Hint: The straight-line distance is the shortest path between any two cities. If you do not know how to start, try to run the algorithms by hand on some small cases first; but remember to make sure your graphs satisfy the conditions in the question.arrow_forward
- Given N cities represented as vertices V₁, V2,..., UN on an undirected graph (i.e., each edge can be traversed in both directions). The graph is fully-connected where the edge eij connecting any two vertices v; and vj is the straight-line distance between these two cities. We want to search for the shortest path from v₁ (the source) to VN (the destination). Assume that all edges have different values, and e₁, has the largest value among the edges. That is, the source and destination have the largest straight-line distance. Compare the lists of explored vertices when we run the uniform-cost search and the A* search for this problem. Hint: The straight-line distance is the shortest path between any two cities. If you do not know how to start, try to run the algorithms by hand on some small cases first; but remember to make sure your graphs satisfy the conditions in the question.arrow_forwardLet G = (V, E) be an undirected graph with at least two distinct vertices a, b ∈ V . Prove that we can assign a direction to each edge e ∈ E as to form a directed acyclic graph G′ where a is a source and b is a sink.arrow_forwardPlease help with this question:arrow_forward
- Let G be a graph. We say that a set of vertices C form a vertex cover if every edge of G is incident to at least one vertex in C. We say that a set of vertices I form an independent set if no edge in G connects two vertices from I. For example, if G is the graph above, C = [b, d, e, f, g, h, j] is a vertex cover since each of the 20 edges in the graph has at least one endpoint in C, and I = = [a, c, i, k] is an independent set because none of these edges appear in the graph: ac, ai, ak, ci, ck, ik. 2a In the example above, notice that each vertex belongs to the vertex cover C or the independent set I. Do you think that this is a coincidence? 2b In the above graph, clearly explain why the maximum size of an independent set is 5. In other words, carefully explain why there does not exist an independent set with 6 or more vertices.arrow_forwardLet G = (V, E) be an undirected graph and each edge e ∈ E is associated with a positive weight ℓ(e).For simplicity we assume weights are distinct. Is the following statement true or false? Let P be the shortest path between two nodes s, t. Now, suppose we replace each edge weight ℓ(e) withℓ(e)^2, then P is still a shortest path between s and t.arrow_forwardGiven a graph that is a tree (connected and acyclic). (I) Pick any vertex v.(II) Compute the shortest path from v to every other vertex. Let w be the vertex with the largest shortest path distance.(III) Compute the shortest path from w to every other vertex. Let x be the vertex with the largest shortest path distance. Consider the path p from w to x. Which of the following are truea. p is the longest path in the graphb. p is the shortest path in the graphc. p can be calculated in time linear in the number of edges/verticesarrow_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