Implementing the graph processing algorithm