instruction stringlengths 0 29.8k ⌀ |
|---|
I am not sure I see it. From what I understand, edges and vertices are compliments for each other and it is quite surprising that this difference exists.
Is there a good / quick / easy way to see that in fact finding a Hamiltonian path should be much harder than finding a Euler path? |
Is it intuitive to see that finding a Hamiltonian path is not in P while finding Euler path is? |
|graphs|np-complete| |
Here's one quick way of looking at it. The HAM-PATH problem is $\mathsf{NP}$-complete, so currently we do not if it can be solved in polynomial time or not. At least nobody has come up with such an algorithm. The Eulerian path problem on the other hand is provably in $\mathsf{P}$ since we have polynomial time algorithm... |
Maybe the following perspectives helps:
When you are trying to construct a Eulerian path, you can proceed almost greedily. You just start the path somewhere and the try to walk as long as possible. If you detect a circle, you will delete its edges (but record that this circle was constructed). By this you decompose ... |
As i was going through the greedy approach , i came to know that a knowledge on matroids (greedoids) will help me approaching the problem properly.. but after reading the matroids i have roughly understood the matroid meaning .but now how to implement the concept of matroid for solving the problems of optimization... .... |
Greedy choice and matroids (greedoids) |
|greedy-algorithms| |
null |
I think I nailed the problem down. In essence: using Landau terms decouples the variable of the summand function from the sum's running variable. We still (want to) read them as identical, though, therefore the confusion.
To develop it formally, what does
$\qquad \displaystyle S_n \in \sum_{i=1}^n \Theta(f(i)) \... |
I think I nailed the problem down. In essence: using Landau terms decouples the variable of the summand function from the sum's running variable. We still (want to) read them as identical, though, therefore the confusion.
To develop it formally, what does
$\qquad \displaystyle S_n \in \sum_{i=1}^n \Theta(f(i)) \... |
I think I nailed the problem down. In essence: using Landau terms decouples the variable of the summand function from the sum's running variable. We still (want to) read them as identical, though, therefore the confusion.
To develop it formally, what does
$\qquad \displaystyle S_n \in \sum_{i=1}^n \Theta(f(i)) \... |
null |
Consider the [minimum spanning tree problem](https://en.wikipedia.org/wiki/Minimum_spanning_tree) with positive edge weights¹. We will show that there is a matroid corresponding to that problem, implying that it can be solved greedily, that is by the canonical greedy algorithm on said matroid.
Let $G = (V,E,c)$ be a... |
You are probably thinking of the problem of determining whether a given solution to the TSP is the **best** solution. However, in order to know this, you must know the cost of all other possible paths (requires $O(n!)$ time to compute), which means that this problem is in NP, but not NP-Complete.
The TSP *Decision ... |
As I was going through the material about the greedy approach, I came to know that a knowledge on matroids (greedoids) will help me approaching the problem properly. After reading about matroids I have roughly understood what matroids are. But how do you use the concept of a matroid for solving a given optimisation pro... |
|algorithms|graphs|greedy-algorithms| |
The connection is that if a you can represent the structure underlying your optimisation problem as matroid, you can use the canonical greedy algorithm to optimise the sum of any positive weight function. If your optimisation goal fits this paradigm, you can solve your problem with the greedy approach.
### Example
... |
You are probably thinking of the problem of determining whether a given solution to the TSP is the **best** solution. However, in order to know this, you must know the cost of all other possible paths (requires $O(n!)$ time to compute), which means that this problem is in NP-hard, but not NP-Complete.
The TSP *Deci... |
Maybe the following perspective helps:
When you are trying to construct a Eulerian path, you can proceed almost greedily. You just start the path somewhere and the try to walk as long as possible. If you detect a circle, you will delete its edges (but record that this circle was constructed). By this you decompose t... |
I know why and how the [push relabel algorithm](https://en.wikipedia.org/wiki/Push-relabel_algorithm) works for solving the max-flow problem. But why is a global update step required? |
Reason for global update steps in the push-relabel algorithm |
|algorithms|graphs|network-flow| |
|computability|automata|turing-machines| |
I am not sure I see it. From what I understand, edges and vertices are complements for each other and it is quite surprising that this difference exists.
Is there a good / quick / easy way to see that in fact finding a Hamiltonian path should be much harder than finding a Euler path? |
|complexity-theory|graphs|np-complete| |
You are probably thinking of the problem of determining whether a given solution to the TSP is the **best** solution. However, in order to know this, you must know the cost of all other possible paths (there is no known polynomial solution for this), which means that this problem is in NP-hard, but not NP-Complete.
... |
You are probably thinking of the problem of determining whether a given solution to the TSP is the **best** solution. However, there is no known polynomial solution for this, which means that this problem is in NP-hard, but not necessarily NP-Complete.
The TSP *Decision Problem* is actually about determining whethe... |
null |
Show that if A is a context-free language and B is finite, then A - B is a context free language.
I'm just not sure how to use their properties to formally show this. Thanks for all the help in advance. |
Context Free - Finite = Context Free |
|context-free|proof-techniques| |
>Show that if $A$ is a context-free language and $B$ is finite, then $A - B$ is a context-free language.
I'm just not sure how to use their properties to formally show this. Thanks for all the help in advance. |
Showing $A-B$ is a CFL where $A$ is a CFL and $B$ is finite |
Hint: If $A$ is context-free and $R$ is regular then $A \cap R$ is context-free. |
null |
Is a push-down automaton with two stacks equivalent to a turing machine? |
null |
I am looking for a reference text on applied graph theory and graph algorithms. Is there a standard text used in most computer science programs? If not, what are the most respected texts in the field? (I have Cormen)
Thanks |
Standard or Top Text on Applied Graph Theory |
|algorithms|graphs| |
There is the book "Managing and Mining Graph Data" from Charu C. Aggarwal.
It contains (among others):
- Graph Mining: Laws and Generators
- Graph Data Management and Mining
- Graph Indexing
- Graph Reachability Queries
- Graph Matching
- Graph Classification
As the title suggests it concentrates on... |
|algorithms|graphs|books| |
There is the book "Managing and Mining Graph Data" from Charu C. Aggarwal (one of the most cited persons in the field of Data Mining).
It contains (among others):
- Graph Mining: Laws and Generators
- Graph Data Management and Mining
- Graph Indexing
- Graph Reachability Queries
- Graph Matching
- Grap... |
I've been looking for a way to represent the golden ratio ($\phi$) base more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. The paper describing it in detail is [Brousentsov... |
What is a good binary encoding for $\phi$-based balanced ternary arithmatic algorithms? |
|algorithms| |
I've been looking for a way to represent the golden ratio ($\phi$) base more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. The paper describing it in detail is [Brousentsov... |
There is the book "Managing and Mining Graph Data" from Charu C. Aggarwal.
It contains (among others):
- Graph Mining: Laws and Generators
- Graph Data Management and Mining
- Graph Indexing
- Graph Reachability Queries
- Graph Matching
- Graph Classification
As the title suggests it concentrates on... |
null |
|complexity-theory|np-complete| |
|formal-languages|context-free|proof-techniques| |
|complexity-theory|graphs|np-complete|intuition| |
Another detail that may help your intuition is that an Euler cycle exists if and only if each vertex has even degree. A similar theorem exists for Euler paths. This follows from a fairly straightforward proof--basically, every time you visit a vertex, you must then leave it, so each "visit" takes two from the degree ... |
I've been looking for a way to represent the golden ratio ($\phi$) base more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. The paper describing it in detail is [A. Stakhov,... |
What is a good binary encoding for $\phi$-based balanced ternary arithmetic algorithms? |
A Delaunay triangulation can be considered as the lower convex hull of the 2d point set lifted to the paraboloid. Thus, if you take your 2d point set and assign to every point $(x_i,y_i)$ a $z$-coordinate $z_i=x_i^2+y_1^2$, then the projection of the lower convex hull into the $xy$-plane gives you the Delaunay triangul... |
To be more precise, we do *not* know if TSP is in $\mathsf{P}$. It is possible that it can be solved in polynomial time, even though perhaps the common belief is that $\mathsf{P} \neq \mathsf{NP}$. Now, recall what it means for a problem to be $\mathsf{NP}$-hard and $\mathsf{NP}$-complete, see for example my [answer he... |
I just came across an exercise which is to find a regular expression for the following automata, such that the regular expression and the automata generate the same language.
![NFA][2]
One solution presents the following expression:
![enter image description here][1]
However, can this be true? I think not, ... |
Does this regular expression equal this automata? |
|regular-languages|automata|finite-automata|regular-expressions| |
A Delaunay triangulation can be considered as the lower convex hull of the 2d point set lifted to the paraboloid. Thus, if you take your 2d point set and assign to every point $(x_i,y_i)$ a $z$-coordinate $z_i=x_i^2+y_1^2$, then the projection of the lower convex hull into the $xy$-plane gives you the Delaunay triangul... |
I just came across an exercise which is to find a regular expression for the following automata, such that the regular expression and the automata generate the same language.
![NFA][2]
One solution presents the following expression:
![enter image description here][1]
However, can this be true? I think not, ... |
I've been looking for a way to represent the [golden ratio ($\phi$) base](http://en.wikipedia.org/wiki/Golden_ratio_base) more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. ... |
|algorithms|data-structures|efficiency|coding-theory| |
**In terms of space and time complexity, what is the most efficient priority-queue?**
Specifically I am looking for priority queues which maximise complexity of inserts over deletes.
FYI: If you're looking for a survey of priority-queues which maximises complexity of deletes over inserts, see: http://cs.stackexch... |
What is the most efficient known priority-queue? |
|computer-networks|hash|user-interface| |
Is SAT in P if there are exponentially many clauses in the number of variables? |
In this case, the answer is trivial as [Luke points out](http://cstheory.stackexchange.com/q/2676/1546). However, as you seem to have come up with the definition yourself, note this.
For SAT, so-called phase transitions regarding the ratio of variable count to clause count have been observed [1,2]. If it is small, i... |
null |
I need super-fast method for oridinary differential equations. Should I use midpoint method? I need this for reaction-diffusion system (Gray-Scott). |
Which method for ODE instead of Euler's? |
|numerical-analysis| |
I need a super-fast method for ordinary differential equations. Should I use the [midpoint method](http://en.wikipedia.org/wiki/Midpoint_method)? I need this for a [reaction-diffusion system](http://en.wikipedia.org/wiki/Reaction%E2%80%93diffusion_system) (Gray-Scott). |
|algorithms|numerical-analysis| |
|algorithms|optimization|linear-programming| |
We are given a set of objects, say integers, $S$. In addition, we are given a predicate $P$, for example $P(i): \Leftrightarrow i \geq 0$. We don't know in advance how many elements of $S$ satisfy the predicate $P$, but we would like to sample or choose an element uniformly at random from $S' = \{ i \mid i \in S \wedge... |
Choosing an element from a set satisfying a predicate uniformly at random in $O(1)$ space |
|algorithms|randomized-algorithms|streaming-algorithm|in-place| |
The following approach is often referred to as [reservoir sampling](http://en.wikipedia.org/wiki/Reservoir_sampling). Start scanning the set $S$ and maintain an index $j$ to the set. The first element you encounter satisfying the predicate, set $j$ to it with probability $1/1$. Update your choice for $j$ when you encou... |
Modern SAT-solvers are very good at solving many real-world examples of SAT instances. However, we know how to generate hard ones: for instance use a [reduction from factoring to SAT](http://cstheory.stackexchange.com/q/6755/1037) and give the RSA numbers as input.
This raises the question: what if I take an easy ex... |
Can top SAT-solvers factor easy numbers? |
|satisfiability|sat-solvers|factoring| |
null |
|complexity-theory|satisfiability|sat-solvers|factoring| |
Factoring is not provably known to be hard for them. On the other hand there are other much simpler instances which we provably know that the current algorithms cannot solve in sub-exponential time. These algorithms are incapable of counting (almost all of them are improvements of DPLL which correspond to the propositi... |
There are other much simpler instances which we provably know that the current algorithms cannot solve in sub-exponential time. These algorithms are incapable of counting (almost all of them are improvements of DPLL which correspond to Resolution propositional proof system).
Unfortunately such examples are unsatisf... |
null |
|graphs|terminology|combinatorics|binary-trees| |
Is there any formal definition about the average height of a binary tree?
I have a tutorial question about finding the average height of a binary tree using the following two methods:
1. The natural solution might be to take the average length of all possible
paths from the root to a leaf, that is
$\qquad \... |
Is there any formal definition about the average height of a binary tree?
I have a tutorial question about finding the average height of a binary tree using the following two methods:
1. The natural solution might be to take the average length of all possible
paths from the root to a leaf, that is
$\qquad \... |
Is there any formal definition about the average height of a binary tree?
I have a tutorial question about finding the average height of a binary tree using the following two methods:
1. The natural solution might be to take the average length of all possible
paths from the root to a leaf, that is
$\qquad \... |
There is no reason to believe that both definitions describe the same measure. You can write $\operatorname{avh}_1$ recursively, too:
$\qquad \displaystyle \operatorname{avh}_1(N(l,r)) = \frac{\operatorname{lv}(l)(\operatorname{avh_1}(l) + 1) + \operatorname{lv}(r)(\operatorname{avh_1}(r) + 1)}{\operatorname{lv}(l) ... |
|algorithms|reference-request|string-metrics| |
You want to find a way of creating $G'$ from $G$ such that $G'$ has a $k$-key iff $G$ has a Hamiltonian path.
If a graph $G$ has $k$ vertices and a simple path of length $k$, then what can we conclude about it having a Hamiltonian path?
I'm guessing the intention is that the vertices in the path must be different... |
|complexity-theory|np-complete|reductions| |
Text books everywhere assume that the [*Bounded* Post Correspondence Problem](https://en.wikipedia.org/wiki/Post_correspondence_problem) is NP-complete (no more than $N$ indexes allowed with repetitions). However, nowhere is one shown a simple (as in, something that an undergrad can understand) polynomial time reductio... |
A polynomial reduction from any NP-complete problem to bounded PCP |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.