Consensus-based distributed algorithms to estimate the number of active edges in wireless sensor networks are proposed. Conventionally, a communication link between two nodes is formed if they have sufficient transmission power to exchange information. In power constrained networks, it is crucial to know the total number of active communication links so that additional links can be created or removed depending on the power budget. We develop two distributed algorithms to estimate number of edges in the network: (a) an average consensus based algorithm which involves distributed node counting (b) a max consensus based algorithm by using the expected value of maximum of random state values. We find that average consensus based algorithm is appropriate for smaller networks, whereas, max consensus based algorithm is faster and best suited for larger networks. We derive the variance of the estimators which is proportional to square of total number of edges and inversely proportional to the number of random vectors used for estimation. The simulation results supporting the theory are also presented.