Problem Statement For the upcoming world-cup, the Indian Cricket Selection Committee has to come up with a possible batting order for their players. Instead of using the traditional approach they have decided to use computer algorithms to come up with all the possible batting orders and then decide from that.
1. Problem Statement For the upcoming world-cup, the Indian Cricket Selection Committee has to come up with a possible batting order for their players. Instead of using the traditional approach they have decided to use computer algorithms to come up with all the possible batting orders and then decide from that. The algorithm however requires the possible batting positions for each player.
The algorithm takes a list of 11 players. Each player can have more than one position they can bat at. Your job for now is to help the selection committee calculate the total number of unique batting charts such that every player gets exactly one batting position from their list of positions and no two players are given the same batting position in one batting chart.
Requirements:
1. Formulate an efficient algorithm using dynamic programming to perform the above task.
2. Analyse the time complexity of your algorithm.
3. Implement the above problem statement using Python 3.7 I
nput: Input should be taken in through a file called “inputPS7.txt” which has the fixed format mentioned below using the “/” as a field separator:
Player / < position 1> / < position 2> / < position 3>…. Ex:
P1 / 1 / 2 / 3 / 4
P2 / 1 / 5 / 9 / 2 / 6 / 7 / 8
P3 / 1 / 2 / 7 / 10 / 3
P4 / 1 / 9 / 2 / 6 / 7 / 10 / 3 / 4
P5 / 5 / 9 / 2 / 8 / 3 / 4
P6 / 1 / 5 / 3 / 6
P7 / 6 / 7 / 4
P8 / 1 / 9 / 2 / 4
P9 / 9 / 6 / 11 / 3 / 4
P10 / 1 / 5 / 9 / 7 / 8 / 4
P11 / 6 / 11 / 7 / 10
Note that the input data shown here is only for understanding and testing, the actual file used for evaluation will be different.
Output: Syntax of the output should be: The total number of allocations possible is: Ex: The total number of allocations possible is: 4646. Display the output in outputPS7.txt.
use data structures and wriite necessary comments.