Bilateral projects A friend of yours works at an undisclosed company in the mobile industry, and needs your help. The company has offices in Helsinki and New York, and collaboration between the two offices is extensive. The situation is that each of the many but small projects is handled by a two-person team with a member in each city. While emails, faxes, and phones are wonderful, and work well within each team, the CEO wants a briefing every year on the projects. For this purpose the CEO invites representatives from the projects to Barbados for a week of beach fun presentations of all the projects. However, money is tight and a new policy has been created: the CEO wants at least one person from each project, and additionally, she wants to invite as few people as possible.
This is where you come in. In order to help your friend get a ticket to Barbados, you are to write a program that, given all the two-person teams, computes the smallest number of people that must be invited in order to get at least one person from each project, as well as a list of people to invite. If possible (subject to the set of people being smallest possible), the list of invitees should include your friend.
Input Sample of the data can be found in the /data folder. The file contains a list of strings, where each string contain two integers, i, j separated by a space. The integers represent the employee IDs of the two employees in that team (the first one is from Helsinki and the second one is from New York). Helsinki employees have IDs in the range 1000 to 1999 and New York employees have IDs in the range 2000 to 2999. An employee can be a member of several teams, but there cannot be several teams consisting of the same pair of employees. Your friend has ID 1009.
You should use this data, assuming that a different file with the same format will be replaced when your entry is being judged, and the program should work without modifications.
Pressing this button should run your code, and the results should be gathered in the
- element #selectees
NOTE: To test the code please place it on your local server environment.