Cycle detection using DFS in a graph
PI estimation using Monte Carlo Method simulation