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
2
votes
1 answer

problem about computational complexity

Exercise: Prove that the computational complexity of the binomial coefficient \begin{equation*} \binom{m}{n} \end{equation*} is O($m^{2}$$\log^{2}n$). using the fact that the computanional complexity of the product of s+1 integers is…
Bar
  • 91
2
votes
1 answer

Definition of Complexity Classes

The definitions I've seen for 'complexity class' all seem to be variations on "the set of problems that can be solved by an abstract machine of type $M$ using $O(f(n))$ of resource $R$, where $n$ is the size of the input" (Wikipedia). Papadimitriou…
2
votes
1 answer

Will a problem be polynomial time solvable if a mathematician gives a procedure?

For a decision problem, if a mathematician finds a simple polynomial time procedure that solves it, does it mean that the problem is polynomial time solvable? For example, consider a decision problem: whether there exists a vector $(x_1, x_2, ...,…
Leon
  • 21
2
votes
2 answers

Time complexity of taking duplicates out of a set

Imagine an algorithm, that takes a set as input, and returns that set, but without duplicates, as output. The algorithm is bruteforce, it goes through each element in the input set, and one-by-one compares it to all elements in the output set. If…
2
votes
1 answer

Does this imply finding the first $n$ primes has a polynomial time complexity?

To clear up confusion, I'm talking about finding the first $n$ primes in the sequence, $p_1, p_2...p_n...\infty$ without being given this list prior. This is by no means a rigorous attempt at a proof, just a shower thought: It is widely known that…
2
votes
1 answer

What problems are known to be require superpolynomial time or greater to solve?

I'm having a hard time finding problems that known to require greater than polynomial time to solve (superpolynomial), particularly in graph theory. So, what problems (or better yet, class of problems) have been proven to require superpolynomial…
2
votes
1 answer

Special case connectivity in LOGSPACE

Consider a grid, $N x N$ in size, with cells colored white or black. It can be encoded naturally by a word from $\{0,1\}^{n^2}$. Show that a deterministic Turing machine with logarithimic memory can decide if there exists a monochromatic path from…
blu
  • 23
2
votes
0 answers

Approximation of Job Scheduling

Consider the following vorace algorithm for Job Scheduling. For each new task, assign the task to processor with the shortest uptime. how prove that this algorithm has a approximation ration of 2 ? Suppose that once the algorithm is completed,…
2
votes
0 answers

Polynomial hierarchy

While familiarizing myself with polynomial hierarchy, I used this book which is written by Ingo Wegener on page 132. Now I'm practicing and I met this exercise : Let us consider a Boolean formula $\phi$ on the variables $x_1, ...,x_n$. Each $n$ bit…
tala
  • 21
2
votes
2 answers

Automated proof-checking machine

In the future, theoretically, is it possible to make an automated proof-checking machine? It means, given mathematical axioms and definitions, the computer can decide that a proof is correct or not, even though the proof is very complex. Some…
2
votes
1 answer

Does RP complexity class (usually) mean decidable or recognizable?

Sipser's Introduction to the Theory of Computation defines $P$ complexity class as decided by a deterministic TM in polynomial time, and $NP$ as decided by nondeterministic TM in polynomial time. However: DEFINITION 10.10: $RP$ is the class of…
Ilya
  • 273
2
votes
1 answer

How to find the average case complexity of Stable marriage problem(Gale Shapley)?

Stable marriage problem So I know that the worst case complexity will be of the order O(n^2) and the best case is of the order O(n). But how can I calculate the average case complexity
2
votes
0 answers

complexity of time constructible function

In field of computational complexity there is a definition of time constructible function. As example, in any reasonable and general model, functions like $t_1(n) = n^2, t_2(n) = 2^n$, and $t_3(n) = 2^{2^n}$ are computable in $poly(\log t_i (n))$…
com
  • 5,612
2
votes
3 answers

Improper proof that $P \neq NP$

Describe the error in the following fallacious “proof” that $P \neq NP$ . Assume that $P = NP$ and obtain a contradiction. If $P = NP$, then $SAT \in P$ and so for some $k$, $SAT \in TIME(n^k )$. Because every language in $NP$ is polynomial…
user376326
2
votes
1 answer

Finding maximum of array consisting of an exponential amount of positive integers

Consider an array of an exponential amount of positive integer numbers, let's say $$ x_1, x_2, \ldots, x_{2^k} $$ for some fixed positive integer $k$. The question is the following. What is the computational complexity of the problem of finding the…