AI engineering glossary · Data structures algorithms

What is optimal substructure?

Optimal substructure: The property that an optimal solution to a problem contains within it optimal solutions to its subproblems. It is what allows dynamic programming and greedy methods to build a global answer from local ones.

Level: advancedTopic: Data structures algorithms

Optimal substructure: an example

A shortest route from Delhi to Chennai through Nagpur must use the shortest Delhi-Nagpur route as its first part.

Related terms

More Data structures algorithms terms

Where you learn it

Optimal substructure is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.