Transportation:
Presuming that your location has some form of public transportation, there will be intersection points where multiple lines meet. Lacking public transit locally, there is still the nearest commercial airport. In many cities the bus, or rail, system has a hub, which makes a good example for a larger data-set.
At the chosen point, multiple bus lines connecting, the bus terminal, or airport, create a 'table' of the departures, grouped by route number, destination, carrier, etc.
Selecting one bus stop I frequent, there are 5 different buses which stop there. One is a short circulator, one is a long-range route with frequent service, and the others are 'normal' routes. Creating a 2-dimensional array with only those five routes gives a nicely 'ragged' array.
[
12 [05:46,06:46,07:46,08:46,09:46,10:46,11:46,12:46,13:46,14:46,15:46,16:46,17:46,18:46,19:41],
15 [06:26,06:56,07:21,07:41,07:56,08:16,08:31,08:56,09:19,09:59,10:39,11:19,11:59,12:39,13:19,13:54,14:22,14:42,15:02,15:27,15:47,16:07,16:27,16:47,17:07,17:27,17:46,18:01,18:21,18:36,19:01,19:25,19:55,21:05,22:15,23:25],
18 [00:15,05:06,05:46,06:10,06:37,06:55,07:10,07:30,07:45,08:00,08:15,08:30,08:45,09:00,09:15,09:30,09:45,10:00,10:12,10:27,10:42,10:57,11:12,11:27,11:42,11:57,12:12,12:27,12:42,12:57,13:12,13:27,13:42,13:57,14:12,14:27,14:42,14:59,15:12,15:27,15:42,15:57,16:12,16:27,16:42,16:57,17:07,17:17,17:27,17:37,17:52,18:07,18:22,18:37,18:52,19:07,19:22,19:42,20:07,20:32,20:57,21:22,21:52,22:22,22:50,23:20],
43 [04:43,05:13,05:50,06:24,06:51,07:21,07:51,08:21,08:51,09:26,10:01,10:46,11:51,12:56,13:38,14:06,14:51,15:21,15:56,16:26,16:56,17:31,18:05,18:40,19:20,20:40,22:00,23:30],
71 [06:10,06:46,07:21,07:56,08:31,09:11,09:51,10:49,11:44,12:39,13:34,14:29,15:06,15:41,16:16,16:51,17:26,17:55,18:45,20:00,21:20]
]
Stop #3860
Possible sequence of learning:
- Hypothetical transfer point with an 'even' array, each bus departs in half-hour intervals and has the same number of departures. Develop procedures to process that table.
- Change the schedule for one route to every 20 minutes, and add an extra couple hours to another route. Now, with a ragged array, see how the procedures break, and how to fix them.
- Create a new table, based on "live" data. See if the new procedures can handle that, and fix whatever breaks.
- Add a third dimension by making the table cover both, or all 4, directions buses can depart in. Again, see how well the procedures handle the new dimension, fixing what breaks.
- The bus stop I used has buses going three different directions (W[15,43], NW[12.71], S[18]) from the one bench. Across the street are two more stops, one with departures in three directions (NE[71], E[15], SE[18,43]) and the other with a single direction (S[12]). By stop there are three elements at the top level, and by direction there six elements.
- Add another layer of complexity by adding stops to the routes, in a new table. Each route has a number of 'time points' which are usually in a printed/published schedule. The times for each bus, on each route, can become a 3-dimensional table as well.
- Change the whole data-set by switching from bus stops to a hub, such as an airport, train depot, or truck terminal.
Bonus:
With the two sets of tables developed, you are now in a position to move into directed graphs. No longer do the traveling sales agents have to travel some foreign routes to unknown places with "costs" which are hypothetical. Now they can travel to known points in the city with real-world time constraints based on catching buses and making transfer connections.