# Graph executor

## Introduction

Analysis apps on the VisionAppster platform are built using a data flow graph (DFG). A data flow graph consists of nodes that can send and receive messages. The edges of the graph describe dependencies between nodes.

Each node in the graph processes its input arguments and produces some output arguments as results. The output arguments can then be passed to other nodes in the graph.

Unlike in imperative programming, the execution order of graph nodes is not fully defined in advance. The system is free to choose any order as far as the dependencies are satisfied. This makes it possible to execute many nodes in the graph simultaneously.

As most cool things in computer science, the idea of using data flow graphs to build programs is nothing new. Since 1960's, many programming languages and APIs have implemented the paradigm in a form or another.

The VisionAppster platform neither introduces a new data flow programming language nor requires one to build programs using data flow primitives from the ground up. Instead, a hybrid approach is taken: the nodes – a.k.a tools – are relatively complex and can be written with a traditional programming language such as C, C++ or anything else that provides a C interface. This makes it possible to write algorithms in a traditional way but still benefit from parallelization on a higher level.

Consider the simple example below. The image sent by an image source is processed by two tools and the results are subtracted from each other.

If you were using a traditional image processing library, the code you write would be something like this (pseudo-code):

def run():
while True:
yield image_diff(filtered, mapped)