TITLE: What is/are the best bound/s on the sum of squares of degrees in a graph?
QUESTION [6 upvotes]: Let $G$ be a graph with degrees $d_{1},\ldots,d_{n}$. I am interested in upper bounds on 
$$
\sum_{i=1}^{n}{d_{i}^{2}}.
$$
An example is de Caen's bound:
$$
\sum_{i=1}^{n}{d_{i}^{2}} \leq e(\frac{2e}{n-1}+n-2),
$$
where $e$ is the number of edges. His bound is very elegant but far from tight. I have read many papers which give other bounds but now I am a bit confused and would love to know if someone can supply a definitive answer.
P.S.
The quantity in question is also known as the "first Zagreb index", mostly in chemistry-related circles.

REPLY [4 votes]: There is a simple spectral upper bound: namely, denoting by $A$ the adjacency matrix of $G$, and by $\mathbf 1$ the $n$-dimensional all-$1$ vector, we have 
  $$ \sum_{I=1}^n d_i^2=\|A{\mathbf 1}\|^2 \le \|A\|^2 \|{\mathbf 1}\|^2 
         = n\lambda_{\rm max}^2, $$
where $\lambda_{\rm max}$ is the largest eigenvalue of $G$. This bound is sharp, say, for regular graphs.