Consider a finite graph $\Gamma$ with $n$ vertices. We can associate a quadratic form on $\mathbb{R}^n$ to $\Gamma$ by the following rule:
$$q_{\Gamma} : = \sum \limits_{k=1}^n x_k^2 - \sum \limits_{\text{all the edges i-j}} x_ix_j. $$
I am trying to prove that if we want $q_{\Gamma} > 0$ we need to require that $\Gamma$ has at most one vertex of the degree 3.
It seems to me that it is not even true. We need at least suppose that the graph is connected. But still I am not able to prove it. P.S. I successfully proved that $\Gamma$ cannot contain any cicles.
Let $A$ be the adjacency matrix of a graph $\Gamma.$ Let $B=I-\frac{1}{2}A.$ The quadratic form $q_{\Gamma}$ can be expressed $q_{\Gamma}(x)=x^{T}Bx$, where $x=(x_{1},x_{2},\dots,x_{n}).$ We have the following standard result:
$$q_{\Gamma} > 0 \iff B \text{ is positive definite }\iff \text{ all eigenvalues of }B \text{ are } > 0.$$
The eigenvalues of $B$ are precisely $\{1-\frac{\lambda}{2}:\lambda \text{ an e-value of } A\}.$ Another standard result: the largest eigenvalue of $A$ is at most $\Delta_{\Gamma}$, the maximum degree of $\Gamma.$ So the smallest eigenvalue of $B$ is bounded below by $1-\frac{\Delta_{\Gamma}}{2}.$ From this, you get, that $2>\Delta_{\Gamma}$ implies $q_{\Gamma}>0.$
To go the other way, you might use some lower bound on the largest eigenvalue of $A$, which is usually denoted $\lambda_{1}.$ One well-known lower bound is $\lambda_{1} \geq \frac{2|E(\Gamma)|}{n}$, which is the average degree of $\Gamma.$ $1-\frac{\lambda_{1}}{2}>0$ thus implies $|E(\Gamma)|<n$, which if $\Gamma$ is to be connected means it must be a tree.
So if you're searching for a counterexample, you can narrow things down to trees with maximum degree 3. From here though, I'm not sure. Is there a tree of max degree 3 with two vertices of max degree and $\lambda_{1}<2$? Maybe, but I'm not sure, nor do I know how to prove it can't happen.
$\textbf{Edit:}$ you might check section 3 of this: https://math.mit.edu/~apost/courses/18.204_2018/DynkinDiagrams.pdf.