Skip to content
Definition
Problem Decomposition is the process of breaking down complex problems into smaller, more manageable components. This approach simplifies the design and implementation of solutions.

Top-Down Design / Stepwise Refinement

Key Point
StepWhat to do
1Identify major components of the problem
2Break each component into subcomponents
3Continue refining until tasks are small enough to implement
4Repeat/iterate (top-down design / stepwise refinement)
Worked Example
Worked Example: Adventure Game Decomposition

Overall problem: Create an adventure game.
LevelComponentSubcomponents/examples
1CharactersPlayer, NPCs, enemies
1EnvironmentsLevel design, backgrounds, interactive objects, collision
1Game mechanicsCombat, scoring, quests, progression
1User interfaceMenus, HUD, inventory screen
2 (Characters)Player characterAppearance, stats, inventory
2 (Characters)NPCsDialogue, quest logic
2 (Characters)EnemiesAI behaviour, combat stats
This hierarchical breakdown lets developers focus on one manageable part at a time.

Structure Diagrams

Definition
A structure diagram (hierarchy chart) shows a problem decomposed level by level. The whole problem is a box at the top, and beneath each box are the smaller sub-problems it is split into, until every box at the bottom is a single task that could be written as one sub-procedure.

The diagram is drawn as boxes joined by lines. The same breakdown is shown here as an outline, with each level indented under the task it belongs to.

text
Online quiz
+-- Load the questions
+-- Run the quiz
|   +-- Ask a question
|   +-- Check the answer
|   +-- Update the score
+-- Show the results
    +-- Calculate the percentage
    +-- Display a message