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
1
vote
1 answer

Computational Complexity for lower triangular matrices

I am trying to find the complexity $$ l_{ij} = \frac{1}{l_{jj}} \left(a_{ij} - \sum l_{jk} l_{ik} \right). $$ I have considered $a_{ij} - \sum \ldots$ as being one operation, $l_{jk} \times l_{ij}$ as another one and finally the whole divided by…
1
vote
1 answer

Understanding of what it means to say that a question is in NP

Let's say the the function $f$ can be evaluated in polytime in the size of the input $x$. Are the following problems in NP? Is there an $x$ such that $f(x) = y$ for a particular value of $y$? Find an $x$ such that $f(x) = y$ for a particular value…
1
vote
1 answer

VP Definition: Why polynomial bound on the degree?

The complexity class $\mathbf{VP}$ (Valiant P) is defined to be the class of all polynomials of polynomially bounded degree which can be realized by an arithmetic circuit family with polynomially bounded size. My questions are: Why do we require…
1
vote
1 answer

Runtime-complexity of a pseudo code.

Give an analysis of the running time of the following code snippet. sum = 0 for (i = 0; i < n; i++) for (j = 0; j < n; j++) if (j < i) { for(k = 0; k < j ; k++) ++ sum The outer loop is simple, it can be represented as…
1
vote
1 answer

Estimate logarithmic complexity

I have data (running time $T$ and problem size $N$). If I suspect that there is a polynomial relationship in the form $T=a N^b$, I can plot a log-log graph and work out the gradient, as stated on the wikipedia article:…
1
vote
0 answers

A Complexity Problem of Cliques

I've been trying to figure out the Karp Reduction $$CLIQUE(G,k) \preceq IND(G,k),$$ Where $CLIQUE(G,k)$ is the decision problem "Is there a clique of size at least $k$ in the graph $G$" and $IND(G,k)$ is the decision problem ``Is there an…
Dan
  • 11
1
vote
0 answers

existence of $DLOGTIME$-complete problems

Just curious - is there any problem that can be considered as $DLOGTIME$-complete? Or if not, has it been proven that there does not exist a complete class? (By being complete, I mean that it has lower time/space reduction available - as used…
user2346
  • 631
  • 2
  • 7
  • 14
1
vote
1 answer

RE problems that are neither RE-complete nor recursive

As stated, is there any decision problems in the complexity class RE that are neither RE-complete nor recursive? It seems that almost all of nonrecursive RE problems are in RE-complete...
user2346
  • 631
  • 2
  • 7
  • 14
1
vote
3 answers

What's the difference between $t(n^2)$ and $t^2(n)$

Theorem: For every multitape Turing Machine algorithm that takes time $t(n)$, there is an equivalent single tape Turing Machine that takes time $t^2(n)$ I am curious why we say $t^2(n)$ and not $t(n^2)$ and what's the difference. Thanks!
1
vote
1 answer

Can somebody explain what inclusions of complexity classes (such as $DTIME$ or $DSPACE$) mean?

I am trying to understand what book is saying: Let $S(n) \leq log(n). Then$ $$DTIME(T(n)) \subseteq DSPACE(T(n))$$ $$NTIME(T(n)) \subseteq NSPACE(T(n))$$ $$DSPACE(S(n)) \subseteq DTIME(2^{O(S(n))})$$ $$NSPACE(S(n)) \subseteq…
1
vote
2 answers

Does $O(n\cdot n!) = O(n!)$?

Does $O(n\cdot n!) = O(n!)$? I know that $n*n! < (n+1)!$, and in Big Oh we usually throw out constants, so it seems like we could make this conclusion. However I am not sure how to show this mathematically.
flubsy
  • 731
1
vote
1 answer

Descriptive Complexity Theory - operator, structure and iteration?

In descriptive complexity theory, FO is the set of properties (problem) expressible by first-order logic. I get this part, but what are all these transitive operators and some structures? From Wikipedia: First-order logic defines the class FO,…
user2346
  • 631
  • 2
  • 7
  • 14
1
vote
1 answer

Complexity class that is the set of languages expressible by first-order logic

PH is the complexity class that is the set of languages expressible by second-order logic. If so, is there any complexity class that is the set of languages expressible by first-order logic? It seems likely that R is the complexity class that is the…
user2346
  • 631
  • 2
  • 7
  • 14
1
vote
1 answer

The time complexity of the n-ary cartesian product over n sets

Recall that the Cartesian product $A\times A$ is defined as the set $\lbrace (x,y):x\in A ,y \in A \rbrace$ . Thus, if for example, $A=\lbrace 1,2,3 \rbrace$,$A \times A=\lbrace(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)\rbrace$, then the…
1
vote
0 answers

Prove that $S_2$ is closed under union and complement

I'm having trouble proving that $S_2$ is closed under union and complement, even though in this Wikipedia article it says that: It is immediate from the definition that $S_2$ is closed under union and complement. I think that my problem is due to…
Cauthon
  • 389
  • 3
  • 16