Graph Trail — Data Structures

Walk a weighted graph node by node to find the cheapest path, Dijkstra style: 14 levels of shortest paths and directed graphs.

What the levels ask

  1. Mrs. Sari sends lunch tins for Mr. Tono in the rice field. Mr. Bejo sets off from the stall at A, and Mr. Tono waits at D. The number on each road is its minutes. Tap crossroad after crossroad from A to D: the route whose total minutes are smallest, not the one whose first road is cheapest.
  2. Mrs. Yanti sends boxed rice for the neighbourhood head's meeting at T. From S, the road to B is only 2 minutes, and at C there is a turn to A that is only 1 minute: two temptations. Tap the route from S to T whose total is smallest. If two routes are equally fast, both are right.
  3. Ms. Wulan sends a parcel for Grandma Marni. Some alleys here are one way (see the arrows), and the motorbike may not ride against them. Tap the fastest route from X to Z, then watch Mr. Bejo's way back.
  4. Mr. Bayu sends a bank letter for Mr. Jaya. From P to Q there are many routes, some of three roads, some of four. Do not try them all one by one: let the best minutes of each crossroad guide you. Tap the fastest route from P to Q.
  5. Grandpa Rimba sends a herbal drink for Mrs. Ratna. From A there is a road straight through to T: just one road, it looks like a shortcut. Compare it with the way round through B and C. Tap the fastest route from S to T.
  6. Mr. Dodi sends a spark plug for Mr. Karim's boat engine. Market day: every alley here runs one way towards the jetty. Tap the fastest route from X to Y, then see whether Mr. Bejo can get home on this map.
  7. Dina sends a poster for Mr. Piksel's internet cafe. The alleys in this block form a 3 by 3 grid: many routes with the same number of roads, but different minutes. Tap the fastest route from A to I.
  8. Mrs. Ijah sends cakes for Rara. Nearly every route goes through the market square O, and from S there is a road straight there. Tap the fastest route from S to T. Sometimes there is more than one fastest route, and all of them are right.
  9. Mrs. Lastri sends fish for Mrs. Ijah across the stream. There is only one bridge, D to E, so the fastest route must cross there: find the fastest on each bank. Tap the route from A to H.
  10. Bagas sends a game controller for Mr. Arka. The alley from A to C is a dead end: from C you can only go back to A. The other roads are one way. Tap the fastest route from S to G.
  11. The neighbourhood head sends a meeting invitation for Grandpa Rimba. There is a concrete ring road from A straight to F: just one road, but it circles the hamlet. Tap the fastest route from A to F.
  12. Mrs. Endang sends library books for Mrs. Ratna. From S to T there are five layers of crossroads. Picking the cheapest road at each layer does not always give the fastest route. Tap the route from S to T.

And more, 14 levels in all.