Algorithms and networks: computational thinking in geometry
Designing, testing and refining step-by-step algorithms for geometric problems, and interpreting networks with Euler's formula
About four lessons of 45 to 60 minutes
Seven bridges, one impossible walk
In the 1700s, the city of Konigsberg had seven bridges connecting two islands and both riverbanks. Locals wondered: could you walk through the city crossing every bridge EXACTLY once and return to where you started? Mathematician Leonhard Euler proved it was impossible, not by trying every route, but by inventing a new way of thinking: reduce the map to a NETWORK of points (vertices) and connections (edges), and reason about the network's structure instead of the geography.
That same 'reduce it to a precise, repeatable procedure' thinking is an ALGORITHM: a step-by-step recipe of instructions and decisions that solves a problem the same correct way every time, whether it is sorting shapes by their properties, checking if two triangles are congruent, or working out how a network connects.
- Konigsberg's seven bridgesEuler's network model proved the walk was impossible, without testing every route
- A flowchart for sorting shapeseach decision (how many sides? are all angles equal?) is one step of an algorithm
- A city's bus route mapa network of stops (vertices) and routes (edges) between them
- A computer network diagramdevices are vertices, cables or connections are edges
What students will be able to do
Students will design and describe a step-by-step algorithm for a geometric task (sorting shapes, testing congruence, or a construction), test and refine an algorithm to fix a flaw, and interpret a network diagram, using Euler's formula to relate its vertices, edges and faces.
- I can describe what makes a sequence of instructions an 'algorithm', and explain why the ORDER of steps matters.
- I can design a step-by-step algorithm that sorts or classifies a set of shapes by their attributes.
- I can design and test an algorithm that decides whether two shapes are congruent, such as the SSS test for triangles.
- I can identify a flaw in an algorithm and refine it so it works correctly in every case.
- I can identify the vertices, edges and faces of a connected planar network and apply Euler's formula (V - E + F = 2) to find a missing value.
Standards this unit teaches
- AC9M7SP04Australian Curriculum v9 (ACARA)Algorithms to sort shapes
Design and create algorithms involving a sequence of steps and decisions that will sort and classify sets of shapes according to their attributes, and describe how the algorithms work.
- AC9M8SP04Australian Curriculum v9 (ACARA)Algorithms for congruence
Design, create and test algorithms involving a sequence of steps and decisions that identify congruency or similarity of shapes, and describe how the algorithm works.
- AC9M9SP03Australian Curriculum v9 (ACARA)Algorithms for constructions
Design, test and refine algorithms involving a sequence of steps and decisions based on geometric constructions and theorems; discuss and evaluate refinements.
- AC9M10SP03Australian Curriculum v9 (ACARA)Algorithms for spatial problems
Design, test and refine solutions to spatial problems using algorithms and digital tools; communicate and justify solutions.
- AC9M10SP02Australian Curriculum v9 (ACARA)Networks
Interpret networks and network diagrams that model relationships in real situations and describe how things are connected.
Prior knowledge
This unit builds on skills students should already have met. Revisit any that are shaky first.
- Year 7-8 angles, polygons & enlargement worksheetknowing shape properties (sides, angles) is what an algorithm for sorting shapes actually checks
- Year 9 Pythagoras & trigonometry teaching unitthe geometric reasoning this unit's construction and congruence algorithms build on
- Order of operationsfollowing a fixed sequence of steps in the correct order is the same discipline an algorithm requires
Words to teach and display
- Algorithm
- a precise, step-by-step sequence of instructions and decisions that solves a problem the same correct way every time
- Flowchart
- a diagram that shows an algorithm's steps and decision points visually, using boxes and arrows
- Refine (an algorithm)
- to test an algorithm, find a case where it fails or is inefficient, and adjust its steps to fix it
- Network (graph)
- a set of points (vertices) connected by lines (edges), used to model relationships or connections
- Vertex / edge / face
- a network's connection points (vertices), the links between them (edges), and the regions they enclose (faces, including the outer region)
- Euler's formula
- for any connected planar network, V - E + F = 2, relating the number of vertices, edges and faces
Teach it: concrete, pictorial, abstract
The lesson moves from things students can hold, to pictures and diagrams, to the written maths. The diagrams below are drawn from data, so they are accurate and print cleanly. Teach straight from them.
1. Designing an algorithm to sort shapes
ConcreteAn algorithm is a precise sequence of steps and decisions, precise enough that anyone (or any computer) following it reaches the same correct result every time. Designing one for a geometric task starts with listing the exact PROPERTIES to check, and the ORDER to check them in.
To sort a mixed set of quadrilaterals into squares, rectangles, and 'other', an algorithm might run: Step 1, count the sides (must be 4, else 'not a quadrilateral'). Step 2, check if all four angles are 90 degrees (if not, classify as 'other'). Step 3, check if all four sides are equal length (if yes, 'square'; if no, 'rectangle'). Following these three steps IN ORDER classifies any quadrilateral correctly, and the same three steps work for every shape tested, not just one example.
- Why does an algorithm need to specify an ORDER for its steps, not just a list of checks?
- What is the difference between an algorithm and a single one-off calculation?
2. An algorithm for testing congruence (SSS)
ConcreteChecking whether two triangles are congruent (identical in size and shape) is itself an algorithm: a fixed procedure applied consistently to any two triangles, called the SSS (side-side-side) test.
SSS algorithm: Step 1, measure all three sides of triangle 1. Step 2, measure all three sides of triangle 2. Step 3, compare the two sets of three lengths (sorted smallest to largest). If all three pairs match exactly, the triangles are congruent; if any pair differs, they are not.
Triangle 1 has sides 5 cm, 7 cm, 9 cm. Triangle 2 has sides 9 cm, 5 cm, 7 cm. Apply the SSS algorithm to decide if they are congruent.
- Sort triangle 1's sides smallest to largest: 5, 7, 9.
- Sort triangle 2's sides smallest to largest: 5, 7, 9.
- Compare the sorted lists: 5=5, 7=7, 9=9, every pair matches.
Answer: The triangles are congruent (SSS), because sorting removes the effect of the sides being listed in a different order; all three lengths match exactly.
- Why does the algorithm SORT the side lengths before comparing them?
- Would the SSS algorithm still work correctly if you skipped the sorting step? Why is sorting necessary, not just convenient?
3. Testing and refining an algorithm
PictorialA good algorithm is TESTED against tricky cases, not just easy ones, and REFINED (fixed) whenever a case reveals a flaw. This is exactly how real geometric construction algorithms, and software, are developed.
Take this shape-sorting algorithm: Step 1, check if all four sides are equal length; if yes, output 'square'. Tested on a square, it works. But tested on a RHOMBUS (four equal sides, but angles NOT all 90 degrees), it wrongly outputs 'square' too, since the algorithm never checked the angles. The refined algorithm adds a second condition: Step 1, check if all four sides are equal length. Step 2, IF Step 1 is true, ALSO check if all four angles are 90 degrees; only if BOTH are true, output 'square' (otherwise 'rhombus').
A shape has four equal sides of 6 cm each, and angles of 70, 110, 70 and 110 degrees. Run the refined two-step algorithm (equal sides AND all angles 90) on it.
- Step 1: are all four sides equal? Yes, all are 6 cm.
- Step 2: are all four angles 90 degrees? No, they are 70 and 110 degrees.
- Since Step 2 fails, the shape is NOT a square.
Answer: The shape is a rhombus, not a square: it passes the equal-sides test but fails the right-angle test, exactly the flaw the refinement was designed to catch.
- Why did the original one-step algorithm wrongly classify a rhombus as a square?
- What is the difference between TESTING an algorithm and REFINING it?
4. Networks and Euler's formula
AbstractA network (or graph) models connections using VERTICES (points) and EDGES (the lines joining them). For any CONNECTED, PLANAR network (one that can be drawn without edges crossing), Euler discovered a fixed relationship between the number of vertices (V), edges (E) and faces (F, including the outer, unbounded region): V - E + F = 2.
A simple network of a triangle (3 vertices joined pairwise) has V = 3 vertices and E = 3 edges. It divides the plane into F = 2 faces: the triangle's inside, and the outside. Check Euler's formula: V - E + F = 3 - 3 + 2 = 2. It holds.
A connected planar network has 6 vertices and 10 edges. Use Euler's formula (V - E + F = 2) to find the number of faces, F.
- Write Euler's formula: V - E + F = 2.
- Substitute the known values: 6 - 10 + F = 2.
- Simplify: -4 + F = 2.
- Solve for F: F = 6.
Answer: The network has F = 6 faces (including the outer region).
- What does the 'outer region' count as in Euler's formula, and why is it included?
- What two conditions must a network satisfy before Euler's formula can be applied to it?
Common misconceptions and how to address them
MisconceptionAn algorithm is the same as just 'a method' or 'an idea', it does not need to be precise.
Why it happens: Students use 'algorithm' loosely for any general approach.
How to address it: An algorithm must be precise enough that following the SAME steps always gives the SAME correct result, with no ambiguous or missing decisions; a vague description ('check if it looks like a square') is not yet an algorithm.
MisconceptionIf an algorithm works on the examples tested, it must work on every case.
Why it happens: Students treat passing a few tests as proof of correctness.
How to address it: Testing can only show an algorithm FAILS (by finding a counterexample, like the rhombus); it can never fully prove an algorithm always works unless every possible case has genuinely been considered. Always test tricky, not just easy, cases.
MisconceptionAny diagram of connected dots and lines is a valid network for Euler's formula, even if it is not planar or not connected.
Why it happens: Students apply V - E + F = 2 without checking the two required conditions.
How to address it: Euler's formula V - E + F = 2 only holds for a network that is BOTH connected (every vertex reachable from every other) AND planar (drawable with no edges crossing). Check both conditions before applying the formula.
MisconceptionThe 'outer region' surrounding a network should not be counted as a face.
Why it happens: Students count only the enclosed regions and forget the unbounded outside area.
How to address it: Euler's formula always counts the outer, unbounded region as ONE of the faces; leaving it out undercounts F by exactly one and makes the formula appear not to work.
Guided practice (with answers)
1. Describe, in ordered steps, an algorithm that sorts a set of triangles into 'equilateral', 'isosceles' or 'scalene'.
Answer: Step 1: measure all three sides. Step 2: if all three are equal, output 'equilateral'. Step 3: else if exactly two are equal, output 'isosceles'. Step 4: else output 'scalene'.
2. Triangle A has sides 4 cm, 6 cm, 8 cm. Triangle B has sides 6 cm, 8 cm, 4 cm. Are they congruent by SSS?
Answer: Yes, because sorted, both are 4, 6, 8: every pair of side lengths matches exactly.
3. An algorithm classifies any shape with 4 equal sides as a 'square', with no other checks. Give one shape that would be wrongly classified, and explain why.
Answer: A rhombus with four equal sides but angles that are not 90 degrees; the algorithm never checks the angles, so it wrongly outputs 'square' for a non-square rhombus.
4. A connected planar network has 5 vertices and 7 edges. Find F using Euler's formula.
Answer: F = 4, because V - E + F = 2 gives 5 - 7 + F = 2, so -2 + F = 2, so F = 4.
5. A connected planar network has 8 vertices and 5 faces (including the outer region). Find E.
Answer: E = 11, because V - E + F = 2 gives 8 - E + 5 = 2, so 13 - E = 2, so E = 11.
Independent practice worksheets
Practise algorithm concept questions and Euler's formula calculations with computed, never-wrong answer keys.
Differentiation
- Provide a partially-completed flowchart (some boxes filled in) for students to complete, rather than designing an algorithm from a blank page.
- Use physical shape cut-outs so students can PHYSICALLY sort them by following the algorithm's steps in order, before writing the steps down.
- For Euler's formula, always list V, E and F in a small table before substituting, so the formula's three separate values are never confused.
- Work through the rhombus 'refine' example (section 3) as a class demonstration before asking students to find their own algorithm flaw.
- Design an algorithm for the SAS (side-angle-side) or ASA (angle-side-angle) congruence tests, not just SSS, and compare which test is more efficient for different given information.
- Research the Konigsberg bridges problem in more depth and explain, using vertex degree (how many edges meet at a vertex), why Euler proved the walk impossible.
- Investigate Euler's formula for a network with a disconnected piece, or a non-planar network, and discuss why V - E + F = 2 no longer holds.
- Write an algorithm, as a flowchart, for a real compass-and-straightedge construction (e.g. bisecting an angle), and test it by having a partner follow it exactly.
Assessment: exit ticket
A three-question exit ticket sampling algorithm design, testing an algorithm, and Euler's formula.
1. What makes a sequence of instructions an 'algorithm', rather than just a general idea?
Answer: It must be precise and step-by-step, so that following the same steps always produces the same correct result, with no ambiguous decisions.
2. An algorithm classifies any 4-sided shape with one pair of parallel sides as a 'trapezium', with no further checks. Would a parallelogram (two pairs of parallel sides) be classified correctly? Explain.
Answer: It depends: since a parallelogram DOES have one pair of parallel sides, the algorithm would classify it as a 'trapezium' too, unless it also checks whether there is a SECOND pair of parallel sides; this is a flaw needing refinement.
3. A connected planar network has 7 vertices and 12 edges. Find the number of faces using Euler's formula.
Answer: F = 7, because V - E + F = 2 gives 7 - 12 + F = 2, so -5 + F = 2, so F = 7.
Teacher notes and timings
- Rough timing across four lessons: Lesson 1 designing algorithms (section 1), Lesson 2 testing congruence with SSS (section 2), Lesson 3 testing and refining (section 3), Lesson 4 networks and Euler's formula plus the exit ticket (section 4 and assessment).
- This unit deliberately spans Year 7 to Year 10 in a single thread: AC9M7SP04 (sorting shapes) through AC9M8SP04 (congruence/similarity) and AC9M9SP03 (constructions) to AC9M10SP03 (general spatial problems) all repeat the SAME 'design, test, refine an algorithm' pattern applied to increasingly abstract geometric content, so this unit teaches that pattern once and shows it recurring, rather than four disconnected lessons.
- AC9M10SP02 (networks) is bundled into the same unit because it shares the Space strand's algorithmic-thinking theme; Euler solved the Konigsberg problem by modelling it, exactly the reduce-it-to-a-precise-model instinct this unit's algorithm sections build. It is otherwise a standalone, single-year descriptor.
- This is a distinctly Australian Curriculum strand with no direct US Common Core equivalent (Common Core has no matching 'design algorithms for geometry' or 'networks' standard at this year range), so every curriculum code here is ACARA-only; this is intentional, not an oversight.
- No diagram figure is used for the network content in section 4: this site's coordinate/geometry figure components do not include a general graph/network drawing engine, so networks are taught through clearly labelled worked examples (vertex/edge/face counts) instead of inventing a new figure kind, consistent with the 'reuse existing figures only' rule.
- Present and print both work: use Present to build the shape-sorting flowchart live with the class (section 1), or to work through the rhombus refinement (section 3) as a worked discussion before students attempt their own algorithm flaws.