Directed Acyclic Graph Representation
Just as a graph is an effective way to understand a function, a directed acyclic graph is an effective way to understand a parallel computation. Such a graph shows when each calculation is done, which others can be done at the same time, what prior calculations are needed for it and into what subsequent calculations it feeds.
Starting from a directed acyclic graph and given a set of processors, then a schedule can be worked out. A schedule assigns each calculation to a specific processor to be done at a specified time.
From a schdule, the total time for a computation follows and, from this, we get the difficulty or complexity of the computation.
A Directed Acyclic Graph Defines a Computation
A computation can be accurately depicted by means of a directed acyclic graph (DAG), G = (N, A), consisting of a set of vertices N and a set of directed arcs A. In such a portrayal the vertices, or nodes, of the graph represent subtasks to be performed on the data, while the directed arcs indicate the flow of data from one subtask to the next. In particular, a directed arc (i, j) ∈ A from node i to j indicates that calculation j requires the result of calculation i.
The input data is shown at the top of the graph. We take the flow of data from the top to the bottom of the graph (or, less often, from left to right). This also becomes the flow of time; it follows that the graph can have no cycles. With this convention, we may omit the direction indicators on the arcs.