Cognitive radio networks with cooperative communications can effectively improve spectrum efficiency and data rate. Under this network scenario, there are three possible transmission modes: direct transmission, multi-hop transmission and cooperative communication. To optimise the system performance, three issues should be carefully considered: whether or not and which relay is needed, which channel is selected and which transmission mode is used. Therefore in this study, the authors solve these three problems jointly to optimise the outage capacity for cognitive radio networks with cooperative communications. Particularly, they emphasise on the imperfect channel sensing situation. Under these setup and the constraints, the authors formulate the problem of relay determination, transmission channel and corresponding transmission mode selection to maximise the outage capacity as a discrete optimisation problem. Then a discrete stochastic optimisation algorithm is proposed to maximise the outage capacity to adaptively determine relay and select the optimal transmission channel and transmission mode. The proposed algorithm has fast convergence rate and low computation complexity. Moreover, the time-varying radio environment scenario is also considered, and they show that the proposed algorithm has good tracking capability for time-varying radio environment. Finally, simulation results are presented to demonstrate the performance of proposed scheme.