Combination therapy is a promising approach to address the challenge of antimicrobial resistance, and computational models have been proposed for predicting drug–drug interactions. Most existing models rely on drug similarity measures based on characteristics such as chemical structure and the mechanism of action. In this study, we focus on the network structure itself and propose a drug similarity measure based on drug–drug interaction networks. We explore the potential applications of this measure by combining it with unsupervised learning and semi‐supervised learning approaches. In unsupervised learning, drugs can be grouped based on their interactions, leading to almost monochromatic group–group interactions. In addition, drugs within the same group tend to have similar mechanisms of action (MoA). In semi‐supervised learning, the similarity measure can be utilized to construct affinity matrices, enabling the prediction of unknown drug–drug interactions. Our method exceeds existing approaches in terms of performance. Overall, our experiments demonstrate the effectiveness and practicability of the proposed similarity measure. On the one hand, when combined with clustering algorithms, it can be used for functional annotation of compounds with unknown MoA. On the other hand, when combined with semi‐supervised graph learning, it enables the prediction of unknown drug–drug interactions.