Nowadays, many organs such as kidney, liver, pancreas, intestine, heart, as well as lungs, can be safely transplanted. Sometimes organ transplantation is the only possible therapy, for instance for patients with end-stage liver diseases, and the preferred treatment, for instance for patients with end-stage renal diseases. As a consequence, the demand of organs has greatly exceeded the offer and has become a key tool to cure diseases. In many countries the costs to receive an organ, which are often very expensive, are all charged by the National Health Service. In our paper, we aim at presenting a mathematical model, based on networks, which allows us to minimize the total costs associated with organ transplants. We find the related optimality conditions and the variational inequality formulation. Some existence and uniqueness results as well as the Lagrange formulation are stated and some numerical examples are studied.