instruction stringlengths 0 29.8k ⌀ |
|---|
null |
I asked this [question][1] at generic stackoverflow and I was directed here.
It will be great if some one can explain how to approach partial or fully dynamic graph problems in general.
For example:
- Find Shortest Path between two vertices $(u,v)$ in a undirected weighted graph for $n$ instances, when an edg... |
Dynamic graph models have been studied intensively in distributed computing. For distributed algorithms, the computation is structured into rounds and the topology of graphs (=network) might undergo some changes from round to round, which are under control of an adversary. Moreover, every node of the graph runs an algo... |
It's hard to give you concrete techniques because "dynamic" could mean a wide variety of things, and the algorithms/results depend on your model. Below is an overview of the concerns. [Here][1] is a paper that gives an overview of some different concerns and models (related to what Peter cited in another answer).
--... |
null |
I'd love your help with the following question:
> Let $G$ be free context grammar in the **chomksy normal form** with K
> variables.
>
> Does the language $B = ${$ w \in L(G) : |w| >2$} Regular ?
What is it about the amount of variables and the Chomsky normal form that suppose to help me solve this question? ... |
Chomsky normal form and regular languages |
|regular-languages|context-free| |
My book states this
> **If decision problem B is in P and**
>
> A reduces to B
>
> then decision problem A is in P
>
> **Problem B is NP complete if**
>
> B is in NP
>
> Every problem in A in NP, A reduces to B
>
> **Problem C is NP complete if**
>
> C is in NP
>
> For some NP Compete probl... |
All NP problems transform to NP Complete |
|np-complete| |
Is it possible that the transformation is correct but pointless? According to http://en.wikipedia.org/wiki/Barnette%27s_conjecture "If a planar graph is bipartite and cubic but only 2-connected, then it may be non-Hamiltonian, and it is NP-complete to test Hamiltonicity for these graphs.[4]" (just possibly taken out of... |
I'm trying to solve a problem for class that is stated like so:
> A bipartite graph is an undirected graph in which every cycle has even
> length. We attempt to show that the Hamiltonian cycle (a cycle that
> passes through each node exactly once) problem polynomially reduces to
> the Hamiltonian cycle problem i... |
Finding the flaw in a Hamiltonian cycle reduction to a Hamiltonian cycle reduction with bipartitie graphs |
|np-complete| |
> If B or C is in NP Complete, and all problem in NP reduce to an NP Complete problem, using the first rule, how can any NP problem not be NP complete?
The first rule is about problems in P. It has nothing to do with NP completeness. If problem A is NP Complete and problem B reduces to A, that does **not** mean that... |
<b>Logical Min Cut (LMC) Problem:</b> Suppose that G = (V, E) is an unweighted digraph, s,t are two vertices of V, and t is reachable from s. LMC Problem states that how we can make t unreachable from s by the removal of some edges of G but following two constraints: (1) the number of the removed edges must be minimal ... |
Is Logical Min-Cut(special case of s-t min-cut), NP-Complete? |
|np-complete| |
I'd love your help with the following question:
> Let $G$ be free context grammar in the **Chomksy normal form** with $K$
> variables.
>
> Is the language $B = \{ w \in L(G) : |w| >2 \}$ regular ?
What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this quest... |
null |
I'd love your help with the following question:
> Let $G$ be context free grammar in the **Chomksy normal form** with $K$
> variables.
>
> Is the language $B = \{ w \in L(G) : |w| >2 \}$ regular ?
What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this quest... |
|formal-languages|regular-languages|context-free|formal-grammars| |
Is it possible that the transformation is correct but pointless? Consider [Barnette's conjecture](http://en.wikipedia.org/wiki/Barnette%27s_conjecture):
> If a planar graph is bipartite and cubic but only 2-connected, then it may be non-Hamiltonian, and it is NP-complete to test Hamiltonicity for these graphs.
(p... |
I'd love your help with the following question:
> Let $G$ be context free grammar in the **Chomksy normal form** with $K$
> variables.
>
> Is the language $B = \{ w \in L(G) : |w| >2 \}$ regular ?
What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this quest... |
I'm trying to solve a problem for class that is stated like so:
> A bipartite graph is an undirected graph in which every cycle has even
> length. We attempt to show that the Hamiltonian cycle (a cycle that
> passes through each node exactly once) problem polynomially reduces to
> the Hamiltonian cycle problem i... |
|np-complete|reductions| |
I'd love your help with the following question:
> Let $G$ be context free grammar in the **Chomksy normal form** with $k$
> variables.
>
> Is the language $B = \{ w \in L(G) : |w| >2^k \}$ regular ?
What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this que... |
Assuming that $B$ is regular, then $L(G)=B \cup \lbrace w \in L(G) \mid \vert w \vert \leq 2^k \rbrace$ is also regular because the union of a finite number of regular languages is regular (especially, $k$ is a constant as the number of variables in the Chomsky normal form).
This can not be true in general because... |
Finding the flaw in a reduction from Hamiltonian cycle to Hamiltonian cycle on bipartitie graphs |
I'd love your help with the following question:
> Let $G$ be context free grammar in the **Chomksy normal form** with $k$
> variables.
>
> Is the language $B = \{ w \in L(G) : |w| >2^k \}$ regular ?
What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this que... |
Do you know any algorithm that calculates the factorial after modulus efficiently?
For example, I want to program:
for(i=0; i<5; i++)
sum += factorial(p-i) % p;
But, `p` is a big number (prime) for applying factorial directly $(p \leq 10^ 8)$.
In Python, this task is really easy, but i really wan... |
null |
The problem is that a Hamiltonian cycle has to pass through **all** vertices: if the cycle in the original graph does not take some edge $e$, then the vertex you split $e$ with will not be taken if you take the same route. This means that the resulting cycle is not Hamiltonian. |
I'm trying to solve a problem for class that is stated like so:
> A bipartite graph is an undirected graph in which every cycle has even
> length. We attempt to show that the Hamiltonian cycle (a cycle that
> passes through each node exactly once) problem polynomially reduces to
> the Hamiltonian cycle problem i... |
### Logical Min Cut (LMC) problem definition
Suppose that $G = (V, E)$ is an unweighted digraph, $s$ and $t$ are two vertices of $V$, and $t$ is reachable from $s$. The LMC Problem studies how we can make $t$ unreachable from $s$ by the removal of some edges of $G$ following the following constraints:
1. The num... |
Is Logical Min-Cut (special case of s-t min-cut) NP-Complete? |
|np-complete|graphs| |
My book states this
> * If a decision problem B is in P and
> A reduces to B,
> then decision problem A is in P.
> * A decision problem B is NP-complete if
> B is in NP and
> for every problem in A in NP, A reduces to B.
> * A decision problem C is NP-complete if
> C is in NP and
> for some NP-co... |
All NP problems reduce to NP-complete problems: so how can NP problems not be NP-complete? |
|complexity-theory|np-complete|decision-problem| |
I would like your help with the following question:
> Let $L$ be a language, and operator $A(L)=${$ww^Rw | w \in L and
> |w|<2007$} where $x^R$ is the reversed string of $x$, Which of the
> following statements are correct?
>
> 1.If $L$ is regular so A(L) is regular, 2. If $L$ is a CFL whcich is not regular th... |
Regular languages: The operator $A(L)=${$ww^Rw | w \in L and > |w|<2007$} |
|formal-languages|regular-languages|context-free| |
I would like your help with the following question:
> Let $L$ be a language, and operator $A(L)=${$ww^Rw | w \in L \wedge
> |w|<2007$} where $x^R$ is the reversed string of $x$, Which of the
> following statements are correct?
>
> 1.If $L$ is regular so A(L) is regular, 2. If $L$ is a CFL whcich is not regular... |
Regular languages: The operator $A(L)=${$ww^Rw | w \in L \wedge |w|<2007$} |
null |
I would like your help with the following question:
> Let $L$ be a language, and operator $A(L)=${$ww^Rw \mid w \in L \wedge
> |w| \lt 2007$} where $x^R$ is the reversed string of $x$, Which of the
> following statements are correct?
>
> 1. If $L$ is regular so A(L) is regular.
> 2. If $L$ is a CFL whcich i... |
Regular languages: The operator $A(L)=${$ww^Rw \mid w \in L \wedge |w| \lt 2007$} |
Since $|w| < 2007$, the number of string like $ww^Rw$ is finite. So $A(L)$ is finite for all $L$ hence is regular. |
I would like your help with the following question:
> Let $L$ be a language, and operator $A(L)=${$ww^Rw \mid w \in L \wedge
> |w| \lt 2007$} where $x^R$ is the reversed string of $x$, Which of the
> following statements are correct?
>
> 1. If $L$ is regular so A(L) is regular.
> 2. If $L$ is a CFL whcich i... |
Do you know any algorithm that calculates the factorial after modulus efficiently?
For example, I want to program:
for(i=0; i<5; i++)
sum += factorial(p-i) % p;
But, `p` is a big number (prime) for applying factorial directly $(p \leq 10^ 8)$.
In Python, this task is really easy, but i really wan... |
Please, help me to understand how to get resolve this problem (algorithm problem). The problem is the letter H in this paper [enter link description here][1]. I'm programming the heapsort algorithm.
The next code is my implementation, and if it run, you can test for the solution of problem is very slow, slow ( for ... |
Analysis to cases of HeapSort (?) |
|algorithms|algorithm-analysis|sorting| |
|complexity-theory|np-complete|reductions| |
|complexity-theory|graphs|np-complete| |
|algorithms|data-structures|algorithm-analysis|sorting| |
I'm working on problem H in the [ACM ICPC 2004–2005 Northeastern European contest](http://neerc.ifmo.ru/past/2004/problems/problems.pdf).
The problem is basically to find the worst case that produces a maximal number of exchanges in the algorithm (sift down) to build the heap.
* Input: Input file contains $n$ ($1... |
Finding a worst case of heap sort |
null |
Do you know any algorithm that calculates the factorial after modulus efficiently?
For example, I want to program:
for(i=0; i<5; i++)
sum += factorial(p-i) % p;
But, `p` is a big number (prime) for applying factorial directly $(p \leq 10^ 8)$.
In Python, this task is really easy, but i really wan... |
null |
> If A reduces to B, does B reduce to A?
No. For a really contrived example, any possible computable problem A is reducible to the Halting Problem: just pass as input the algorithm that solves the problem A but with a `while(true)` tacked at the end after either the true or false case. However, we know that the Halt... |
null |
NOTE: Due to the fact that the trip does not end at the same place it started and also the fact that every point can be visited more than once as long as I still visit all of them, this is not really a TSP variant, but I put it due to lack of a better definition of the problem.
This problem was originally posted on ... |
Approximation algorithm for TSP variant, fixed start and end anywhere but starting point + multiple visits at each vertex ALLOWED |
|algorithms|graphs|approximation| |
null |
You have three options in general: The first one is to **consider special cases of your problem**. In some special cases, your problem might be solvable poynomially e.g. determining whether there exists a simple path from _vi_ to _vj_ to _vk_ in an arbitrary directed graph _G_ is NP-Complete but it will be polynomial(l... |
Given the worst-case for $n$, we can construct the worst-case for $n+1$ as follows: we do a 'swap cycle' as follows: we take $n+1$, put it in $a[0]$, and we swap $a[0]$ with the maximal element of its children, which is $a[1]$ or $a[2]$, which we again swap with the maximum element of its children and so on, until we l... |
|algorithms|complexity-theory|graphs|approximation| |
Since $|w| < 2007$, the number of strings like $ww^Rw$ is finite. So $A(L)$ is finite for all $L$ and is hence regular. |
I would like your help with the following question:
> Let $L$ be a language, and operator $A(L)=\{\,ww^Rw \mid w \in L\ \wedge\ |w| \lt 2007\,\}$ where $x^R$ is the reversed string of $x$. Which of the
> following statements are correct?
>
> 1. If $L$ is regular so $A(L)$ is regular.
> 2. If $L$ is a CFL whi... |
Is Logical Min-Cut NP-Complete? |
Closure against the operator $A(L)=\{ww^Rw \mid w \in L \wedge |w| \lt 2007\}$ |
|formal-languages|regular-languages|context-free|closure-properties| |
First, this can be solved by linear programming. Let $x_1$, $x_2$, $\ldots$, $x_n$ be your variables. The linear program that solves your question is then
$\max t$
subject to
$t \leq x_i$, for $i=1 ... n$,
$Ax = 0$.
If the maximum is 0, then there is no positive solution. If the maximum is $\infty$ (i.e.... |
I'd really love your help with the following:
For **any** $L_2$ I need to decide whether there is a closure under the following operators:
1.{$x| \exists y \in L_2 : xy \in L$}
2.{$x| \exists y \in L : xy \in L_2$}.
The relevant options are:
(a)"Regular languages closed under $A$, for any language $L_2... |
For any language $L_2$: Closure under {$x| \exists y \in L_2 : xy \in L$} VS {$x| \exists y \in L : xy \in L_2$} |
|formal-languages|regular-languages|closure-properties| |
First, this can be solved by linear programming. Let $x_1$, $x_2$, $\ldots$, $x_n$ be your variables. The linear program that solves your question is then
$\max t$
subject to
$t \leq x_i$, for $i=1 ... n$,
$Ax = 0$.
If the maximum is 0, then there is no positive solution. If the maximum is $\infty$ (i.e.... |
> Are there techniques and/or software tools that can be used to
> construct hard instances of a simple puzzle game (or a simple planning
> problem)?
With "hard" I mean that any solution of the instance is "long" with respect to the input size.
What I have in mind:
- model the puzzle game using a [constrai... |
Techniques/tools for constructing hard instances of a puzzle game |
null |
I'd really love your help with the following:
For **any** $L_2$ I need to decide whether there is a closure under the following operators:
1.{$x| \exists y \in L_2 : xy \in L$}
2.{$x| \exists y \in L : xy \in L_2$}.
The relevant options are:
(a)"Regular languages closed under $A$, for any language $L_2... |
Does there exist undecidable languages A and B such that the concatenated language $A \cdot B$ is decidable? |
Concatenation of undecidable languages |
|formal-languages| |
Yes, let $H$ be binary encoding of the halting problem and $A=0H\cup 1\{0,1\}^{\ast}\cup\{\epsilon\}$, $B=1H\cup0\{0,1\}^{\ast}\cup \{\epsilon\}$, then $AB=\{0,1\}^{\ast}$ (why?) |
I don't know how to solve your problem or show its NP-Hardness but you can find all pair shortest path to convert your graph to metric one, just replace $e_{a,b}$ with shortest path from a→b, Also by this way your graph will be converted to complete graph, now you can run some approximation for TSP to find approxi... |
I don't know how to solve your problem or show its NP-Hardness but you can find all pair shortest path to convert your graph to metric one, just replace $e_{a,b}$ with shortest path from a→b, Also by this way your graph will be converted to complete graph, now you can run some approximation for TSP to find approxi... |
I'd really love your help with the following:
For **any** $L_2$ I need to decide whether there is a closure under the following operators:
1.$A(L)$={$x| \exists y \in L_2 : xy \in L$}
2.$A(L)=${$x| \exists y \in L : xy \in L_2$}.
The relevant options are:
(a)"Regular languages closed under $A$, for any... |
I don't know how to solve your problem or show its NP-Hardness but you can find all pair shortest path to convert your graph to metric one, just replace $e_{a,b}$ with shortest path from a→b and if there is n't edge between $a,b$ add new edge with shortest path weight, now you can run some approximation for TSP to... |
I'm working on problem H in the [ACM ICPC 2004–2005 Northeastern European contest](http://neerc.ifmo.ru/past/2004/problems/problems.pdf).
The problem is basically to find the worst case that produces a maximal number of exchanges in the algorithm (sift down) to build the heap.
* Input: Input file contains $n$ ($1... |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.