graph algo for calculating a TSL based on a DAG, but respecting optimal groupings