Add description of graph algorithm