6. Let $x_{k} 、 y_{k} \geqslant 0(k=1,2,3)$. Calculate:
$$
\begin{array}{l}
\sqrt{\left(2018-y_{1}-y_{2}-y_{3}\right)^{2}+x_{3}^{2}}+\sqrt{y_{3}^{2}+x_{2}^{2}}+ \\
\sqrt{y_{2}^{2}+x_{1}^{2}}+\sqrt{y_{1}^{2}+\left(x_{1}+x_{2}+x_{3}\right)^{2}}
\end{array}
$$

The minimum value is $\qquad$
6.2018.

Let $O(0,0), A(0,2018)$,
$$
\begin{array}{l}
P_{1}\left(x_{1}+x_{2}+x_{3}, y_{1}\right), P_{2}\left(x_{2}+x_{3}, y_{1}+y_{2}\right), \\
P_{3}\left(x_{3}, y_{1}+y_{2}+y_{3}\right) .
\end{array}
$$

The required is
$$
\begin{array}{l}
\left|\overrightarrow{A P_{3}}\right|+\left|\overrightarrow{P_{3} P_{2}}\right|+\left|\overrightarrow{P_{2} P_{1}}\right|+\left|\overrightarrow{P_{1} O}\right| \\
\geqslant|\overrightarrow{A O}|=2018 .
\end{array}
$$

When $x_{k}=y_{k}=0(k=1,2,3)$, the equality holds, the required minimum value is 2018.