Counting triangles in a graph is an important step to calculate the clustering coefficient and the transitivity ratio of the network. Under the background of big data
the sampling method is the main method used in triangle counting. However
two problems of spatiotemporal costs and computing errors are very difficult. An approximate triangle counting algorithm based on Markov chain in the graph stream is proposed. Treating the window as processing unit of graph stream
it uses Markov chain to implement dynamic adaptation of memory and to reduce error ratio while sampling. Compared with other algorithms
the proposed algorithm can drop the error rate by 2~4 times