Cooperative communication (CC) can offer high channel capacity and reliability in an efficient and low-cost way by forming a virtual antenna array among single-antenna nodes that cooperatively share their antennas. It has been well recognized that the selection of relay nodes plays a critical role in the performance of multiple D2D pairs. Unfortunately, all prior work has made an unrealistic assumption that spectrum resources are unlimited and each D2D pair can communicate over a dedicated channel with no mutual interference. In this chapter, we study the problem of maximizing the minimum transmission rate among multiple device-to-device communication pairs using CC in a cognitive radio network (CRN). We jointly consider the relay assignment and channel allocation under a finite set of available channels, where the interference must be considered. In order to improve the spectrum efficiency, we exploit the network coding opportunities existing in CC that can further increase the capacity. Such max-min rate problems for cognitive and cooperative communications are proved to be NP-hard and the corresponding MINLP (Mixed-Integer Nonlinear Programming) formulations are developed. Moreover, we apply the reformulation and linearization techniques to the original optimization problems with nonlinear and nonconvex objective functions such that our proposed algorithms can produce high competitive solutions in a timely manner. Extensive simulations are conducted to show that the proposed algorithms can achieve high spectrum efficiency in terms of providing a much improved max-min transmission rate under various network settings.