Optimally Locating Public Services

Two perspectives on the same problem: A. There are n (n=3, 4, 5, 6) post offices in the city. How can you optimally decide what areas of the city each should cover? [Drag the colored dots and circles to place the post offices - the applet will draw the optimal regions.] What does the applet regard as optimal? How does it construct the region boundaries? B. If in a city, there are n regions separated by canals, how can you decide on the optimal location of post offices? [i.e., given the boundaries drawn by the program in any given instance, can you locate the points that gave rise to those boundaries?]