Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "cut-and-paste" proof technique?

I've seen references to cut-and-paste proofs in certain texts on algorithms analysis and design. It is often mentioned within the context of Dynamic Programming when proving optimal substructure for an optimization problem (See Chapter 15.3 CLRS). It also shows up on graphs manipulation.

What is the main idea of such proofs? How do I go about using them to prove the correctness of an algorithm or the convenience of a particular approach?

like image 455
hari_sree Avatar asked Mar 04 '12 07:03

hari_sree


People also ask

What is cut and paste technique?

Cut and paste are two commands that are commonly used together in computer user interface interaction and provide a method of transferring data from one location to another. Unlike the copy and paste commands, which create a duplicate in the new location, cut and paste moves the entire contents to the new location.

What is greedy choice property?

Greedy choice property. We can make whatever choice seems best at the moment and then solve the subproblems that arise later. The choice made by a greedy algorithm may depend on choices made so far, but not on future choices or all the solutions to the subproblem.

Is a technique to store answers to sub problems in a table?

Dynamic programming solves each subproblem just once, and saves its answer in a table, to avoid the recomputation.

Which of the algorithm will definitely result in an optimal solution?

Explanation: A greedy algorithm gives optimal solution for all subproblems, but when these locally optimal solutions are combined it may NOT result into a globally optimal solution.


1 Answers

The term "cut and paste" shows up in algorithms sometimes when doing dynamic programming (and other things too, but that is where I first saw it). The idea is that in order to use dynamic programming, the problem you are trying to solve probably has some kind of underlying redundancy. You use a table or similar technique to avoid solving the same optimization problems over and over again. Of course, before you start trying to use dynamic programming, it would be nice to prove that the problem has this redundancy in it, otherwise you won't gain anything by using a table. This is often called the "optimal subproblem" property (e.g., in CLRS).

The "cut and paste" technique is a way to prove that a problem has this property. In particular, you want to show that when you come up with an optimal solution to a problem, you have necessarily used optimal solutions to the constituent subproblems. The proof is by contradiction. Suppose you came up with an optimal solution to a problem by using suboptimal solutions to subproblems. Then, if you were to replace ("cut") those suboptimal subproblem solutions with optimal subproblem solutions (by "pasting" them in), you would improve your optimal solution. But, since your solution was optimal by assumption, you have a contradiction. There are some other steps involved in such a proof, but that is the "cut and paste" part.

like image 128
Cameron Avatar answered Oct 12 '22 19:10

Cameron