Dijkstra algorithm is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. The algorithm requires repeated searching for the vertex having the smallest distance and accumulating shortest distance from the source vertex. This example calculates the shortest path between each pair of vertexes in a complete graph having 2000 vertexes using Dijkstra algorithm.
Monte Carlo algorithms solve deterministic problems by using a probabilistic analogue. The algorithm requires repeated simulations of chance that lend themselves well to parallel processing and vectorization. The simulations in this example are run serially, with Intel® Cilk™ Plus Array Notation (AN) for vectorization, with Intel Cilk Plus
cilk_for for parallelization, and with both vectorization and