program used to unfold graphs