<p>You wrote:</p>

<blockquote>
  <p>On the other hand there is this paper by Papadimitriou: <a href="http://www.sciencedirect.com/science/article/pii/0304397577900123" rel="nofollow noreferrer">http://www.sciencedirect.com/science/article/pii/0304397577900123</a> saying it is NP-complete, which also means it is in NP. Although he doesn't prove it in the paper, I think he consider the membership in NP trivial, as is usually the case with such problems.</p>
</blockquote>

<p>Why don't you simply read the paper, instead of posting such nonsense claims?
On page 239, Papadimitriou carefully discusses these issues and defines the underlying variant of the Euclidean metric for his proof.</p>

CC BY-SA 3.0
2016-12-28T12:55:30.957Z
I think this is better as a comment than an answer, unless you provide some details on how Papadimitriou avoids the sum of square roots problem.
Sasho Nikolov
CC BY-SA 3.0
2016-12-28T07:00:13.317Z
2016-12-28T07:00:13.317Z
Gamow
<p>Q1. This is a notorious open problem. It is known to be in the fourth level of the <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:C#ch" rel="noreferrer">counting hierarchy</a>, due to <a href="http://epubs.siam.org/doi/abs/10.1137/070697926" rel="noreferrer">[ABKM]</a>. Not known to be in NP. The problem is not really in computing square roots as claimed in the lecture notes: $n$ bits of a square root of an integer can be computed in time polynomial in $n$ and the bitsize of the integer. The problem is, rather, how close the sum of square roots of integers can get to an integer, without actually being integral.</p>

<p>Q2. The $n=1$ case is of course easy. It's the same as $q \le A^2$, which is in polynomial time, because squaring a rational number is in polynomial time.</p>

<p>Q3. According to <a href="http://cs.smith.edu/~orourke/TOPP/P33.html" rel="noreferrer">this page</a>, the best that's known is that there are integers $a_1, \ldots, a_k, b_1, \ldots, b_k$, all between $1$ and $n$, such that $| \sum_{i = 1}^k \sqrt{a_i} - \sum_{i = 1}^k \sqrt{b_i}| = O(n^{-2k + 3/2})$. This is a lower bound of $\Omega(2k\log n)$ on the number of bits needed to be computed for the potentially harder problem which allows negative coefficients. The best upper bound on the number of bits is exponential in $k$.</p>

<p>Q4. I think the decimal representation could be quite inefficient. The length of the period is the multiplicative order of 10 modulo the denominator, which can be exponential in the number of bits of the denominator.</p>

CC BY-SA 3.0
2016-12-30T18:51:54.377Z
So a problem can have a PTAS while its decision version is not known to be in $\mathsf{NP}$?
Lamine
CC BY-SA 3.0
2016-12-30T19:28:46.787Z
@Lamine Of course, what does one have to do with the other?
Sasho Nikolov
CC BY-SA 3.0
2016-12-28T00:32:30.993Z
2016-12-29T08:36:40.293Z
2016-12-29T08:36:40.293Z
Sasho Nikolov
<p>In this lecture notes by Ola Svensson: <a href="http://theory.epfl.ch/osven/courses/Approx13/Notes/lecture4-5.pdf">http://theory.epfl.ch/osven/courses/Approx13/Notes/lecture4-5.pdf</a>, it is said that we don't know if Euclidean TSP is in NP:</p>

<blockquote>
  <p>The reason being that we do not know how to calculate
  square roots efficiently.</p>
</blockquote>

<p>On the other hand there is this paper by Papadimitriou: <a href="http://www.sciencedirect.com/science/article/pii/0304397577900123">http://www.sciencedirect.com/science/article/pii/0304397577900123</a> saying it is NP-complete, which also means it is in NP. Although he doesn't prove it in the paper, I think he consider the membership in NP trivial, as is usually the case with such problems.</p>

<p>I am confused by this. Honestly, the claim that we don't know if Euclidian TSP is in NP shocked me, since I just assumed it is trivial -- taking the TSP tour as a certificat, we can easily check it is valid tour. But the problem is that there can be some square roots. So the lecture notes basically claim that we cannot in polynomial time solve the following problem:</p>

<p>Given rational number $q_1,\ldots,q_n,A\in\mathbb{Q}$, decide if $\sqrt{q_1}+\cdots+\sqrt{q_n}\leq A$.</p>

<p><strong>Question 1:</strong> What do we know about this problem?</p>

<p>This begs the following simplification, which I was unable to find:</p>

<p><strong>Question 2:</strong> Is this reducible to the special case when $n=1$? Is this special case polynomial-time solvable?</p>

<p>Thinking about it for a while, I came to this. We want polynomial time complexity with respect to the number of bits of the input, i.e., not the size of the numbers themselves. We can easily work out the sum to a polynomial number of decimal digits. To get a bad case, we need an instance of $q_{1,k},\ldots,q_{n,k},A_k\in\mathbb{Q}$ for $k=1,2,\ldots$ such that for every polynomial $p$, there exist an integer $k$ such that $\sqrt{q_{1,k}}+\cdots+\sqrt{q_{n,k}}$ and $A_k$ agree on the first $p(\text{input-size})$ digits of decimal expansion.</p>

<p><strong>Question 3:</strong> Is there such an instance of reational number?</p>

<p>But what is $\text{input-size}$? This depends on the way the rational numbers are represented! Now I am curious about this:</p>

<p><strong>Question 4:</strong> Is is algorithmically important if rational number are given as ratio of two integer (such as $24/13$) or in the decimal expansion (such as $2.5334\overline{567}$)? In other words, is there a family of rational numbers such that the size of decimal expansion is not polynomially bounded in the size of ratio representation or the other way around?</p>

