SUBSET-SUM problem can be solved in polynomial time

  • Context: Graduate 
  • Thread starter Thread starter jetoso
  • Start date Start date
  • Tags Tags
    Polynomial Time
Click For Summary

Discussion Overview

The discussion centers around the complexity of the SUBSET-SUM problem, specifically whether it can be solved in polynomial time when the target value is represented in unary. Participants explore the implications of unary representation on algorithm efficiency and complexity classes.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant questions the possibility of solving the SUBSET-SUM problem in polynomial time with a unary target, suggesting that the problem involves finding a subset of numbers that sums to the target.
  • Another participant expresses skepticism, stating that unary representation does not change the NP-hard nature of the knapsack problem.
  • A different viewpoint highlights that a dynamic programming approach can solve the subset-sum problem in O(nt) time, arguing that if the target is unary, the running time becomes polynomial in relation to the input size.
  • Another participant elaborates that any exponential time problem can be reduced to polynomial time with unary input representation, noting that the conversion from unary back to binary is polynomial in the size of the unary input.
  • It is mentioned that the representation of input can significantly affect the runtime of various problems, with examples from graph theory regarding adjacency list versus adjacency matrix representations.

Areas of Agreement / Disagreement

Participants express differing views on the impact of unary representation on the complexity of the SUBSET-SUM problem. There is no consensus on whether it can be solved in polynomial time, as some argue for its feasibility while others maintain that it remains NP-hard.

Contextual Notes

The discussion does not resolve the implications of unary representation on the complexity class of the SUBSET-SUM problem, and assumptions regarding input size and representation are not fully explored.

jetoso
Messages
73
Reaction score
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?
 
Physics news on Phys.org
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.
 


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?
 
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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K