Computational methods: choose a technique for the problem
Turn a vague task into a model with a testable goal, then choose a method that fits its constraints. This introductory application guide covers OCR H446 Paper 2 section 2.2.2, with deeper practice still needed for each method.
Content owner: Michael Print · Written for A-Level learners · Checked against official specifications
The short answer
A problem suits computational methods when its information can be represented, its goal is sufficiently defined and a computer can follow a process to obtain or approximate that goal.
Practical suitability also depends on time, memory and data quality. Choose a method for a feature of the task, then explain what it does in that situation.
Failed choices: backtrack.
Patterns in data: mine the data.
Difficult search: use a heuristic.
Resource predictions: model performance.
Repeated stages: pipeline items.
Relationships to inspect: visualise them.
Before you start
You should understand abstraction and decomposition. The code example uses functions, lists and recursive calls; its text walkthrough explains the choices without requiring you to write recursion yet.
By the end, you should be able to
Recognise inputs, constraints and a criterion for success.
Distinguish general decomposition from divide and conquer.
Trace a backtracking decision and explain a heuristic's limitation.
Apply the six named methods to a situation, stating assumptions and tradeoffs.
Recognise what must be solved
“Make deliveries better” does not define a computational goal. Specify the inputs: stops, travel costs and vehicle capacity.
Valid route: visits every required stop and respects capacity.
Optimal route: minimises total travel cost under the stated comparison.
Questions to make a problem computationally useful
Question
Delivery example
Can relevant data be represented?
Stops as identifiers; costs and loads as numbers
What counts as a valid result?
Required stops visited; vehicle limits respected
How are alternatives compared?
Lower total travel cost is better
What resources or deadlines apply?
A usable route is needed before departure
Recognise a familiar problem pattern
Finding an item: search.
Putting records in order: sort.
Assigning jobs without clashes: a constraint problem.
Problem recognition connects the real task and constraints to candidate methods before choosing code.
Computable and practical are separate questions
Finite input does not prove every possible problem has a general computable solution. Even where a correct exhaustive method exists, it may be impractical at the required scale.
A vague judgement such as “the best design” needs agreed criteria, human judgement or a carefully defined approximate model.
Worked example
Model and decompose a delivery planner
Recognise the goal: visit required stops within constraints and compare route costs.
Abstract the situation: represent locations as nodes and allowed travel as edges with costs. Omit building colour; keep load and delivery deadlines if they affect validity.
Decompose the work: validate the stop/load data, construct the travel model, generate candidate routes, check constraints and present the result.
Connect the components: route generation consumes the validated model; constraint checking determines whether a candidate may be presented.
Choose an approach: for a small search, explore candidates systematically. For a strict deadline with many stops, a heuristic may find a useful candidate quickly, with its quality checked separately.
The abstraction is only as good as the assumptions. Straight-line distance is convenient but can underestimate travel where roads or barriers matter. A route valid in the model may be unsuitable in reality if a required restriction was omitted.
Divide and conquer is a particular kind of decomposition
Different responsibilities or smaller copies of one problem?
General decomposition
Split the task into useful smaller parts. Reading scores and displaying results have different jobs.
Divide and conquer
Split into smaller instances of the same problem, solve them (often recursively), then combine their answers. Solve small enough instances directly.
Find the maximum of [6, 14, 9, 11] using divide and conquer
Step
Operation
Result
1
Split into [6, 14] and [9, 11]
Two smaller maximum problems
2
Split each pair into one-item lists
Each one-item maximum is its value
3
Combine 6 with 14, then 9 with 11
Left maximum 14; right maximum 11
4
Compare the two maxima
Overall maximum 14
This demonstrates the structure; a straightforward loop also finds the maximum with linear work and is usually simpler here. Dividing a problem does not automatically make it faster. Merge sort is a more useful next example: it solves smaller sorting problems, then merges sorted results.
Backtracking: abandon a failed branch and try another
Backtracking builds a partial solution by choosing an option. If that choice leads to a dead end or violates a constraint, it returns to an earlier decision and tries an untried option. Keeping track of choices avoids restarting the whole search each time.
Find any directed path to G, backtracking from dead endsPython
def find_path(graph, current, goal, path):
if current == goal:
return path
for neighbour in graph.get(current, []):
if neighbour not in path:
result = find_path(graph, neighbour, goal,
path + [neighbour])
if result is not None:
return result
return None
graph = {"S": ["A", "B"], "A": ["C"], "C": [],
"B": ["G"], "G": []}
print(find_path(graph, "S", "G", ["S"]))
The graph maps each node to its permitted next nodes. Each call receives a path beginning at S and ending at its current node.
Skip a neighbour already on that path to avoid a cycle.
Copy the path for each branch. This small example prioritises clarity over large-graph performance.
Worked example
Trace a failed route before a successful one
Try a branch, return from failure, then try another
1
S → A
Try A before B because of the neighbour-list order.
2
S → A → C: dead end
C is not G and has no neighbours. Its call returns None.
3
Return through A to S
A has no further choices, so it also returns None. S’s loop resumes at its next option, B.
4
S → B → G: goal
G passes the goal test. Return the successful path through the active calls.
The output is ['S', 'B', 'G']. If no branch reaches G, the result is None.
The search finds its first valid path, without proving lowest cost. In a timetable, a failed branch could be an assignment leaving a later class with no available room.
Data mining discovers patterns; heuristics guide choices
Data mining: compare a pattern with its baseline
Data mining analyses data to discover useful patterns, relationships or trends. An invented bookshop could analyse past baskets to find titles frequently purchased together, then evaluate whether related-title recommendations help. It must distinguish a pattern in historical data from a dependable prediction about new customers.
Suppose 40 of 50 baskets containing A also contain B: 40 / 50 = 80%. If B appears in 95% of all baskets, 80% is lower than the baseline, rather than unusually strong positive association.
Compare the pattern with the overall purchase rate.
Use enough representative data and test recommendations on new data.
Co-occurrence does not establish that buying A causes buying B.
Heuristics: guide a decision quickly
A heuristic uses a practical rule to guide search or find a useful candidate when exhaustive optimisation is expensive. A delivery planner might repeatedly choose the nearest unvisited feasible stop.
That locally attractive choice is quick, but may leave an expensive final leg. The route is not guaranteed globally optimal.
Ordering an exact search can still preserve correctness
A heuristic can order choices without changing which solutions are allowed. Trying the most constrained class first in a timetable may expose impossible branches early.
If every necessary alternative is still explored, this ordering does not itself make the result approximate.
Model performance before committing resources
Performance modelling predicts behaviour such as completion time, throughput or resource use using stated assumptions. It can use equations or a simulation. Compare alternatives at realistic workloads and later check predictions against measurements.
The same 100 jobs under stated assumptions
One worker → 20 seconds
100 independent jobs × 0.2 seconds per job = 20 seconds sequentially.
Four workers → ideal 5 seconds
100 jobs divide evenly: 25 per worker × 0.2 seconds = 5 seconds.
Invented model: identical workers, unchanged job durations and no scheduling/shared-resource overhead. A slow shared disk could invalidate the prediction.
Pipeline stages for different items
Pipelining overlaps different stages for different items. An item still moves through its stages in order, but while stage 2 handles item A, stage 1 can prepare item B. Separate stage resources and suitable buffering are needed for that overlap.
Worked example
Model a three-stage image-processing pipeline
Three independent images each pass through decode (2 seconds), filter (3 seconds), then save (1 second). There is one separate worker per stage, images remain in order, buffers are available and transfer costs are ignored.
Pipeline schedule: start–finish times in seconds
Image
Decode
Filter
Save
Completed at
A
0–2
2–5
5–6
6
B
2–4
5–8
8–9
9
C
4–6
8–11
11–12
12
Without overlap: one whole image takes 2 + 3 + 1 = 6 seconds. Three take 3 × 6 = 18 seconds.
Fill the pipeline: A still completes at 6 seconds. B can decode earlier but must wait for the filter worker until time 5.
Identify the bottleneck: filtering takes 3 seconds per image. After filling, this model can complete one image every 3 seconds.
Finish the batch: C completes at 12 seconds, saving 6 seconds compared with sequential execution.
This improves batch throughput, not the first image's 6-second latency. Queuing can increase a later item's time in the system. Buffer memory, stage imbalance and failures affect the real benefit; predicting the schedule is performance modelling, while arranging the stages to overlap is pipelining.
Visualise the question you need to answer
Visualisation represents data or a model so a person can inspect relationships, changes and anomalies. A node-and-edge diagram makes a route's connectivity visible. A timeline makes pipeline waiting visible. A plot of jobs completed against elapsed time can reveal a throughput bottleneck.
Label the quantities and units; compare the same workload and time unit.
Choose an honest scale: a cut-off vertical axis can exaggerate a small difference.
Provide an explanation or data table so the meaning is available beyond the picture.
Visualisation supports interpretation. It does not prove the underlying model is accurate.
Try it yourself
These five original questions total 23 marks. The marking guidance is indicative, not an OCR mark scheme. Explain how the method applies rather than giving a definition alone.
Question 1
4 marks
A school wants to create a clash-free exam timetable. Identify two details needed to turn this into a computational problem. Explain one feature making computation useful and one reason an exhaustive solution may be impractical.
Show solution and marking guidance+
Indicative answer:
Represent candidates, durations and available rooms/time slots as data (1).
Define validity: no candidate clashes and suitable room capacity/availability (1).
A precise validity criterion lets an algorithm check assignments (1).
Too many possible assignments can make exhaustive search impractical within the deadline (1).
Accept another specific computational feature and justified resource limit.
Question 2
4 marks
Distinguish decomposition from divide and conquer using a score-processing task. Apply the maximum method to [4, 12, 9, 3], stating the two half-list maxima and the overall maximum.
Show solution and marking guidance+
Indicative answer:
General decomposition separates different responsibilities, such as reading scores and displaying results (1).
Divide and conquer solves smaller maximum problems, then combines their maxima (1).
The maximum of [4, 12] is 12 (1).
The maximum of [9, 3] is 9; combining 12 and 9 gives 12 overall (1).
Question 3
5 marks
Trace the path-finding code: name its first attempted branch, explain where and why it backtracks, and give its result. Explain why a returned path need not be the cheapest route.
Show solution and marking guidance+
Indicative answer:
Explores S → A → C first (1).
C is not G and has no next node, so the branch fails (1).
A has no remaining alternative; return to S and try B (1).
The returned path is ['S', 'B', 'G'] (1).
The code returns the first valid path without comparing all path costs, so lowest cost is not guaranteed (1).
Question 4
4 marks
Use the image pipeline's assumptions for four images instead of three. Calculate sequential and pipelined batch duration. Identify the bottleneck and state one assumption required by this performance model.
Show solution and marking guidance+
Indicative answer:
Sequential: 4 × (2 + 3 + 1) = 24 seconds (1).
Pipelined: 6 + 3 × 3 = 15 seconds (1).
Filtering is the bottleneck: 3 seconds per image is longer than either other stage (1).
State one assumption: separate stage workers, sufficient buffering, fixed stage times or ignored transfer overhead (1).
Question 5
6 marks
A bookshop has three aims:
Related-book suggestions.
A delivery route under a short planning deadline.
A comparison of processing time with different worker counts.
For each aim, explain how data mining, a heuristic or visualisation could help. Give a limitation for each of the first two and a useful interpretation enabled by the third.
Show solution and marking guidance+
Indicative answer:
Data mining: discover related purchases from basket co-occurrences (1); compare overall purchase rates/new data because historical associations may mislead (1).
Heuristic: choose a nearby unvisited feasible stop to build a route quickly (1); it may miss the globally cheapest route (1).
Visualisation: plot completion time against worker count for one workload, with labelled units (1); compare improvements or diminishing gains/bottlenecks (1).
Accept other specific applications with matching limitations/purposes.
Specification links and scope
Checked against OCR H446 version 3.0 (2026), 2.2.2(a–f). This guide introduces solvability, problem recognition, decomposition, divide and conquer and abstraction, then applies the six methods named in (f).
Varied problem practice and dedicated method guides are needed before treating the full requirement as secure.
These are independently written explanations and practice questions. CompSciTutoring.co.uk is not affiliated with or endorsed by an examination board. The marking guidance is indicative; always check the syllabus for your examination year.