Skip to main content
Codepiko
TR
All activities

To save a PDF, choose "Save as PDF" as the destination in the print window.

Networks: muddy town

The big idea

Houses and the streets between them make a network; computer science calls it a graph. You do not need every street to connect every house: one street fewer than the number of houses is enough, and those streets never make a loop. Trying the streets from the cheapest up and skipping any that would make a loop gives the lowest cost every time.

Where do we meet it?

An electricity company wants to connect villages with as little cable as it can. Internet cables, water pipes and gas lines are planned the same way. Computer networks also choose a loop-free way through their connections so that a message does not go round and round for ever.

40 minutes in classFor teachers

  1. 5 minGetting attentionAfter the rainDraw five houses on the board with streets between them, and write a number on each street. Tell the story: “It rained and the town sank into mud. The council has few stones. Every house must reach every other house, but no stone may be wasted.” Ask the class which streets they would pave.
  2. 12 minLessonA town on the tableGroups of four use the first map on the sheet. They put a button or a scrap of paper on each street they pave and add up the stones. Write the totals on the board; the group with the fewest stones explains how they thought.
  3. 15 minLessonStart with the cheapestStart the second map together: which street is cheapest? Pave it. And the next one? Skip a street that joins two houses already connected. Pairs finish the rest; those who finish move on to the Muddy Town game.
  4. 8 minAssessmentHouses and streetsCount the streets the groups paved: 6 for 7 houses, 7 for 8 houses. Let the class find the rule: one fewer than the houses. Exit card: “A village has 20 houses. How many roads must be paved at least, and why?”

Codepiko · Computer science: Networks: muddy town

Stone streets

Goal: Connect every house to every other house with as few stones as you can.

Time: 30 min · You need: Pencil, coloured pencil; for class play, buttons or scraps of paper

Name:
Class:
Date:

1. Save the town from the mud

After the rain the streets turned to mud. The number on a street is the stones it takes to pave it. Every house must reach every other house along paved streets. Colour the streets you pave and add up the stones: the fewer, the better.

653472654897ABCDEFG

Total stones:

2. Start with the cheapest

This time there is a rule. Try the streets one by one, starting with the cheapest. If a street joins two houses that can already reach each other, skip it; otherwise colour it and write it in the table.

47358269478398ABCDEFGH
#StreetStones
1
2
3
4
5
6
7
Total

3. Think

Write short answers.

How many houses did each town have, and how many streets did you pave? What if you paved one more?

codepiko.com