\(\left\{{}\begin{matrix}a-b=\sqrt{2}+1\\a-c=\sqrt{2}-1\end{matrix}\right.\)
=> \(a-b+b-c=\sqrt{2}+1+\sqrt{2}-1\)
\(\Leftrightarrow a-c=2\sqrt{2}\)
\(B=a^2+b^2+c^2-ab-bc-ac\)
\(=\dfrac{2a^2+2b^2+2c^2-2ab-2bc-2ac}{2}\)
\(=\dfrac{\left(a-b\right)^2+\left(b-c\right)^2+\left(a-c\right)^2}{2}\)
\(=\dfrac{\left(\sqrt{2}+1\right)^2+\left(\sqrt{2}-1\right)^2+\left(2\sqrt{2}\right)^2}{2}\)
\(=\dfrac{3+2\sqrt{2}+3-2\sqrt{2}+8}{2}\)
\(=\dfrac{6+8}{2}=7\)