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 33, Problem 2P
a.
Program Plan Intro
To show that
b.
Program Plan Intro
To show the maximal layers of
c.
Program Plan Intro
To describe an
d.
Program Plan Intro
To find the difficulties by allowing input points to have the same x- or y coordinate.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Let 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.
Suppose there is undirected graph F with nonnegative edge weights we ≥ 0. You have also calculated the minimum spanning tree of F and also the shortest paths to all nodes from a particular node p ∈ V . Now, suppose that each edge weight is increased by 1, so the new weights are we′ = we + 1.
(a) Will there be a change of the minimum spanning tree? Provide an example where it does or prove that it cannot change.
(b) (3 points) Will the shortest paths from p change? Provide an example where it does or prove that it cannot change.
Consider an undirected graph G = (V;E). An independent set is a subset I V such that for any vertices i; j 2 I,
there is no edge between i and j in E. A set i is a maximal independent set if no additional vertices of V can be
added to I without violating its independence. Note, however, that a maximal independent sent is not necessarily
the largest independent set in G. Let (G) denote the size of the largest maximal independent set in G.
One way of trying to avoid this dependence on ordering is the use of randomized algorithms. Essentially, by processing
the vertices in a random order, you can potentially avoid (with high probability) any particularly bad orderings. So
consider the following randomized algorithm for constructing independent sets:
@ First, starting with an empty set I, add each vertex of G to I independently with probability p.
@ Next, for any edges with both vertices in I, delete one of the two vertices from I (at random).
@ Note - in this second step,…
Chapter 33 Solutions
Introduction to Algorithms
Ch. 33.1 - Prob. 1ECh. 33.1 - Prob. 2ECh. 33.1 - Prob. 3ECh. 33.1 - Prob. 4ECh. 33.1 - Prob. 5ECh. 33.1 - Prob. 6ECh. 33.1 - Prob. 7ECh. 33.1 - Prob. 8ECh. 33.2 - Prob. 1ECh. 33.2 - Prob. 2E
Ch. 33.2 - Prob. 3ECh. 33.2 - Prob. 4ECh. 33.2 - Prob. 5ECh. 33.2 - Prob. 6ECh. 33.2 - Prob. 7ECh. 33.2 - Prob. 8ECh. 33.2 - Prob. 9ECh. 33.3 - Prob. 1ECh. 33.3 - Prob. 2ECh. 33.3 - Prob. 3ECh. 33.3 - Prob. 4ECh. 33.3 - Prob. 5ECh. 33.3 - Prob. 6ECh. 33.4 - Prob. 1ECh. 33.4 - Prob. 2ECh. 33.4 - Prob. 3ECh. 33.4 - Prob. 4ECh. 33.4 - Prob. 5ECh. 33.4 - Prob. 6ECh. 33 - Prob. 1PCh. 33 - Prob. 2PCh. 33 - Prob. 3PCh. 33 - Prob. 4PCh. 33 - Prob. 5P
Knowledge Booster
Similar questions
- Recall that we discussed the "leader-based" deterministic distributed algorithm for 2-colouring a path, that runs in time O(n) on an n node path network. Suppose we now relax the constraint of 2-colouring to mean, it is okay for one of the neighbours of a node to x get the same colour as the mode x, as long as the other neighbour gets a different colour. The end points must get a different colour from their respective unique neighbours. The running time for a best efficiency deterministic distributed algorithm, using unique identifiers for nodes, for this problem would be:arrow_forwarda. Given n items, where each item has a weight and a value, and a knapsack that can carry at most W You are expected to fill in the knapsack with a subset of items in order to maximize the total value without exceeding the weight limit. For instance, if n = 6 and items = {(A, 10, 40), (B, 50, 30), (C, 40, 80), (D, 20, 60), (E, 40, 10), (F, 10, 60)} where each entry is represented as (itemIdi, weighti, valuei). Use greedy algorithm to solve the fractional knapsack problem. b. Given an array of n numbers, write a java or python program to find the k largest numbers using a comparison-based algorithm. We are not interested in the relative order of the k numbers and assuming that (i) k is a small constant (e.g., k = 5) independent of n, and (ii) k is a constant fraction of n (e.g., k = n/4). Provide the Big-Oh characterization of your algorithm.arrow_forwardConsider an undirected graph G = (V;E). An independent set is a subset I V such that for any vertices i; j 2 I, there is no edge between i and j in E. A set i is a maximal independent set if no additional vertices of V can be added to I without violating its independence. Note, however, that a maximal independent sent is not necessarily the largest independent set in G. Let (G) denote the size of the largest maximal independent set in G. Consider the following greedy algorithm for generating maximal independent sets: starting with an empty set I, process the vertices in V one at a time, adding v to I is v is not connected to any vertex already in I. 2) Argue that the output I of this algorithm is a maximal independent set.arrow_forward
- You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E') with respect to these weights; you may assume G and T are given as adjacency lists. Now suppose the weight of a particular edge e in E is modified from w(e) to a new value w̃(e). You wish to quickly update the minimum spanning tree T to reflect this change, without recomputing the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for updating the tree. Note, you are given the tree T and the edge e = (y, z) whose weight is changed; you are told its old weight w(e) and its new weight w~(e) (which you type in latex by widetilde{w}(e) surrounded by double dollar signs). In each case specify if the tree might change. And if it might change then give an algorithm to find the weight of the possibly new MST (just return the weight or the MST, whatever's easier). You can use the algorithms DFS, Explore, BFS, Dijkstra's, SCC, Topological Sort as…arrow_forwardSuppose that the road network is defined by the undirected graph, where the vertices represent cities and edges represent the road between two cities. The Department of Highways (DOH) decides to install the cameras to detect the bad driver. To reduce the cost, the cameras are strategically installed in the cities that a driver must pass through in order to go from one city to another city. For example, if there are two cities A and B such that the path that goes from A to B and the path that goes from B to A must pass the city C, then C must install the camera. Suppose that there are m cities and n roads. Write an O (m + n) to list all cities where cameras should be installed.arrow_forwardLet A, B, C, D be the vertices of a square with side length 100. If we want to create a minimum-weight spanning tree to connect these four vertices, clearly this spanning tree would have total weight 300 (e.g. we can connect AB, BC, and CD). But what if we are able to add extra vertices inside the square, and use these additional vertices in constructing our spanning tree? Would the minimum-weight spanning tree have total weight less than 300? And if so, where should these additional vertices be placed to minimize the total weight? Let G be a graph with the vertices A, B, C, D, and possibly one or more additional vertices that can be placed anywhere you want on the (two-dimensional) plane containing the four vertices of the square. Determine the smallest total weight for the minimum-weight spanning tree of G. Round your answer to the nearest integer. Note: I encourage you to add n additional points (for n=1, 2, 3) to your graph and see if you can figure out where these point(s) need to…arrow_forward
- Let A, B, C, D be the vertices of a square with side length 100. If we want to create a minimum-weight spanning tree to connect these four vertices, clearly this spanning tree would have total weight 300 (e.g. we can connect AB, BC, and CD). But what if we are able to add extra vertices inside the square, and use these additional vertices in constructing our spanning tree? Would the minimum-weight spanning tree have total weight less than 300? And if so, where should these additional vertices be placed to minimize the total weight? Let G be a graph with the vertices A, B, C, D, and possibly one or more additional vertices that can be placed anywhere you want on the (two-dimensional) plane containing the four vertices of the square. Determine the smallest total weight for the minimum-weight spanning tree of G. Round your answer to the nearest integer. Attention: Please don't just copy these two following answers, which are not correct at all. Thank you.…arrow_forwardConsider the following problem for path finding where S is the source, G is the Goal and O are obstacles. We can only move horizontally and vertically (not diagonally). We will not re-visit an already visited cell. - Simulate the application of Breadth-first search tree to find all paths from S to G. Provide the order of visit for each node. - Simulate the application of Depth-first search tree to find all paths from S to G. Provide the order of visit for each node. S O G Oarrow_forwardWriteThe algorithm starts with an initial allocation of each user i € N on an st path, of the 6-layered network G. iteratively examines whether there exists any user that is unsatisfied.arrow_forward
- Consider an undirected graph G = (V;E). An independent set is a subset I V such that for any vertices i; j 2 I, there is no edge between i and j in E. A set i is a maximal independent set if no additional vertices of V can be added to I without violating its independence. Note, however, that a maximal independent sent is not necessarily the largest independent set in G. Let (G) denote the size of the largest maximal independent set in G. 1) What is (G) if G is a complete graph on n vertices? What if G is a cycle on n vertices?arrow_forwardConsider the (directed) network in the attached document We could represent this network with the following Prolog statements: link(a,b). link(a,c). link(b,c). link(b,d). link(c,d). link(d,e). link(d,f). link(e,f). link(f,g). Now, given this network, we say that there is a "connection" from a node "X" to a node "y" if we can get from "X" to "Y" via a series of links, for example, in this network, there is a connection from "a" to "d", and a connection from "c" to "f", etc.arrow_forwardEstablish the Shortest-Paths Optimality Conditions in the Proposition P. Then, for any v reachable from s, the value of distTo[v] is the length of some path from s to v, with distTo[v] equal to infinity for all v not reachable from s. Let G be an edge-weighted digraph. s is a source vertex in G. distTo[] is a vertex-indexed array of path lengths in G. These numbers represent the lengths of the shortest pathways if and only if each edge e from v to w satisfies the condition that distTo[w] = distTo[v] + e.weight() (i.e., no edge is eligible).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