4. In space, there are 9 points, among which any 4 points are not coplanar. Connect several line segments between these 9 points so that there is no tetrahedron in the graph. What is the maximum number of triangles in the graph? （）
A. 21
B. 24
C. 25
D. 27
4. D

Divide 9 points $A_{1}, A_{2}, \cdots, A_{9}$ into 3 groups: $\left.\left\{A_{1}, A_{2}, A_{3}\right\}, \mid A_{4}, A_{5}, A_{6}\right\}, \left\{A_{7}, A_{8}, A_{9} \mid\right.$ No two points in the same group are connected, while any two points in different groups are connected. For any four points in space, at least one point is in the same group, so there is no tetrahedron. Therefore, there are $C_{3}^{1} C_{3}^{1} C_{3}^{1}=27$ triangles.