flowing through these new edges that are called phantoms. They will disappear once the water finishes flowing through them.

### Sequence of elements in $B$

Elements in $B$ have to be easily accessible for quick check whether the algorithm has finished. For this reason the sequence should be in global memory.

Graph update
============

The algorithm updates the graph in a loop until one vertex from $B$ becomes active. Each cycle consists of the following nine steps.

Step 1: Triggering vertices
---------------------------

In this step we go over all active edges and decrease their time parameters by $1$. If for any edge the time parameter becomes $0$, the edge becomes [*just used*]{} and its destination triggered.

To avoid the danger of two processing elements writing in the same location of the sequence of active vertices, we have to make sure that each processing element that runs concurrently has pre-specified location to write. This is accomplished by first specifying the number of threads in the separate variable [*nThreads*]{}. Whenever kernels are executed in parallel we are using only [*nThreads*]{} processing elements. Each processing element has its id number which is used to determine the memory location to which it is allowed 