Device-to-Device (D2D) communication underlaying cellular networks is a promising add-on component for future radio communication systems. It provides more access opportunities for local device pairs and enhances system throughput (ST), especially when mobile relays (MR) are further enabled to facilitate D2D links when the channel condition of their desired links is unfavorable. However, mutual interference is inevitable due to spectral reuse, and moreover, selecting a suitable transmission mode to benefit the correlated resource allocation (RA) is another difficult problem. We aim to optimize ST of the hybrid system via joint consideration of mode selection (MS) and RA, which includes admission control (AC), power control (PC), channel assignment (CA) and relay selection (RS). However, the original problem is generally NP-hard; therefore, we decompose it into two parts where a hierarchical structure exists: (i) PC is mode-dependent, but its optimality can be perfectly addressed for any given mode with additional AC design to achieve individual quality-of-service requirements. (ii) Based on that optimality, the joint design of MS, CA and RS can be viewed from the graph perspective and transferred into the maximum weighted independent set problem, which is then approximated by our greedy algorithm in polynomial-time. Thanks to the numerical results, we elucidate the efficacy of our mechanism and observe a resulting gain in MR-aided D2D communication.