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 35.2, Problem 4E
Program Plan Intro
To demonstrate that there exist a polynomial time estimation
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We know that when we have a graph with negative edge costs, Dijkstra’s algorithm is not guaranteed to work.
(a) Does Dijkstra’s algorithm ever work when some of the edge costs are negative? Explain why or why not.
(b) Find an algorithm that will always find a shortest path between two nodes, under the assumption that at most one edge in the input has a negative weight. Your algorithm should run in time O(m log n), where m is the number of edges and n is the number of nodes. That is, the runnning time should be at most a constant factor slower than Dijkstra’s algorithm. To be clear, your algorithm takes as input
(i) a directed graph, G, given in adjacency list form. (ii) a weight function f, which, given two adjacent nodes, v,w, returns the weight of the edge between them. For non-adjacent nodes v,w, you may assume f(v,w) returns +1. (iii) a pair of nodes, s, t. If the input contains a negative cycle, you should find one and output it. Otherwise, if the graph contains at least one…
Suppose we have the following undirected graph, and we know that the two
bolded edges (B-E and G-E) constitute the global minimum cut of the graph.
1. If we run the Karger’s algorithm for just one time to find the global minimum cut, what is the probability for the algorithm to find the minimum cut correctly? Please show your reasoning process.
2. How many times do we need to run the Karger’s algorithm if we want to guarantee that the probability of success is greater than or equal to
0.95, by “success” we mean that there is at least one time the Karger’s algorithm correctly found the minimum cut. Please show your reasoning process. [You do not have to work out the exact value of a logarithm]
How would you modify the dynamic programming algorithm for the coin collecting problem if some cells on the board are inaccessible for the robot? Apply your algorithm to the board below, where the inaccessible cells are shown by X’s. How many optimal paths are there for this board? You need to provide 1) a modified recurrence relation, 2) a pseudo code description of the algorithm, and 3) a table that stores solutions to the subproblems.
Chapter 35 Solutions
Introduction to Algorithms
Ch. 35.1 - Prob. 1ECh. 35.1 - Prob. 2ECh. 35.1 - Prob. 3ECh. 35.1 - Prob. 4ECh. 35.1 - Prob. 5ECh. 35.2 - Prob. 1ECh. 35.2 - Prob. 2ECh. 35.2 - Prob. 3ECh. 35.2 - Prob. 4ECh. 35.2 - Prob. 5E
Ch. 35.3 - Prob. 1ECh. 35.3 - Prob. 2ECh. 35.3 - Prob. 3ECh. 35.3 - Prob. 4ECh. 35.3 - Prob. 5ECh. 35.4 - Prob. 1ECh. 35.4 - Prob. 2ECh. 35.4 - Prob. 3ECh. 35.4 - Prob. 4ECh. 35.5 - Prob. 1ECh. 35.5 - Prob. 2ECh. 35.5 - Prob. 3ECh. 35.5 - Prob. 4ECh. 35.5 - Prob. 5ECh. 35 - Prob. 1PCh. 35 - Prob. 2PCh. 35 - Prob. 3PCh. 35 - Prob. 4PCh. 35 - Prob. 5PCh. 35 - Prob. 6PCh. 35 - Prob. 7P
Knowledge Booster
Similar questions
- Suppose that you want to get from vertex s to vertex t in an unweighted graph G = (V, E), but you would like to stop by vertex u if it is possible to do so without increasing the length of your path by more than a factor of α. Describe an efficient algorithm that would determine an optimal s-t path given your preference for stopping at u along the way if doing so is not prohibitively costly. (It should either return the shortest path from s to t or the shortest path from s to t containing u, depending on the situation)arrow_forwardLet G be this weighted undirected graph, containing 7 vertices and 11 edges. For each of the 10 edges that do not appear (AC, AE, AF, AG, BF, BG, CD, CF, CG, DG), assign a weight of 1000. It is easy to see that the optimal TSP tour has total cost 51. Generate an approximate TSP tour using the algorithm, and calculate the total cost of your solution. Explain why your solution is not a 2-approximation.arrow_forwardGive proof that the adapted form of the choice problem has an NP-complete solution. Is there a spanning tree in which the highest possible payment at any vertex does not exceed the target cost, given a graph G and a target cost c?arrow_forward
- Demonstrate that the decision problem variant is NP-complete; Exists, given a graph G and a cost objective c, a spanning tree where the maximum payment of any vertex does not exceed c?arrow_forwardPlease answer the following question in full detail. Please be specifix about everything: You have learned before that A∗ using graph search is optimal if h(n) is consistent. Does this optimality still hold if h(n) is admissible but inconsistent? Using the graph in Figure 1, let us now show that A∗ using graph search returns the non-optimal solution path (S,B,G) from start node S to goal node G with an admissible but inconsistent h(n). We assume that h(G) = 0. Give nonnegative integer values for h(A) and h(B) such that A∗ using graph search returns the non-optimal solution path (S,B,G) from S to G with an admissible but inconsistent h(n), and tie-breaking is not needed in A∗.arrow_forwardIt is NP-complete to determine whether an arbitrary graph has chromatic number k, where k >= 3. However, determining whether an arbitrary graph has chromatic number 2 is in P. Given a graph G on n vertices, create an algorithm that will return TRUE if χ(G) = 2 and FALSE if χ(G) ≠ 2. Clearly explain how your algorithm works, why it guarantees the correct output, and determine the running time of your algorithm.arrow_forward
- Consider the G-graph below. The numbers on the Edges are the gain values, not the cost. Now let's consider the Traveling Salesman Problem. The goal is to find the round that gives the maximum winnings (not the minimum cost). a) Apply the branch-and-bound algorithm to find the round with the maximum gain in the graph below. b) Is the branch-and-bound algorithm always guaranteed to find the optimal result? Is it a polynomial time algorithm?arrow_forwardCan we modify Dijkstra’s algorithm to solve the single-source longest path problem by changing minimum to maximum? If so, then explain why this algorithm correct. If not, then provide a counterexample.arrow_forwardConsider a graph G in the following Find a path from a to g in the graph G using each search strategy of depth-first search, breadth-first search, least-cost search, best-first search, and A* search. Is the returned solution path an optimal one?arrow_forward
- In this question you will explore the Traveling Salesperson Problem (TSP). (a) In every instance (i.e., example) of the TSP, we are given n cities, where each pair of cities is connected by a weighted edge that measures the cost of traveling between those two cities. Our goal is to find the optimal TSP tour, minimizing the total cost of a Hamiltonian cycle in G. Although it is NP-complete to solve the TSP, we found a simple 2-approximation by first generating a minimum-weight spanning tree of G and using this output to determine our TSP tour. Prove that our output is guaranteed to be a 2-approximation, provided the Triangle Inequality holds. In other words, if OP T is the total cost of the optimal solution, and AP P is the total cost of our approximate solution, clearly explain why AP P ≤ 2 × OP T.arrow_forwardGiven: graph G, find the smallest integer k such that the vertex set V of G contains a set A consisting of k elements satisfying the condition: for each edge of G at least one of its ends is in A. The size of the problem is the number n of vertices in G. Please help answer problems 3 & 4 from the given information. 3. Find an instance for which the suggested greedy algorithm gives an erroneous answer. 4. Suggest a (straightforward) algorithm which solves the problem correctly.arrow_forwardPlease answer the following question in detail and explain all the proofs and assumptions for all parts. The question has three parts, (a), (b) and (c). Iterative lengthening search is an iterative analogue of uniform-cost search. The basic idea is to use increasing limits on path cost. If a node is generated whose path cost exceeds the current limit, it is immediately discarded. For each new iteration, the limit is set to the lowest path cost of any node discarded in the previous iteration. (a) Show that this algorithm is optimal for general path costs. You may assume that all costs are integers (this is not a loss of generality if the search space is finite). You may wish to consider the minimal path cost C; what happens when we set the path cost to be some limit l < C? (b) Consider a uniform tree with branching factor b, solution depth d, and unit step costs (each action costs one unit). How many iterations will iterative lengthening require? (c) (7 points) Now consider the…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