# Algorithms Exploit Constraints A general note from Tim Roughgarden: > Fast algorithms often require deep insight into their problem **structure**. This fundamentally comes down to the fact that they are efficiently exploiting the [constraints](Constraints%20in%20Math%20and%20Science.md) of the problem. ### Discrete Structures Consider a [DAG (Directed Acyclic Graph)](Directed-Acyclic-Graph.md) (or a [Partial Order](Partial-Order.md)). This provides us with certain relationships between objects. Algorithms (such as [Topological Sort](Topological-Sort.md)) can use that information in clever ways to achieve some task. They *exploit* this structure, they exploit this information. ### Continuous Structures Consider calculus as we know it; it specifically is exploiting $n$ dimensional euclidean space, $\mathbb{R}^n$. This space is incredibly rich, providing topological, geometric, and algebraic structure for us to work with. ### Why are algorithms often hard to understand? We must realize, algorithms have two main components. They have the underlying *problem structure* (often mathematical). This structure allows *exploitation*. And then they of course have the exploitation of this structure. These two components are heavily intertwined. You cannot understand and algorithm without deeply understanding the structure it is exploiting. This is why certain algorithms such as Fast Fourier Transform or even Gradient Descent are troubling. In the case of gradient descent, the algorithm is actually somewhat simple, but the structure it is exploiting is rather rich and complex. --- Date: 20211015 Links to: [Algorithms and Data Structures](Algorithms%20and%20Data%20Structures.md) [Constraints in Math and Science](Constraints%20in%20Math%20and%20Science.md) Tags: #review References: * Algorithms Illuminated 2, pg 15 (chapter 8)