Example 4 Given ten points in space, where no four points lie on the same plane. Connect some of the points with line segments. If the resulting figure contains no triangles and no spatial quadrilaterals, determine the maximum number of line segments that can be drawn. ${ }^{[3]}$
(2016, National High School Mathematics Joint Competition)
【Analysis】On the one hand, the condition "there are no triangles or spatial quadrilaterals in the figure" is a restriction on the number of edges, indicating that the number of edges cannot be too many; on the other hand, the number of edges can also be calculated from the degree of each point. Therefore, this problem chooses to first use the method of double counting to calculate the number of edges, and then combine the mean inequality to draw a conclusion.

Solution Let the ten points be $A_{1}, A_{2}, \cdots, A_{10}$, and form a simple graph $G$ of order ten with these ten points as vertices and the connected line segments as edges. Let the degree of point $A_{i}(i=1,2, \cdots, 10)$ be $d_{i}$. Then the total number of edges in graph $G$ is $\frac{1}{2} \sum_{i=1}^{10} d_{i}$.

In graph $G$, a figure formed by two line segments with a common endpoint is called an angle. Then there are $\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}$ different angles.

By the condition, we know that for any angle $\angle A_{i} A_{j} A_{k}$ in graph $G$, $A_{i}$ and $A_{k}$ are not adjacent, and for any two angles $\angle A_{i_{1}} A_{j_{1}} A_{k_{1}}$ and $\angle A_{i_{2}} A_{j_{2}} A_{k_{2}}$, we have
$$
\left\{A_{i_{1}}, A_{k_{1}}\right\} \neq\left\{A_{i_{2}}, A_{k_{2}}\right\} .
$$

Thus, the complement graph of $G$ has at least $\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}$ edges.
Therefore, the total number of edges $S$ satisfies
$$
\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}=S \leqslant \mathrm{C}_{10}^{2}-\frac{1}{2} \sum_{i=1}^{10} d_{i},
$$

i.e., $\mathrm{C}_{10}^{2} \geqslant \sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}+\frac{1}{2} \sum_{i=1}^{10} d_{i}=\frac{1}{2} \sum_{i=1}^{10} d_{i}^{2}$.
Also, $\frac{1}{2} \sum_{i=1}^{10} d_{i}^{2} \geqslant \frac{1}{2} \times \frac{1}{10}\left(\sum_{i=1}^{10} d_{i}\right)^{2}$, so
$$
\mathrm{C}_{10}^{2} \geqslant \frac{1}{2} \times \frac{1}{10}\left(\sum_{i=1}^{10} d_{i}\right)^{2} \Rightarrow \frac{1}{2} \sum_{i=1}^{10} d_{i} \leqslant 15 \text {. }
$$

Specific construction as shown in Figure 1.