In this paper, a study has been conducted to compare the performance of different heuristic optimization algorithms such as Distributed Swarm Optimized Clustering (DSOC), Distributed Firefly Optimized Clustering (DFOC) and Distributed Jumper Firefly Optimized Clustering (DJFOC) techniques used for the dynamic clustering. In DSOC, every group of clustering nodes moves towards its best swarm particle having the best neighbor location with random velocity to form an organized cluster. DFOC and DJFOC are nonlinear optimization tools based on the random attractiveness of firefly intensity behaviour with the least computation time. DJFOC is used to collect the whole situation in the current records and support to change the new appropriate situation by the status table. The DJFOC aims to save transmit power with shortest distances and less control overhead when Secondary Users (SUs) or Primary Users (PUs) changes its position. The convergence rate of DJFOC is better than the DSOC and DFOC. The results show that the proposed DJFOC has a better efficiency of 10.137% when compared to the DSOC and 2.801% with DFOC in SUs average node power. For small Signal-to-Noise Ratio (SNR) < 2 dB, probability of detection is high. In primary detection, the proposed DJFOC is yielding a low false alarm rate compared to DSOC and DFOC. © 2021 The Authors. IET Networks published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology.