Questions tagged [polynomial-time]

Use for algorithms, algorithm-analysis and complexity-theory questions that aim for polynomial running time resp. time complexity. Such questions often are are reference-requests or about runtime-analysis or time-complexity.

Fitting category tags are , and

Other commonly used tags are , and ; note how the latter two are not the same!

444 questions
63
votes
3 answers

What exactly is polynomial time?

I'm trying to understand algorithm complexity, and a lot of algorithms are classified as polynomial. I couldn't find an exact definition anywhere. I assume it is the complexity that is not exponential. Do linear/constant/quadratic complexities…
43
votes
6 answers

Why is linear programming in P but integer programming NP-hard?

Linear programming (LP) is in P and integer programming (IP) is NP-hard. But since computers can only manipulate numbers with finite precision, in practice a computer is using integers for linear programming. Because of this, shouldn't LP and IP be…
Sasha the Noob
  • 643
  • 1
  • 7
  • 9
32
votes
2 answers

Problems that are polynomially "hard" to compute but "easy" to verify

In the (unlikely) event that $P=NP$ with a constructive proof of a polynomial time algorithm that solves 3SAT, obviously things will be very different. However, practically, it could happen that the degree of the polynomial run time is very large…
zyl1024
  • 462
  • 4
  • 13
17
votes
3 answers

Why not to take the unary representation of numbers in numeric algorithms?

A pseudo-polynomial time algorithm is an algorithm that has polynomial running time on input value (magnitude) but exponential running time on input size(number of bits). For example testing whether a number $n$ is prime or not, requires a loop…
17
votes
1 answer

What does the 2 in a 2-approximation algorithm mean?

Does the 2 in a 2-approximation algorithm mean the solution is within 2*OPT or OPT/2?
16
votes
2 answers

Problems that feel exponential but are P

I'm trying to build a list of algorithms/problems that are "exceptionally useful", as in, solving problems that 'seem' very exponential in nature, but have some particularly clever algorithm that ultimately solves them. Examples of what I…
Alex Meiburg
  • 955
  • 4
  • 18
16
votes
2 answers

What is so fundamental about polynomial functions that they are used to demarcate the Hardness boundary in NP complexity classes?

This question has been bugging me ever since I first came across the concept of NP, NP-Complete, and NP-Hard a few years back: what is so fundamental about the polynomial functions that they are used to demarcate the boundary between what is "hard"…
15
votes
2 answers

Finding shortest and longest paths between two vertices in a DAG

Given an unweighted DAG (directed acyclic graph) $D = (V,A)$ and two vertices $s$ and $t$, is it possible to find the shortest and longest path from $s$ to $t$ in polynomial time? Path lengths are measured by the number of edges. I am interested in…
robowolverine
  • 347
  • 1
  • 2
  • 8
14
votes
3 answers

Problems conjectured but not proven to be easy

We have many problems, like factorization, that are strongly conjectured, but not proven, to be outside P. Are there any questions with the opposite property, namely, that they are strongly conjectured but not proven to be inside P?
14
votes
1 answer

If $n^{\log n}$ is not polynomial or exponential, then what this function is called?

I just found this sentence on page 6 of Garey and Johnson's "Computers and Intractability". Any algorithm whose time complexity function cannot be so bounded is called an exponential time algorithm (although it should be noted that this definition…
user777
  • 759
  • 4
  • 20
14
votes
1 answer

Is determining if there is a prime in an interval known to be in P or NP-complete?

I saw from this post on stackoverflow that there are some relatively fast algorithms for sieving an interval of numbers to see if there is a prime in that interval. However, does this mean that the overall decision problem of: (Does there exists a…
Ari
  • 1,661
  • 10
  • 23
13
votes
2 answers

Does linear programming admit a strongly polynomial-time algorithm?

The linear programming problem: find a strongly-polynomial time algorithm which for given matrix A ∈ Rm×n and b ∈ Rm decides whether there exists x ∈ Rn with Ax ≥ b. I know that Steve Smale's lists some of the unsolved problems in mathematics. But…
Krebto
  • 244
  • 3
  • 13
12
votes
4 answers

Is there an algorithm whose time complexity is between polynomial time and exponential time?

We often hear about some algorithms' running time that is polynomial, and some algorithms' running time that is exponential. But is there an algorithm whose time complexity is between polynomial time and exponential time?
lz9866
  • 317
  • 2
  • 6
10
votes
2 answers

Why do we say that polynomial time is easy?

For years, I've been told (and I've been advocating) that problems which could be solved in polynomial time are "easy". But now I realize that I don't know the exact reason why this is so. Intuitively, I can guess what the relation between P…
jack
  • 101
  • 3
9
votes
3 answers

Why are most (or all?) polynomial time algorithms practical?

I read an interesting comment in a paper recently about how weirdly useful maths turns out to be. It mentions how polynomial time doesn't have to mean efficient in reality (e.g., $O(n^{999999999999999999999})$ is polynomial time, but not efficient).…
Arnold
  • 91
  • 2
1
2 3
29 30