A dependency graph is a directed graph that represents dependencies of several objects towards each other, often used in computer science to model the order of execution or evaluation. It is crucial for optimizing processes like compilation, task scheduling, and data flow analysis by highlighting the dependencies and enabling efficient resource management.