The demand for hydrogen in refineries is growing due to its importance as a sulfur capture element. Therefore, hydrogen management is critical for fulfilling demands as efficiently as possible. Through mathematical modeling, hydrogen network management can be better performed. Cost-efficient Mixed-Integer Linear Programming (MILP) and Mixed-Integer Nonlinear Programming (MINLP) optimization models for (re)designing were proposed and implemented in GAMS with two case studies. Linear programming has the limitation of no stream mixing allowed; therefore, to overcome this limitation, an algorithm-based procedure called the Virtual Compressor Approach was proposed. Based on the MILP optimal solution obtained, the streams and compressors were merged. As a result, the number of compressors was reduced, along with the inherent investment costs. An operational cost reduction of more than 28% (example 1) and 26% (example 2) was obtained with a linear model. The optimal MILP solution after rearranging compressors was then provided as a good starting point to the MINLP. The operating costs were decreased by more than 31% (example 1) and 32% (example 2). Most of the cost reduction was obtained only with the usage of the MILP model. Besides, a higher level of cost reduction was only obtained when the linear model was used as the starting point.