Cooperative communication (CC) offers an efficient and low-cost way to achieve spatial diversity 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 CC. Most existing relay selection strategies focus on optimizing the outage probability or energy consumption. To fill in the vacancy of research on throughput improvement via CC, we study the relay selection problem with the objective of optimizing the throughput in this paper. For unicast, it is a P problem, and an optimal relay selection algorithm is provided with a correctness proof. For broadcast, we show the challenge of relay selection by proving it nonprobabilistic hard (NP-hard). A greedy heuristic algorithm is proposed to effectively choose a set of relay nodes that maximize the broadcast throughput. Simulation results show that the proposed algorithms can achieve high throughput under various network settings.