acm-header
Sign In

Communications of the ACM

Last byte

Partitioned Peace


Partitioned Peace, illustration

Credit: Getty Images

In a mythical land of rhetorically encouraged antagonism, different factions manage to co-exist, though poorly. Imagine a set of red and blue hill towns connected by a network of roads. People in the red towns deal well with one another. People in the blue towns deal well with one another. But when a person from a red town travels through a blue town or vice versa, things can get unpleasant. The leaders of the red and the blue towns get together and decide the best way to resolve their differences is to perform a series of swaps in which the inhabitants of k red towns swap towns with the inhabitants of k blue towns with the end result that a person from a blue town can visit any other blue town without passing through a red town and likewise for a person from a red town. We call such a desirable state "partitioned peace." The goal is to make k as small as possible.

Warm-Up 1. Given the configuration in the figure here, what is the minimum number of swaps needed to achieve partitioned peace?


 

No entries found

Log in to Read the Full Article

Sign In

Sign in using your ACM Web Account username and password to access premium content if you are an ACM member, Communications subscriber or Digital Library subscriber.

Need Access?

Please select one of the options below for access to premium content and features.

Create a Web Account

If you are already an ACM member, Communications subscriber, or Digital Library subscriber, please set up a web account to access premium content on this site.

Join the ACM

Become a member to take full advantage of ACM's outstanding computing information resources, networking opportunities, and other benefits.
  

Subscribe to Communications of the ACM Magazine

Get full access to 50+ years of CACM content and receive the print version of the magazine monthly.

Purchase the Article

Non-members can purchase this article or a copy of the magazine in which it appears.
Sign In for Full Access
» Forgot Password? » Create an ACM Web Account