implement Graph Algorithm and Monte Carlo Evaluation by C++