Map Robot Lab: Plans Change, Re-planning and the Order of Stops
Level 6 of Map Robot Lab hides a closed road on the way to the Hospital. A plan made at the start drives straight into it and stops at (5,5). Students put plan a route and drive one block of the route inside a loop, so the van plans again after every block, and it arrives in 12 blocks and 18 minutes after 12 plans. Level 8 has three deliveries. In the job list's order they take 31 minutes; going to the closest stop next takes 18, and the table lists all six orders, so students can check that it is the best here. With 10 stops there would be 3,628,800 orders, which is why apps use shortcuts.
At a glance
Essential question
What should a program do when the world changes, and how do you choose the order of several jobs?
Objectives
Students will be able to:
- explain why a plan made at the start fails when a road is closed
- program the van to plan again after every block
- break a delivery job into choosing a stop, planning and following
- compare the job list's order with the closest stop next
- explain why checking every order gets slow as the stops grow
Vocabulary
Re-planning, Decompose, Order, Closest next, Heuristic, Brute force
Standards
2-AP-13, 2-AP-12, 1B-AP-08
Time and materials
45 minutes, grades 6-8.
- One computer or Chromebook per student
- A projector
- The worksheet and exit ticket, one copy each per student
- The rubric, one copy per student if you grade the work
Prep
Make copies of the worksheet and exit ticket. Before class, open mytekdev.com/try/maprobotlab?lesson=plans-change-re-planning-and-the-order-of-stops&ref=tpt-maprobotlab-4 once on a student computer, which checks that your school's filter allows the app, and follow the short guide yourself: about ten minutes.
Assessment
- Formative: the questions under What to look for, asked while students work, and the exit ticket (answer key included).
- Summative: the worksheet, scored with the rubric.
Technology and privacy
Runs in any browser, Chromebooks included, with nothing to install. Students need no account and no email: the link works signed out, and nothing they do is stored on our server unless they choose to save.
mytekdev.com/try/maprobotlab?lesson=plans-change-re-planning-and-the-order-of-stops&ref=tpt-maprobotlab-4mytekdev.com/tools/map-robot-lab/lessons/plans-change-re-planning-and-the-order-of-stops/startEach student gets their own copy, and the same link reopens it next time. How to set up a classLesson sequence
| Minutes | Stage | What you do | What students do |
|---|---|---|---|
| 0 to 5 | Warm-up Hook | Show the title, essential question and Today I can slides (about 1 minute). Then the warm-up: the road ahead is closed. | Answer the warm-up on the worksheet. |
| 5 to 12 | Direct instruction (I do) Model it | Project Level 6 with the starter. The town fills the view from above: a lake in the middle, a green avenue around the edge where each road takes 1 minute, gray streets that take 2, and Main Street, stuck in traffic, at 5. Each road shows its minutes. The card at the right says the level's goal and, after each run, what happened, with the run's own numbers. The Trip log counts blocks, minutes, school roads and plans made, and the charts under the map keep every route tried on the trip. Open Blocks: plan a route to the goal, then follow the route, with a road costing its minutes. Press play: the van drives 8 blocks and stops at (5,5), where the cones pop up. Show the Road closed slide. | Predict, watch, and fill in the vocabulary on the worksheet. |
| 12 to 24 | Guided practice (We do) Closed road, then three stops | Students open the link or scan the QR code. A short guide walks them through putting the plan inside a repeat until arrived loop with drive one block of the route, then Level 8, where the same program delivers in the list's order. Slower, Real time and Speed up, under the map, change only how fast the van moves on the screen; the minutes do not change. Step moves the van one block, or the ripple one corner. The round play button runs the program from the start. Watch for: Students who use follow the route inside the loop. The van then drives the whole plan before it can plan again; drive one block of the route is the block that lets it learn as it goes. | Follow the guide. Write each run's blocks, minutes and plans on the worksheet. |
| 24 to 37 | Independent practice (You do) The closest stop next | Show the stat slide, then the closest next slide. Students build the closest-next program from the Stops blocks, with the card's hint, run it, and fill in the table of six orders from the Trip log. Walk the room with the What to look for questions. If they ask: "Your program has three parts inside the loop. What are they, and what does each do?" Decompose It's working when: 3 stops: 3 x 2 x 1 = 6 orders. 10 stops: 10 x 9 x ... x 1 = 3,628,800. | Build the program, run it, fill in the six orders, and answer the questions. |
| 37 to 45 | Closure Plans change. And exit ticket | Show the closure slide and take answers. Name the ideas: re-planning when the world changes, decomposing a job, and a heuristic when checking everything is too slow. Hand out the exit ticket. | Discuss, then answer the exit ticket. |
Before you teach: a ten-minute walkthrough
Open mytekdev.com/try/maprobotlab?lesson=plans-change-re-planning-and-the-order-of-stops&ref=tpt-maprobotlab-4. A short guide opens over Level 6, Road closed. The town fills the view from above: a lake in the middle, a green avenue around the edge where each road takes 1 minute, gray streets that take 2, and Main Street, stuck in traffic, at 5. Each road shows its minutes. The card at the right says the level's goal and, after each run, what happened, with the run's own numbers. The Trip log counts blocks, minutes, school roads and plans made, and the charts under the map keep every route tried on the trip.
- One plan. The starter blocks plan the fastest route to the Hospital and follow it. Press play: 8 blocks and 8 minutes, then the cones pop up at (5,5), and the van stops.
- Plan again. Put repeat until arrived under when started, with plan a route to the goal and drive one block of the route inside it. The van plans 12 times and arrives in 12 blocks and 18 minutes. The Trip log's best, knowing the closure from the start, is 14 blocks in 14 minutes.
- Level 8. Open Levels and start Level 8. The same program delivers in the job list's order, Zoo, Pizza Place, Library: 29 blocks, 31 minutes. The table lists all six orders: 31, 22, 19, 18, 26 and 34 minutes.
- Closest next. While there are stops left: set the best to none and its minutes to 1000; for each stop, if minutes to the stop is less, keep it; go to the best next; plan a route; follow it. Pizza Place, Library, Zoo: 16 blocks, 18 minutes, the best here.
- Speed. Slower, Real time and Speed up, under the map, change only how fast the van moves on the screen; the minutes do not change. Step moves the van one block, or the ripple one corner. The round play button runs the program from the start. The town has no randomness: the same program drives the same way on every run and every computer.
Background for the teacher
The van learns about a closed road only when it gets there, so a plan made at the start cannot know. Planning again after every block uses everything learned so far. Real map apps keep getting news while you drive, such as traffic and closed roads that other drivers report, and they plan again when something changes. That is how they reroute you.
Ordering stops gets slow fast: 3 stops have 6 orders, 10 have 3,628,800. Delivery apps use shortcuts like closest next, then try swapping stops to do better. Closest next is quick, but it isn't always the very best. The ripple is a simple version of what computer scientists call Dijkstra's algorithm, worked out in 1956 and published in 1959. Real map apps use the same idea with extra tricks that make it fast enough for millions of roads, and they get news while you drive, such as traffic and closed roads other drivers report.
Software engineers who build maps and delivery apps write route planners like this one, and logistics planners decide what a route should cost: time, fuel, tolls or safety. Software developers earned a median of $133,080 in May 2024 (U.S. Bureau of Labor Statistics).
What to look for
Ask these while students work. A student who has understood the lesson can answer them without help:
- Why did the first plan drive into the closed road?
- Why is it drive one block of the route, and not follow the route, inside the loop?
- What are the three parts of the closest-next loop?
- Why did the job list's order take 31 minutes?
- Why don't apps check every order for a delivery truck?
Cross-curricular extensions
- Math: 3 stops have 3 x 2 x 1 = 6 orders. Write the counts for 4, 5 and 6 stops. How many times bigger is each?
- Social studies: how do school buses or mail carriers choose their routes? Ask someone who drives one.
- Writing: describe a day your plans changed, and what new information made you change them.
- Careers: look up what a logistics planner does.
Vocabulary
| Re-planning | Making a new plan when you learn something new, like a closed road. |
| Decompose | Break a problem into smaller parts: pick a stop, plan a route, follow it. |
| Order | Which stop comes first, second and third. Three stops have 6 orders. |
| Closest next | A shortcut: always go to the stop with the fewest minutes from where you are. |
| Heuristic | A quick rule that usually gives a good answer, but not always the very best. |
| Brute force | Trying every possibility. It finds the best, but gets slow fast. |
Differentiation
English learners
- Keep the vocabulary slide up, and point at the van, the road numbers or the Trip log as you say each word: the picture carries the meaning.
- Give a sentence frame on a card: The first plan failed because ____. The van planned again ____.
- Act out closest next: three students are stops, and the van walks to the nearest one each time.
Students with IEPs or 504 plans
- Pair students, one at the keyboard and one recording results.
- Give a printed picture of the closest-next blocks to copy.
- Where the IEP allows a modified assignment, score the first two rubric rows only.
Students who need more support
- Do Level 6 together on the projector before students start.
- Write the three parts of the closest-next loop on the board: find the closest, go to it next, plan and follow.
- The card says what to try after every run that misses.
Students ready for more
- Change the closest-next program to plan with every road costing 1. Why does it take 36 minutes in the same order?
- Build a town on Level 9 where closest next is not the best order, and prove it with the table.
- How many orders do 5 stops have? 6? Make a table and say how fast it grows.
Adapting for other grades
Younger students: In grade 5, do Level 6 together on the projector, and on Level 8 fill in the six orders from the table without building the closest-next program. Score the first two rubric rows, total 8, and 6 meets the objectives.
Older students: In high school, name the problem: ordering stops is a version of the traveling salesperson problem, which has no known fast way to find the very best order for many stops. Compare closest next with trying every order on paper for 4 stops.
Map Robot Lab: Plans Change, Re-planning and the Order of Stops
Student worksheet
Name: ______________________________ Date: ______________
Open the app: scan the QR code, or go to mytekdev.com/try/maprobotlab?lesson=plans-change-re-planning-and-the-order-of-stops
Essential question: What should a program do when the world changes, and how do you choose the order of several jobs?
Warm-up: The road ahead is closed. What do you do? What does a map app do? ________________________
- Vocabulary. Re-planning, decompose, order, closest next, heuristic, brute force: write each in your own words.
- Level 6. One plan: stopped at (____ , ____) after ____ blocks. Plan again every block: ____ blocks, ____ minutes, ____ plans.
- Level 8, all six orders. Zoo, Pizza Place, Library: ____ min. Zoo, Library, Pizza Place: ____. Pizza Place, Zoo, Library: ____. Pizza Place, Library, Zoo: ____. Library, Zoo, Pizza Place: ____. Library, Pizza Place, Zoo: ____.
- Closest next. Order: ________________. ____ blocks, ____ minutes. The best of the six? ____
1. Why does the van plan again after every block, and not just once?
2. How many orders would 5 stops have? Why don't apps check them all for 30 stops?
Map Robot Lab: Plans Change, Re-planning and the Order of Stops
Exit ticket
Name: ______________________________
1. The van finds a closed road only when it gets there. A good program: (A) plans once at the start (B) plans again as it learns (C) stops and waits
2. Three stops have how many orders? (A) 3 (B) 6 (C) 9
3. A friend says closest next always finds the best order. Use what you learned today to answer.
Answer key: exit ticket
| Question | Answer | Why |
|---|---|---|
| 1 | B | Each new plan uses what the van has learned, so it goes around the closure. |
| 2 | B | 3 choices for the first stop, 2 for the second, 1 for the last: 3 x 2 x 1 = 6. |
| 3 | Open answer | It found the best here, 18 minutes, but it is a shortcut: it only looks at the next stop, so in another town it can miss the best order. Checking every order finds the best, but gets too slow as the stops grow. |
Worksheet: what students should find
| Blank | What the app shows |
|---|---|
| Level 6 | One plan: stopped at (5,5) after 8 blocks. Plan again: 12 blocks, 18 minutes, 12 plans. |
| Level 8, all six orders | 31, 22, 19, 18, 26, 34 minutes, in the order on the worksheet. |
| Closest next | Pizza Place, Library, Zoo: 16 blocks, 18 minutes. Yes, the best of the six here. |
| Question 1 | A plan made at the start cannot know about the closure; each new plan uses what the van just learned. |
| Question 2 | 5 x 4 x 3 x 2 x 1 = 120. For 30 stops the count is far too big to check, so apps use shortcuts. |
Rubric
Score each row from 1 to 4.
Name: ______________________________
| Criteria | 4 Exceeds | 3 Meets | 2 Approaching | 1 Beginning |
|---|---|---|---|---|
| Re-planning | Re-plans and arrives, and explains with the plan count why each plan used what the van had learned. | Re-plans after every block and arrives. | Puts the plan in a loop but uses follow the route, or does not arrive. | Does not change the program. |
| Decomposing the deliveries | Builds closest next, delivers in 18 minutes, and names the three parts of the loop. | Builds closest next and delivers in 18 minutes. | Builds part of it, or delivers in another order. | Does not build it. |
| Orders and shortcuts | Fills in all six orders and explains why apps do not check every order for many stops, with the count. | Fills in all six orders and says which is best. | Fills in some orders. | Does not compare orders. |
Total: ____ / 12. A score of 9 or more meets the objectives.
Standards
The lesson is built for CSTA 2-AP-13: students decompose a delivery job into choosing the next stop, planning a route and following it, and the re-planning loop into planning and driving one block. Building the loops with conditions and nested steps is 2-AP-12; comparing the job list's order, closest next and all six orders is 1B-AP-08.
| Framework | Code | Grades | Standard | How the lesson meets it |
|---|---|---|---|---|
| CSTA 2017 | 2-AP-13 | 6-8 | Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs. | Students break the Level 8 job into parts, find the closest stop, go to it next, plan and follow, and Level 6's trip into plan and drive one block, and build each part as blocks. |
| CSTA 2017 | 2-AP-12 | 6-8 | Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals. | Students design a repeat until arrived loop around planning and driving, and a while loop with a for each loop and an if nested inside it to find the closest stop. |
| CSTA 2017 | 1B-AP-08 | 3-5 | Compare and refine multiple algorithms for the same task and determine which is the most appropriate. | Students compare three ways to order the same deliveries, the job list, closest next and every order, and decide which is the most appropriate. |
Checked December 2026 against: CSTA K-12 Computer Science Standards, Revised 2017.
Optional: save student work in a free class
The whole lesson runs at the link on the worksheet, with no accounts and no sign-up.
To keep students' work, and see it all in one place, make a free class. It takes about ten minutes, once, and covers every lesson in this series: mytekdev.com/tools/class-setup
Students in a class open mytekdev.com/tools/map-robot-lab/lessons/plans-change-re-planning-and-the-order-of-stops/start instead of the worksheet link. Each one gets their own copy of the starter, and the same link reopens it next time.