Example 8 There are 5 medicine boxes, every 2 boxes contain one same medicine, each medicine appears in exactly 2 boxes, how many kinds of medicines are there?
Solution: Represent the medicine boxes as 5 points. When a medicine box contains the same medicine, draw a line segment between the corresponding points.

Since every 2 medicine boxes have one kind of the same medicine, a line should be drawn between every two points. Also, because each kind of medicine appears in exactly 2 medicine boxes, there is exactly one line between every two points. This results in Figure 2. The number of lines in Figure 2 is the number of different medicines, so there are 10 kinds of medicines.