Device-to-device (D2D) technology is a promising technique in terms of being capable of providing efficiency, decreased latency, improved data rate, and increased capacity to cellular networks. Allocating power to users in order to reduce energy consumption and maintain quality of service (QoS) remains a major challenge in D2D communications. In this paper, we aim to maximize the throughput of D2D users and cellular users subject to QoS requirements and signal-to-interference-plus-noise ratio (SINR). To this end, we propose a resource and power allocation approach called optimal power allocation and delay minimization based on the conflict graph (OP-DMCG) algorithm that considers optimal power allocation for D2D multi-users in the cellular uplink channels and minimization of the total network delay using conflict graphs. Based on the simulations presented in this paper, we show that the proposed OP-DMCG algorithm outperforms the greedy throughput maximization plus (GTM+), delay minimization conflict graph (DMCG), and power and delay optimization based uplink resource allocation (PDO-URA) algorithms in terms of both total network throughput and total D2D throughput.