Compute dependencies transitively