Asymptotic analyses of the space needed to run algorithms.
Questions tagged [space-complexity]
507 questions
4
votes
0 answers
Understanding an example of an EXP-SPACE Problem
I am trying to understand the example given here of an EXP-SPACE time decision problem.
They write :
An example of an EXPSPACE-complete problem is the problem of
recognizing whether two regular expressions represent different
languages, where…

IntegrateThis
- 239
- 2
- 11
4
votes
2 answers
Proving language in Space Complexity
I'd like to know if I have the right intuition and my answer is headed the correct way.
I am given a function
$ f = \{0, 1\}^* \rightarrow \{0, 1\}^* $ that is computable in space $O(\log n)$ assume that for every $x \in \{0, 1\}^*$, $f$ is length…

Shadower2222
- 43
- 3
3
votes
1 answer
How hard are PSPACE-complete problems?
There are already good answers from several perspectives regarding the "hardness" of $PSPACE$-complete problems, such as this: What is practical difference between NP and PSPACE-complete?
But what are the practical implications when we actually try…

Duke
- 133
- 4
2
votes
1 answer
What is tight NSPACE complexity of $ALT\text{-}SPACE(a(n),s(n))$?
According to Ryan Williams's answer $ALT\text{-}SPACE(a(n),\log n)\subseteq NSPACE(a(n)\log n)$.
Does there exist any better bound (for example something like $ALT\text{-}SPACE(a(n),\log n)\subseteq NSPACE(\log (a(n))\log n)$), or is it tight or an…

Mohsen Ghorbani
- 537
- 4
- 12
2
votes
1 answer
Why is it necessary to use binary numbers in logspace?
I have noticed that a lot of problems that are in L and NL use binary numbers. I don't understand why this is the case. Does a TM use less space by storing a binary number, than a "normal" one. In my head, it uses less space to store the number 0,…

user2795095
- 409
- 1
- 6
- 14
2
votes
1 answer
Parts of a function used in Space Complexity
I'm finding contradictory information online where some places only consider auxiliary space and others define it as
Space Complexity of an algorithm is total space taken by the algorithm with respect to the input size. Space complexity includes…

worbel
- 145
- 7
1
vote
2 answers
STCON in L using matrix multipication algorithm?
I'm trying to understand why the following is incorrect.
Given a $STCON$ problem, specifically a graph and nodes $(G, s, t)$, we can assume we are given it's adjacency matrix, $A$. By adding self-loop (filling the main diagonal with $1$'s) we can…

galah92
- 327
- 1
- 10
1
vote
1 answer
Space complexity problem, relation between $DSPACE(log^kn)$ and $DSPACE(log^{k+1}n)$
I need help with the following:
Let $k\in \mathbb{N}$, define:
$L^k=DSPACE(O(log^k(n)))$
$NL^k=NSPACE(O(log^k(n)))$
and:
$PolyL=\bigcup_{k=1}^{\infty}L^k$
$PolyNL=\bigcup_{k=1}^{\infty}NL^k$
I need to prove, disprove or to determine if it is an…

so.very.tired
- 1,219
- 1
- 15
- 20
1
vote
1 answer
Is in-place run length encoding possible in O(1) space given that the output is shorter than the input?
This is inspired by a problem from here. This is the approximate form of the problem:
Given a string like "aaaa777cbb" (10 symbols long), run length encode it in-place to a string like "a473c1b2" (8 symbols long). You are guaranteed that the input…

9072997
- 113
- 4
1
vote
1 answer
Nondeterministic Logarithmic-space in directed graph
I continue to learn the complexity myself, currently I am interested in the complexity of space. I have read several books and tried some exercises as a practice. I would like to have your idea on the following problem.
Show that the problem of the…

jenny forock
- 55
- 4
1
vote
2 answers
Logspace algorithm for balanced parentheses problem
Currently I want to learn the complexity of space, I read a few of the books on it. On this I encountered this example problem. I would just like to know how to show that the following problem $\in L $ (deterministic logarithmic space).
Input: …

jenny forock
- 55
- 4
1
vote
1 answer
Space efficient representation of Regular graphs
Let $G$ be a $k$-regular graph (each vertex have a degreee $k$). It is trivial to store the graph in $O(\log n)$ space or words such that $j$th neighbour of any vertex can be found in $O(\log n)$ time. Assume that neighbours of each vertex are…
user110834
0
votes
0 answers
$A\in LSPACE \Longrightarrow CYCLE(A)\in LSPACE$
Let $A$ be a language and define $$ CYCLE(A)= \{ yx | xy \in A \} $$ I need to prove, or disprove, $ A\in LSPACE \Longrightarrow CYCLE(A)\in LSPACE $.
First I tried to prove $CYCLE(A) \le_{L} A$ which if true means that if $A\in LSPACE$ then…

CforLinux
- 261
- 1
- 8
0
votes
1 answer
Difficulty understanding the CANYIELD function in the Sipser text's proof of Savitch’s theorem
I was wondering whether someone could help me resolve an issue I have understanding the proof given for Savitch’s theorem in the Sipser text (3rd edition). The question I have is more or less identical to the first question given in a previous post…

SGR
- 51
- 4
0
votes
1 answer
What is space complexity of shrinking one array to increase another?
Say I have an array and I want to add those values to something else. What is the space complexity if I incrementally take one of those values off the first list and add it to the second? For example, I'm trying to convert a list to a string. I know…

jss367
- 101
- 1