You have been approached by a spy agency to determine the amount of contraband goods that are being traded among several nefarious countries. After being shipped from its country of origin, each container of goods is routed through at least one neutral port. At the port, the containers are mixed up in a warehouse before being sent on their way, so you cannot trace individual containers from their country of origin to their final destination. But satellite cameras can tell you the number of containers traveling in each direction on each leg of the journey. You also know that every container takes the shortest possible route to its destination.
As a warm-up problem, consider illustration 1 (above), which shows the number of containers traveling to and from countries A, B and C and a neutral, centrally located port. Because no containers are observed moving from the neutral port to country B, we surmise that the two containers from country C must have moved on to country A (they cannot turn back to their country of origin). And because only two containers are seen traveling from the port to country A, the two containers from country B must have gone to country C, where they joined the three containers from country A.
This article was originally published with the title High Spies.