SUBSET-SUM problem can be solved in polynomial time

In summary, the SUBSET-SUM problem can be solved in polynomial time if the target t is given in unary. This is because a dynamic programming recursion algorithm can be used which has a polynomial time complexity. However, the way in which the target is represented can affect the overall running time of the algorithm. For example, if the target is represented in unary, the running time will be polynomial. This is similar to how changing the format of input can also affect the runtime in other problems, such as graph problems. Therefore, it is important to consider the format of the input when analyzing the time complexity of algorithms.
  • #1
jetoso
73
0
Is it possible to show that the SUBSET-SUM problem can be solved in polynomial time if the target t is given in unary?

We know that the subset sum problem consist on finding a subset S' of numbers from a set S such that its sum equals t.

If t is unary, say if t=3 then t=111, how can we find a polynomial-time algorithm?
 
Mathematics news on Phys.org
  • #2
jetoso said:
Is it possible to show that the SUBSET-SUM problem can be solved in polynomial time if the target t is given in unary?
Maybe. Unary has nothing to do with it. Knapsack is NP-hard.
 
  • #3


It is well known that there is a dynamic programming recursion that solves the subset-sum problem in O(nt), where t is the target. Thus, if t is given in unary, then the running time must be bounded in polynomial-time of the size of the input.
So, in principle the way in which the target is represented, makes the running time to be polynomial.
What do you think?
 
  • #4
Any exponential time problem will take polynomial time if the input is represented in unary. Normally the parameter is the number of bits of input. If you take the bits of the input and represent them as a single number in unary, the number of bits of the unary input is exponential in the number of bits of the input. It is then a polynomial-time operation in the size of the unary input to convert back to, say, binary input, and then a polynomial time operation in the size of the unary input to solve the problem from there.

There are plenty of problems where changing the format of the input alters the runtime. A lot of graph problems have different time complexities when the graph is given as an adjacency list vs when the graph is given as an adjacency matrix.
 

FAQ: SUBSET-SUM problem can be solved in polynomial time

Can you explain what the Subset-Sum problem is?

The Subset-Sum problem is a mathematical problem that involves finding a subset of a given set of numbers that add up to a specific target number. The problem is often represented as a list of numbers and a target sum, and the goal is to determine if there is a subset of the list that adds up to the target number.

Why is it important to know if the Subset-Sum problem can be solved in polynomial time?

The complexity of a problem is an important factor in determining its difficulty and feasibility to solve. If the Subset-Sum problem can be solved in polynomial time, it means that the time required to solve the problem increases at a manageable rate as the size of the input increases. This makes it a more practical problem to solve compared to problems that have exponential or factorial time complexity.

What is the significance of being able to solve the Subset-Sum problem in polynomial time?

Solving the Subset-Sum problem in polynomial time has significant implications in various fields such as computer science, operations research, and cryptography. It means that certain algorithms and techniques can be used to efficiently and effectively solve real-world problems that involve finding subsets of numbers that add up to a specific target.

Are there any known algorithms that can solve the Subset-Sum problem in polynomial time?

Yes, there are several known algorithms that can solve the Subset-Sum problem in polynomial time, such as the dynamic programming algorithm and the meet-in-the-middle algorithm. However, these algorithms may have limitations and may not be suitable for all types of inputs.

Are there any real-world applications of the Subset-Sum problem?

Yes, the Subset-Sum problem has various real-world applications, including resource allocation, scheduling, and inventory management. It is also used in cryptography, specifically in the design of secure encryption systems and in the creation of digital signatures.

Similar threads

Replies
5
Views
1K
Replies
0
Views
983
Replies
4
Views
2K
Replies
3
Views
1K
Replies
7
Views
2K
Replies
11
Views
2K
Replies
1
Views
2K
Back
Top