In order to improve transmission rate, and make full use of spectrum resources, the graph theory algorithm was applied firstly to allocate rapidly spectrums (channels), and then the channels were optimized by game theory algorithm. Simulation results showed that the spectrum resources could be fully utilized. Under power transmission constraints, the utility (rate) of cognitive users is improved by using joint spectrum allocation algorithm, and the power is distributed reasonably. The simulation verified that joint algorithm based on graph theory and game theory is effective.