Cognitive radio technology improves radio resource usage by reconfiguring the wireless connection settings according to the optimum decisions, which are made on the basis of the collected context information. This paper focuses on optimization algorithms for decision making to optimize radio resource usage in heterogeneous cognitive wireless networks. For networks with centralized management, we proposed a novel optimization algorithm whose solution is guaranteed to be exactly optimal. In order to avoid an exponential increase of computational complexity in large-scale wireless networks, we model the target optimization problem as a minimum cost-flow problem and find the solution of the problem in polynomial time. For the networks with decentralized management, we propose a distributed algorithm using the distributed energy minimization dynamics of the Hopfield–Tank neural network. Our algorithm minimizes a given objective function without any centralized calculation. We derive the decision-making rule for each terminal to optimize the entire network. We demonstrate the validity of the proposed algorithms by several numerical simulations and the feasibility of the proposed schemes by designing and implementing them on experimental cognitive radio network systems.