CC BY-SA 3.0
2016-12-27T22:18:15.547Z
for $2$ say you need to precision $b$ bits then multiply the given $q_1$ with $1\underbrace{00\dots00}_{b\mbox{ length }}$ in binary and apply newton's iteration http://cstheory.stackexchange.com/questions/9706/complexity-of-finding-the-square-root-of-a-perfect-square/9709#9709.
Turbo
<np><tsp><computing-over-reals>
Euclidean TSP in NP and square root complexity
JS_
# Euclidean TSP in NP and square root complexity

(Asked by: username_0 on 2016-12-27)

In this lecture notes by Ola Svensson: <http://theory.epfl.ch/osven/courses/Approx13/Notes/lecture4-5.pdf>, it is said that we don't know if Euclidean TSP is in NP:

> The reason being that we do not know how to calculate
> square roots efficiently.

On the other hand there is this paper by Papadimitriou: <http://www.sciencedirect.com/science/article/pii/0304397577900123> saying it is NP-complete, which also means it is in NP. Although he doesn't prove it in the paper, I think he consider the membership in NP trivial, as is usually the case with such problems.

I am confused by this. Honestly, the claim that we don't know if Euclidian TSP is in NP shocked me, since I just assumed it is trivial -- taking the TSP tour as a certificat, we can easily check it is valid tour. But the problem is that there can be some square roots. So the lecture notes basically claim that we cannot in polynomial time solve the following problem:

Given rational number $q\_1,\ldots,q\_n,A\in\mathbb{Q}$, decide if $\sqrt{q\_1}+\cdots+\sqrt{q\_n}\leq A$.

**Question 1:** What do we know about this problem?

This begs the following simplification, which I was unable to find:

**Question 2:** Is this reducible to the special case when $n=1$? Is this special case polynomial-time solvable?

Thinking about it for a while, I came to this. We want polynomial time complexity with respect to the number of bits of the input, i.e., not the size of the numbers themselves. We can easily work out the sum to a polynomial number of decimal digits. To get a bad case, we need an instance of $q\_{1,k},\ldots,q\_{n,k},A\_k\in\mathbb{Q}$ for $k=1,2,\ldots$ such that for every polynomial $p$, there exist an integer $k$ such that $\sqrt{q\_{1,k}}+\cdots+\sqrt{q\_{n,k}}$ and $A\_k$ agree on the first $p(\text{input-size})$ digits of decimal expansion.

**Question 3:** Is there such an instance of reational number?

But what is $\text{input-size}$? This depends on the way the rational numbers are represented! Now I am curious about this:

**Question 4:** Is is algorithmically important if rational number are given as ratio of two integer (such as $24/13$) or in the decimal expansion (such as $2.5334\overline{567}$)? In other words, is there a family of rational numbers such that the size of decimal expansion is not polynomially bounded in the size of ratio representation or the other way around?

**Tags:** np, tsp, computing-over-reals

> **Comments:**
> **username_1**: for $2$ say you need to precision $b$ bits then multiply the given $q_1$ with $1\underbrace{00\dots00}_{b\mbox{ length }}$ in binary and apply newton's iteration http://cstheory.stackexchange.com/questions/9706/complexity-of-finding-the-square-root-of-a-perfect-square/9709#9709.  

---

## 2 answers

### Answer by username_3 on 2016-12-28. Score: 19 | Accepted answer

Q1. This is a notorious open problem. It is known to be in the fourth level of the [counting hierarchy](https://complexityzoo.uwaterloo.ca/Complexity_Zoo:C#ch), due to [[ABKM]](http://epubs.siam.org/doi/abs/10.1137/070697926). Not known to be in NP. The problem is not really in computing square roots as claimed in the lecture notes: $n$ bits of a square root of an integer can be computed in time polynomial in $n$ and the bitsize of the integer. The problem is, rather, how close the sum of square roots of integers can get to an integer, without actually being integral.

Q2. The $n=1$ case is of course easy. It's the same as $q \le A^2$, which is in polynomial time, because squaring a rational number is in polynomial time.

Q3. According to [this page](http://cs.smith.edu/~orourke/TOPP/P33.html), the best that's known is that there are integers $a\_1, \ldots, a\_k, b\_1, \ldots, b\_k$, all between $1$ and $n$, such that $| \sum\_{i = 1}^k \sqrt{a\_i} - \sum\_{i = 1}^k \sqrt{b\_i}| = O(n^{-2k + 3/2})$. This is a lower bound of $\Omega(2k\log n)$ on the number of bits needed to be computed for the potentially harder problem which allows negative coefficients. The best upper bound on the number of bits is exponential in $k$.

Q4. I think the decimal representation could be quite inefficient. The length of the period is the multiplicative order of 10 modulo the denominator, which can be exponential in the number of bits of the denominator.

> **Comments:**
> **username_4**: So a problem can have a PTAS while its decision version is not known to be in $\mathsf{NP}$?  
> **username_3**: @username_4 Of course, what does one have to do with the other?  

---

### Answer by username_2 on 2016-12-28. Score: 4

You wrote:

> On the other hand there is this paper by Papadimitriou: <http://www.sciencedirect.com/science/article/pii/0304397577900123> saying it is NP-complete, which also means it is in NP. Although he doesn't prove it in the paper, I think he consider the membership in NP trivial, as is usually the case with such problems.

Why don't you simply read the paper, instead of posting such nonsense claims?
On page 239, Papadimitriou carefully discusses these issues and defines the underlying variant of the Euclidean metric for his proof.

> **Comments:**
> **username_3**: I think this is better as a comment than an answer, unless you provide some details on how Papadimitriou avoids the sum of square roots problem.  

---

