Detect task dependencies