Collaborative navigation technology realizes positioning through the interactive sharing of various navigation information among individuals, which has outstanding effect on raising navigation accuracy. Aiming at the problem that it is difficult for unmanned aerial vehicle (UAV) to achieve long-time and high-precision navigation in satellite-denied environments, this paper puts forward a classified collaborative navigation algorithm, which can be used in satellite-denied environments for UAV swarm. Firstly, a real-time classification method of UAV swarm is designed based on the relative navigation state between the UAV and the ground base station at the current moment. Then, according to the inertial navigation system (INS) error characteristics and the relative navigation information, model the collaborative navigation system. Finally, the INS errors of UAV are estimated and corrected by Kalman filter. Simulation proves that the proposed collaborative navigation algorithm can effectively raise the navigation accuracy of UAV swarm in satellite-denied environment on the one hand, and enhance the reliability and robustness of the collaborative system on the other hand.