Today, most of the databases used for drug information mining are derived from the collection of many treatments under a single disease, and some special drug compatibility rules can be found from them. However, researchers’ exploration of medical data is not limited to this. The comparative analysis of drugs for different diseases has become a new research point. In this paper, the drug is used as a node, the relationship is the edge connecting the two nodes, the co-occurrence frequency of the drug is used as the weight of the edge to establish a network graph. We use the clustering algorithm of the weighted network graph center diffusion method combining the network topology and the edge weights to divide the network graph into communities. Then we proposed the Structural Clustering Algorithm on Weighted Networks (SCW), it helps to study the prescription of medical prescriptions and provides more scientific recommendations for auxiliary prescriptions. In the experiment, SCW is compared with the classic community discovery algorithm CPM, the network function modular analysis algorithm MCODE and the hierarchical network graph structure analysis algorithm BGLL. We analyze the results according to NMI, ARI and F-Measure. Finally, a case study of real data was conducted to ensure the correctness and effectiveness of the algorithm, and to obtain the potential drug combination in the medical prescription.