—In this paper we study the resource allocation in OFDM-based cognitive radio (CR) networks, under the consideration of many practical limitations such as imperfect spectrum sensing, limited transmission power, different traffic demands of secondary users, etc. We formulated this general problem as a mixed integer programming task. Considering that this optimization task is computationally intractable, we propose to address it in two steps. For the first step, we perform subchannel allocation to satisfy heterogeneous users’ rate requirement roughly and remove the integer constraints of the optimization problem. For the second step, we perform power allocation among the subchannels. By exploiting the problem structure to speedup the Newton step, we propose a Barrier-based method which is able to achieve the optimal power distribution with a complexity of O(N), where N is the number of active OFDM subchannels, significantly better than the complexity of O(N3 ) of standard techniqu...