Skip to content

3. Composing flight crews

Ardous

Description

During the Second World War the Royal Air Force (RAF) had many foreign pilots speaking different languages and more or less trained on the different types of aircraft. The RAF had to form pilot/co-pilot pairs (crews) for every plane with a compatible language and a sufficiently good knowledge of the aircraft type. In our example there are eight pilots. In the following table every pilot is characterized by a mark between 0 (worst) and 20 (best) for his language skills (in English, French, Dutch, and Norwegian), and for his experience with different two-seater aircraft (reconnaissance, transport, bomber, fighterbomber, and supply planes).

Pilot 1 2 3 4 5 6 7 8
Language English 20 14 0 13 0 0 8 8
French 12 0 0 10 15 20 8 9
Dutch 0 20 12 0 8 11 14 12
Norwegian 0 0 0 0 17 0 0 16
Plane type Reconnaissance 1 8 12 5 0 0 8 0
Transport 10 0 9 14 15 8 12 13
Bomber 0 17 0 11 13 10 0 0
Fighter Bomber 0 0 14 0 0 12 16 0
Supply plane 0 0 0 0 12 18 0 18

Table 3.1 Ratings of pilots

A valid flight crew consists of two pilots that both have each at least 10/20 for the same language and 10/20 on the same aircraft type.

Question 1: Is it possible to have all pilots fly?

Subsequently, we calculate for every valid flight crew the sum of their scores for every aircraft type for which both pilots are rated at least 10/20. This allows us to define for every crew the maximum score among these marks. For example, pilots 5 and 6 have marks 13 and 10 on bombers and 12 and 18 on supply planes. The score for this crew is therefore max(13 + 10, 12 + 18) = 30.

Question 2: Which is the set of crews with maximum total score?

🚀 Test your code

Try to solve the problem below in the code editor before reading the solution.

Answer

Comments