  The number of triangles (hereafter denoted by $\Delta$) is an important
metric to analyze massive graphs. It is also used to compute clustering
coefficient in networks. This paper proposes a new algorithm called PES
(Priority Edge Sampling) to estimate the number of triangles in the streaming
model where we need to minimize the memory window. PES combines edge sampling
and reservoir sampling. Compared with the state-of-the-art streaming
algorithms, PES outperforms consistently. The results are verified extensively
in 48 large real-world networks in different domains and structures. The
performance ratio can be as large as 11. More importantly, the ratio grows with
data size almost exponentially. This is especially important in the era of big
data--while we can tolerate existing algorithms for smaller datasets, our
method is indispensable when sampling very large data. In addition to empirical
comparisons, we also proved that the estimator is unbiased, and derived the
variance.
