5. Given a positive integer $n \geqslant 3$, for an $n$-tuple of real numbers $\left(x_{1}, x_{2}, \cdots, x_{n}\right)$, if every permutation $y_{1}, y_{2}, \cdots$, $y_{n}$, satisfies $\sum_{i=1}^{n-1} y_{i} y_{i+1} \geqslant-1$, then the real number tuple $\left(x_{1}, x_{2}\right.$,
$\left.\cdots, x_{n}\right)$ is called "luminous". Find the largest constant $C=$ $C(n)$, such that for every luminous $n$-tuple of real numbers, we have $\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j} \geqslant C$.
5. $C=-\frac{n-1}{2}$.

Let $t$ be a positive real number, and take
$$
x_{1}=-\frac{1}{2 t}, x_{2}=x_{3}=\cdots=x_{n}=t \text {. }
$$

Then $x_{i} x_{j}=t^{2}$ or $-\frac{1}{2}(i \neq j)$.
Thus, for each permutation $y_{1}, y_{2}, \cdots, y_{n}$, we have
$$
\sum_{i=1}^{n-1} y_{i} y_{i+1} \geqslant(n-3) t^{2}-1 \geqslant-1 \text {. }
$$

This shows that the $n$-tuple of real numbers $\left(x_{1}, x_{2}, \cdots, x_{n}\right)$ is luminous.
Notice,
$$
\begin{array}{l}
\sum_{1 \leqslant i-\frac{n-1}{2},
\end{array}
$$

and as $t \rightarrow 0$, $\sum_{1 \leqslant i l$.
Consider all permutations
$\phi:\{1,2, \cdots, n\} \rightarrow\{1,2, \cdots, n\}$,

such that $\phi^{-1}(T)=\{2,4, \cdots, 2 l\}$, then there are $k!\cdot l!$ such permutations.
Define $f(\phi)=\sum_{i=1}^{n-1} x_{\phi(i)} x_{\phi(i+1)}$.
Then for each $\phi$ satisfying the above property, we have
$f(\phi) \geqslant-1$.
Thus, considering the arithmetic mean of these $f(\phi)$, we get
$$
\begin{array}{l}
-1 \leqslant \frac{1}{k!\cdot l!} \sum_{\phi} f(\phi) \\
=\frac{2 l}{k l} M+\frac{2(k-l-1)}{k(k-1)} K,
\end{array}
$$

where the equality is because for each $\phi$, there are $k l$ products in $M$, each appearing $2 l$ times. For each $\phi$, there are $\frac{k(k-1)}{2}$ products in $K$, each appearing $k-l-1$ times.
Thus, $K+L+M$
$$
\begin{array}{l}
\geqslant K+L+\left(-\frac{k}{2}-\frac{k-l-1}{k-1} K\right) \\
=-\frac{k}{2}+\frac{l}{k-1} K+L \geqslant-\frac{n-1}{2},
\end{array}
$$

where the last inequality is because
$$
k \leqslant n-1, K \geqslant 0, L \geqslant 0 \text {. }
$$
(2) If $k=l=\frac{n}{2}$.

Consider all permutations
$$
\phi:\{1,2, \cdots, n\} \rightarrow\{1,2, \cdots, n\},
$$

such that $\phi^{-1}(T)=\{2,4, \cdots, 2 l\}$.
Similarly define $f$, and we get
$$
-1 \leqslant \frac{1}{k!\cdot l!} \sum_{\phi} f(\phi)=\frac{2 l-1}{k l} M,
$$

where the equality is because for each $\phi$, there are $k l$ products in $M$, each appearing $2 l-1$ times.
Thus, $K+L+M \geqslant M$
$$
\geqslant-\frac{k l}{2 l-1}=-\frac{n^{2}}{4(n-1)} \geqslant-\frac{n-1}{2},
$$

where the last inequality is because $n \geqslant 4$.