Questions tagged [computational-complexity]

Use for questions about the efficiency of a specific algorithm (the amount of resources, such as running time or memory, that it requires) or for questions about the efficiency of any algorithm solving a given problem.

Computational complexity is a part of theoretical computer science that answers questions about how efficient an algorithm is:

  • How much time (as a function of the size of the input) does the algorithm take to produce its output?
  • How much space (such as computer memory) does it require?
  • How much of some other resource does it consume? (For example, this can be the size of a logic circuit solving the problem, or the number of bits of randomness used by a probabilistic algorithm.)

We can similarly ask about the computational complexity of any algorithm that solves a given problem.

Often, very specific details of these answers (such as constant factors or additive terms) depend on specific details such as the computer you're using. To help deal with this, we often stick to determining the asymptotic complexity of an algorithm: see for more details.

A major problem in computational complexity is the P versus NP problem, which asks if a certain class of problems can be solved by an algorithm that runs in a number of steps that's a polynomial function of the input size.

3433 questions
0
votes
0 answers

possibility, importance and order-optimality of algorithms

Evaluate below claims of the problems and their algorithms in terms of possibility, importance and order-optimality. Problem A has worst-case lower bound $\Omega(n^{2})$ and there is an algorithm with $W(n) \in \mathcal{O}(n)$. Problem B has sharp…
user516334
0
votes
2 answers

Time complexity and optimality

If a problem has worst-case lower bound Ω(n^2) and there is an algorithm with W(n) ∈ O(n), What can we say about the possibility, importance and order of optimality about this problem and algorithm?
0
votes
0 answers

What is meant by time $y^{1 + o(1)}$?

I don't understand what is meant by the following use of little-oh. The most obvious method to find small prime divisors of $n$ is trial division: divide $n$ by $2, 3, 5,$ etc. This takes time $y^{1 + o(1)}$ if $n$ has $y^{o(1)}$ bits. (Daniel…
0
votes
2 answers

How do I prove that that $n \geq \log_2(n) ^{(\log_2(\log_2(n))}$ as n becomes large?

More specifically, I am trying to show that the asymptotic complexity of a problem with that has the bounds $\Theta(\log{2}(n) ^{(\log_2(\log_2(n))})$ is less than that of a problem with the bounds $\Theta(n)$. I tried to use L'Hospital's rule but…
0
votes
1 answer

Show that if $f(2n) \le Cf(n)$ for large enough $n$, where $f:N \to N$. Then $f(n)$ is asymtotically bounded by a polynomial?

Show that if $f(2n) \le Cf(n)$ for large enough $n$, where $f:N \to N$. Then $f(n)$ is bounded by a polynomial? Some suggestions? I tried using the Master theorem but I didn't get some convincent.
prachu
  • 1
  • 1
0
votes
1 answer

Set cover problem with constant 2

I have a question about the Set Cover problem: If I get a universe U, m subsets that the size of each subset is exactly 2, and an integer k. Is this problem is still NP-C or I can solve it on a polynomial time? Thanks.
Rbix
  • 13
0
votes
1 answer

Can we determine which algorithm runs faster just by looking at their asymptomatic rate?

Ok so lets say that the asymptotic execution time of an algorithm B is greater than the asymptotic execution time of an algorithm A . Τ(Ν)Β = c1*f(N)B > Τ(Ν)A = C2*f(N)A for c1 and c2 that make the equals statement true Can we say that as n(input)…
0
votes
1 answer

Color-Coding Computational-Complexity question: Why is $ \left| \frac{1}{ln(1-e^{-k})} \right| \in \mathcal{O}(e^k) $

In a paper about color-coding they estimate the complexity of coloring trials needed to achieve an $\varepsilon$-error for $k\in \mathbb{N}$: $$ \left\lceil\frac{ln(\varepsilon)}{ln{(1-k!/k^k)}} \right\rceil = |ln(\varepsilon)| \cdot…
otori
  • 33
0
votes
1 answer

Quantified CNF: is not this a proof that NP = PSPACE?

If boolean formula $f$ is in CNF it is known that:$$\forall x \exists y_1 \exists y_2 .. \exists y_n : f(x, y_1, y_2..y_n) :\iff \exists y_1 \exists y_2 .. \exists y_n : f(0, y_1, y_2..y_n) \land f(1, y_1, y_2..y_n) :\iff \exists y_1 \exists y_2 ..…
rus9384
  • 411
0
votes
0 answers

Equivalence for Turing machine and circuit

Let $M$ be a deterministic Turing Machine over $\{0, 1\}$ which halts on every input. Let's consider the following problem: It is given boolean circuit $C$. $C$ has $n$ input gates. Problem: Is the $C$ equivalent to $M$ for words of $n$…
user376326
0
votes
1 answer

time complexity for my function

What is the time complexity for the following function? (the basic operation is the innermost loop body's assignment). function f(n) r ← 0 m ← 1 for i ← 1 to n do m ← 3 × m for j ← 1 to m do r ← r + j …
Hamideh
  • 115
0
votes
1 answer

Can an NP-complete problem have an infinite number of solutions?

I have read somewhere (I cannot find the source now unfortunately) that an NP-complete problem can only have exponentially many solutions. But this does not make sense to me.. For instance, even a polynomial problem can have an infinite number…
hamster
  • 79
0
votes
2 answers

What is the complexity of given problem?

I have found the solution to be nLogn but i dont know if i am correct! for i in range(n): for j in range(log(i)): #some operation O(1)
0
votes
0 answers

Why do we call Turing reductions many-one reductions?

Why do we call Turing reductions many-one reductions? I looked the origin of many-one notation on Google but found nothing.
oobarbazanoo
  • 141
  • 7
0
votes
1 answer

When is k^k = poly(n)?

When does $k^k = \mathrm{poly}(n)$? More specifically, does $$ k^k = \mathrm{poly}(n) \impliedby k = \mathcal O\left( \frac{\log n}{\log \log n} \right) $$ hold? I saw that $$ k! = \mathrm{poly}(n) \impliedby k = \mathcal O \left( \frac{\log n}{\log…
Molenii
  • 43
  • 4