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
Concept explainers
Question
Chapter 29, Problem 2P
a.
Program Plan Intro
To verify that complementary slackness holds in lines 29.53 and 29.57 of the linear
b.
Program Plan Intro
To prove that complementary slackness holds for any primal linear program and its corresponding dual.
c.
Program Plan Intro
To prove that a feasible solution
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Solve the following exercise using jupyter notebook for Python, to find the objective function, variables, constraint matrix and print the graph with the optimal solution.
A farm specializes in the production of a special cattle feed, which is a mixture of corn and soybeans. The nutritional composition of these ingredients and their costs are as follows:
- Corn contains 0.09 g of protein and 0.02 g of fiber per gram, with a cost of.$0.30 per gram.- Soybeans contain 0.60 g of protein and 0.06 g of fiber per gram, at a cost of $0.90 per gram.0.90 per gram.
The dietary needs of the specialty food require a minimum of 30% protein and a maximum of 5% fiber. The farm wishes to determine the optimum ratios of corn and soybeans to produce a feed with minimal costs while maintaining nutritional constraints and ensuring that a minimum of 800 grams of feed is used daily.
Restrictions
1. The total amount of feed should be at least 800 grams per day.2. The feed should contain at least 30% protein…
Exercise 4
20= 10+4+6
The rod-cutting problem consists of a rod of n units long that can be cut into integer-length
pieces. The sale price of a piece i units long is Pi for i = 1,...,n. We want to apply dynamic
programming to find the maximum total sale price of the rod. Let F(k) be the maximum price
for a given rod of length k.
1. Give the recurrence on F(k) and its initial condition(s).
2. What are the time and space efficiencies of your algorithm?
Now, consider the following instance of the rod-cutting problem: a rod of length n=5, and the
following sale prices P1=2, P2=3, P3-7, P4=2 and P5=5.
Develop a dynamic programming algorithm for the knapsack problem: given n items of know weights w1, . . . , wn and values v1, . . . ,vn and a knapsack of capacity W, find the most valuable subset of the items that fit into the knapsack. We assume that all the weights and the knapsack’s capacity are positive integers, while the item values are positive real numbers. (This is the 0-1 knapsack problem).
Analyze the structure of an optimal solution.
Give the recursive solution.
Give a solution to this problem by writing pseudo code procedures.
Analyze the running time for your algorithms.
Chapter 29 Solutions
Introduction to Algorithms
Ch. 29.1 - Prob. 1ECh. 29.1 - Prob. 2ECh. 29.1 - Prob. 3ECh. 29.1 - Prob. 4ECh. 29.1 - Prob. 5ECh. 29.1 - Prob. 6ECh. 29.1 - Prob. 7ECh. 29.1 - Prob. 8ECh. 29.1 - Prob. 9ECh. 29.2 - Prob. 1E
Ch. 29.2 - Prob. 2ECh. 29.2 - Prob. 3ECh. 29.2 - Prob. 4ECh. 29.2 - Prob. 5ECh. 29.2 - Prob. 6ECh. 29.2 - Prob. 7ECh. 29.3 - Prob. 1ECh. 29.3 - Prob. 2ECh. 29.3 - Prob. 3ECh. 29.3 - Prob. 4ECh. 29.3 - Prob. 5ECh. 29.3 - Prob. 6ECh. 29.3 - Prob. 7ECh. 29.3 - Prob. 8ECh. 29.4 - Prob. 1ECh. 29.4 - Prob. 2ECh. 29.4 - Prob. 3ECh. 29.4 - Prob. 4ECh. 29.4 - Prob. 5ECh. 29.4 - Prob. 6ECh. 29.5 - Prob. 1ECh. 29.5 - Prob. 2ECh. 29.5 - Prob. 3ECh. 29.5 - Prob. 4ECh. 29.5 - Prob. 5ECh. 29.5 - Prob. 6ECh. 29.5 - Prob. 7ECh. 29.5 - Prob. 8ECh. 29.5 - Prob. 9ECh. 29 - Prob. 1PCh. 29 - Prob. 2PCh. 29 - Prob. 3PCh. 29 - Prob. 4PCh. 29 - Prob. 5P
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Give the given linear program in following: Identify the decision variables, Objective function, Set of Constraints, and Parameters. For the Graphical Solutions: Graph the Constraints, Obtain the Corner-Points of the Feasible Solution and Get the Optimal Solution. Inside the store there are two types of products One is in a variety of products and the other is bakery supplies. Of course in a store, in order to make a profit, a budget is needed for the products to be sold: For variety they spend up to Php 6,000 in a week and for bakery supplies, they no longer have problems because consignment is in their agreement to be able to sell. For bakery supplies, My parents sell Php 315,000 and they earn Php 31,500 in 3 months. And in the main variety product; They sell Php 48,000 they earn Php 18,000 in 4 months. For other equipment such as Plastic Bags, Water and Electricity they spend Php 3,230 in a month which reduces the income. On the day of December 19, the store will be temporarily…arrow_forwardConsider the algorithm SeldeLP. Construct an example to show that the optimum of the linear program defined by the constraints in B(H\h) u {h} may be different from the optimum of the linear program defined by H. Thus, if the test in Step 2.1 fails and we proceed to Step 2.2, it does not suffice to consider the constraints in B(H\h) u {h} alone.arrow_forward8. A school is creating class schedules for its students. The students submit their requested courses and then a program will be designed to find the optimal schedule for all students. The school has determined that finding the absolute best schedule cannot be solved in a reasonable time. Instead they have decided to use a simpler algorithm that produces a good but non-optimal schedule in a more reasonable amount of time. Which principle does this decision best demonstrate? A. Unreasonable algorithms may sometimes also be undecidable B. Heuristics can be used to solve some problems for which no reasonable algorithm exists C. Two algorithms that solve the same problem must also have the same efficiency D. Approximate solutions are often identical to optimal solutions 0000arrow_forward
- (a) Stingy SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variables are true, if such an assignment exists. Prove that stingy SAT is NP-hard. (b) The Double SAT problem asks whether a given satisfiability problem has at least two different satisfying assignments. For example, the problem {{V1, V2}, {V1, V2}, {V1, V2}} is satisfiable, but has only one solution (v₁ = F, v₂ = T). In contrast, {{V1, V2}, {V1, V2}} has exactly two solutions. Show that Double-SAT is NP-hard.arrow_forward8. A school is creating class schedules for its students. The students submit their requested courses and then a program will be designed to find the optimal schedule for all students. The school has determined that finding the absolute best schedule cannot be solved in a reasonablo time. Instead they have decided to use a simpler algorithm that produces a good but non-optimal schedule in a more reasonable amount of time. Which principle does this decision best demonstrate? O A Unreasonable algorithms may sometimes also be undecidable O B. Heuristics can be used to solve some problems for which no reasonable algorithm exsts O C. efficiency Two algorithms that solve the same problem must also have the same O B. Approximate solutions are often identical to optimal solutionsarrow_forwardLet u be a current current vector of parameters and x and y two training examples such that u¹(x-y)< 1. Use the technique of Lagrange multipliers to find a new vector of parameters w as the solution to the convex optimization problem below: minimize: J(w) = ||wu||² W- subject to: w (x - y) ≥ 1arrow_forward
- Maximum weight = 20The above problem is a 0/1 Knapsack problem. Here there are 7 different objects labelled from A to G. The objective of this problem is to carry the different objects in your bag in such a way such that the profit is maximized. But you have to make sure that your bag does not exceed the maximum weight i.e. the maximum weight that this bag can carry is less than or equal to 15. Remember you can carry an object exactly once. Now it is your job to use Genetic Algorithm to solve this problem. 1. Encode the problem and create an initial population of 4 different chromosomes 2. Think of an appropriate fitness function to this problem and give proper justification. 3. Use the fitness function to calculate the fitness level of all the chromosomes in your population 4. Perform natural selection and select the two fittest chromosomes 5. Use the parents from (4) and perform crossover to get 2 offspring 6. Perform mutation and check the fitness of the final offspring. Comment…arrow_forwardConsider the following bridge crossing problem where n people with speeds s1, ··· , sn wish to cross the bridge as quickly as possible. The rules remain: • It is nighttime and you only have one flashlight. • A maximum of two people can cross at any one time • Any party who crosses, either 1 or 2 people must have the flashlight with them. • The flashlight must be walked back and forth, it cannot be thrown, etc. • A pair must walk together at the rate of the slower person’s pace. Give an efficient algorithm to find the fastest way to get a group of people across the bridge. You must have a proof of correctness for your method.arrow_forwardDPP. Solve by backward recursive equation defining its stages in order to find the optimal solutionarrow_forward
- CLRS Exercise 15.1-3 Rod Cutting Problem Consider a modification of the rod-cutting prolem in which in addition to a price pi for each rod, each cut incurs a fixed cost c. The revenue associated with a solution is now the sum of prices of th epieces minus the cost of making the cuts. Give a dynamic programming algorithm to solve this modified problemarrow_forwardCSPS Consider the following (normal-form) game. Formulate the problem of finding a pure Nash equilibrium of this game as a constraint satisfaction problem R U 2,2 | 0,1 D 0,0 1,1 Linear Programming Consider the same game and suppose the row player adopts a strategy of (0.6,0.4). Give a linear program whose optimal solution gives a best reply for the column player. (You do not need to solve the linear program.)arrow_forwardIn 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_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole