The combinatorial pharmacological effects of drugs are influenced by the complex interactions among them. When the patient is allergic to some drugs, the combination of drugs have to be changed. Based on that, we put forward a linear-algebra-equation query task. In this paper, we propose a model called Drug2vec that approximates the relationship among drugs and can solve the linear-algebra-equation query task. For example, we can find drugs with the following relationship: drug A + drug B = drug C. Drug2vec applies a three-layer neural network, which firstly projects a drug into an embedded space and then retrieves another drug that interacts with it. Experimental results show that Drug2vec can approximate the relationship among drugs to linear equations, and the drugs that fit a linear equation have connections with respect to their structures. We also propose a metric called AUE (area under the enrichment curve) to evaluate the performance of our model. Drug2vec can predict drug-drug interactions with high accuracy, and the AUE can be $0.96$ in the normal test. The AUE score of Drug2vec can be greatly increased with linear modification in the blind test. |

*** Title, author list and abstract as seen in the Camera-Ready version of the paper that was provided to Conference Committee. Small changes that may have occurred during processing by Springer may not appear in this window.