Overlapping subproblems vs non overlapping -divide & conquer

  • I
  • Thread starter lsepolis123f
  • Start date
  • Tags
    Overlapping
They do not share any parts of the problem you are trying to optimize. This is the case in merge sort.
  • #1
lsepolis123f
13
0
In dynamic programming vs divide-and-conquer
We have
overlapping subproblems vs non overlapping subproblems
How distinguished, in other words what means overlapping subproblems...?

Discrete Mathematics and Its Applications Seventh Edition Kenneth H. Rosen
Ch.8 Advanced Counting Techniques

"We will discuss two ways that recurrence relations play important roles in the study of algorithms. First, we will introduce an important algorithmic paradigm known as dynamic programming. Algorithms that follow this paradigm break down a problem into overlapping subproblems. The solution to the problem is then found from the solutions to the subproblems through the use of a recurrence relation. Second, we will study another important algorithmic paradigm, divide-and-conquer. Algorithms that follow this paradigm can be used to solve a problem by recursively breaking it into a fixed number of non overlapping subproblems until these problems can be solved directly.The complexity of such algorithms can be analyzed using a special type of recurrence relation. In this chapter we will discuss a variety of divide-and-conquer algorithms and analyze their complexity using recurrence relations."
 
Mathematics news on Phys.org
  • #2
Can you provide an example of each - that seems the difference...
 
  • #3
lsepolis123f said:
Can you provide an example of each - that seems the difference...

I'll give an answer in the context of Computer Science.

Think of the Mergesort algorithm for example. This is a divide-and-conquer algorithm. An outline of its steps is:

- Divide array into two halves.
- Recursively sort each half.
- Merge two halves to make sorted whole.

Its recurrence relation has two parts: ##T(n) \leq 0## if n = 1 or ##T(n)\leq T(\lceil{n/2}\rceil) + T(\lfloor{n/2}\rfloor) + n## otherwise,
where
T(n) = number of comparisons to mergesort an input of size n. Its solution in terms of Big - Oh notation is ##T(n) = O(n log_2{n})##.
Can you see that the subproblems, that this algorithm goes into, are non overlapping? In order to see this clearly, you have to follow the recursion on each half, till there are just two elements left - for each half, before merging takes charge.

Now, for dynamic programming, the key concept is optimal substructure. I would recommend to take a look into the Wikipedia page https://en.wikipedia.org/wiki/Dynamic_programming. A classic example in Computer Science, is Dijkstra's algorithm for the shortest path problem. It is a bit tricky to understand why the sub-problems are overlapping in this case, if you don't understand the method we proceed in dynamic programming first.

Now, all that said, Divide-and-Conquer and Dynamic Programming are mathematical methods, so they are used in pure mathematical problems as well. Dynamic programming in this context is a mathematical optimization method.
 
Last edited:
  • Like
Likes lsepolis123f
  • #4
overlapping means pass from the same point sometime? or the one half part pass sometime from first half part?
 
  • #5
lsepolis123f said:
overlapping means pass from the same point sometime? or the one half part pass sometime from first half part?

Let me clarify this more. When we say overlapping subproblems of a problem, we basically mean subproblems that are potentially reused several times or the recursive procedure we use - essentially algorithm, solves the same subproblem over and over instead of generating new subproblems. This is the case for dynamic programming and the subproblems solved during the course of a running algorithm in this method, are intimately related.

On the other hand, non - overlapping subproblems of a divide-and-conquer algorithm are separate (see my previous post for this).
 

What is the difference between overlapping subproblems and non-overlapping -divide & conquer?

Overlapping subproblems and non-overlapping -divide & conquer are two different approaches to solving problems in computer science. Overlapping subproblems refer to a technique where the same subproblem is solved multiple times, whereas non-overlapping -divide & conquer involves breaking down a problem into smaller, non-overlapping subproblems that are then solved independently.

Which approach is more efficient?

It depends on the problem at hand. In some cases, overlapping subproblems may lead to more efficient solutions as they can reduce the number of computations needed. However, in other cases, non-overlapping -divide & conquer may be more efficient as it reduces the complexity of the problem by breaking it down into smaller parts.

What are some examples of problems that can be solved using overlapping subproblems?

Problems in dynamic programming, such as the knapsack problem or the Fibonacci sequence, can be solved using overlapping subproblems. These problems involve breaking down a larger problem into smaller subproblems that are solved repeatedly.

What are some examples of problems that can be solved using non-overlapping -divide & conquer?

Problems such as sorting algorithms, binary search, and merge sort can be solved using non-overlapping -divide & conquer. These problems involve breaking down a larger problem into smaller, non-overlapping subproblems that are then solved independently and combined to find the solution to the original problem.

Can overlapping subproblems and non-overlapping -divide & conquer be used together?

Yes, in some cases, both approaches can be combined to solve a problem more efficiently. For example, in the merge sort algorithm, non-overlapping -divide & conquer is used to break the array into smaller subarrays, and then overlapping subproblems are used to sort these subarrays. This results in a more efficient sorting algorithm.

Similar threads

  • Programming and Computer Science
Replies
2
Views
985
  • Quantum Interpretations and Foundations
Replies
1
Views
1K
  • STEM Academic Advising
Replies
5
Views
863
  • Programming and Computer Science
Replies
17
Views
4K
  • Programming and Computer Science
Replies
8
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
  • Beyond the Standard Models
Replies
11
Views
2K
  • Math Proof Training and Practice
3
Replies
86
Views
19K
  • Programming and Computer Science
Replies
29
Views
3K
Replies
2
Views
888
Back
Top