The wireless energy harvesting (EH) technique is regarded as a new way to provide an energy supply for energy-constrained cognitive relay networks (CRNs). A novel wireless EH cognitive multi-user relay network (CMRN) for the underlay protocol is investigated in this paper. In this system, there are multiple primary users (PUs) and multiple secondary users (SUs). The SUs can share the licensed spectrum and harvest energy from ambient signals. The problems of multiple relay selection by the SUs and of finding the optimal EH ratio are considered. We analytically derive the exact expression of the throughput of a secondary network. In it, there are four constraints: for the permitted peak interference with each primary transmitter (PT); for the sum interference for each PT; that the transmit power of secondary source nodes (SSNs) and secondary relays (SRs) should be less than the energy harvested; and that each secondary source node/secondary destination node (SSN-SDN) pair can only choose one SR. To obtain the optimal performance of the secondary network’s throughput, we should optimize the multiple relay selection scheme and the EH ratio. Actually, it is a classic integer optimization problem to design an optimal multiple relay selection scheme. However, the selection of the optimal EH ratio is a continuous optimization problem. The joint multiple relay selection and time slot allocation is a classical hybrid optimization problem. So, we propose a novel quantum sine cosine algorithm (QSCA) for resolving the difficulty with optimization of multiple relay selection and the EH ratio. Our simulation results verify our proposed solution by showing the influence of different parameters for the proposed model and by demonstrating good performance under the QSCA.