High efficient routing is an important issue for the design of wireless sensor network (WSN) protocols to meet the severe hardware and resource constraints. This paper presents a comprehensive survey and comparison of routing protocols in WSNs. The first part of the paper surveys state-of-the-art routing protocols in WSNs from classical routing protocols to swarm intelligence based protocols. The routing protocols are categorized based on their computational complexity, network structure, energy efficiency and path establishment. The second part of the paper presents a comparison of a representative number of classical and swarm based protocols. Comparing routing protocols in WSNs is currently a very challenging task for protocol designers. Often, much time is required to re-create and re-simulate algorithms from descriptions in published papers to perform the comparison. Compounding the difficulty is that some simulation parameters and performance metrics may not be mentioned. We see a need in the research community to have standard simulation and performance metrics for comparing different protocols. To this end, the final part of the paper re-simulates different protocols using a Matlab based simulator: routing modeling application simulation environment (RMASE), and gives simulation results for standard simulation and performance metrics which we hope will serve as a benchmark for future comparisons for the research community.