standard graphlib algorythm to compute dependencies