A= - 6 is A' Exercise 2: Minimization of scheduling conflicts The transpose of a matrix is formed by interchanging the m
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
A= - 6 is A' Exercise 2: Minimization of scheduling conflicts The transpose of a matrix is formed by interchanging the m
company are trying to minimize scheduling conflicts by scheduling the most popular presentations at different times. First the planners survey the ten participants to determine which of the five presentations they want to attend. Then they construct a matrix A in which a 1 in entry ij means that participant i wants to attend presentation ). The following table and matrix (A) give information about the participation. Participant Presentation 1 2 3 4 1010! 1 1010! 0011 2 001 1 1 0 0 0 0 3 1 0 0 0 01101 4 O!!! It means matrix A = 1 0 0 0 0 0 5 0 0 0 0 0 11000 6 100 0 0 1 0 1 7 0 0 1 0 1 oi oi o 8 0 Too 1010 1 9 1 0 1 0 1 00010 10 0 0 0 1 0 Next the planners calculate the transpose of A(AP) and the matrix product of A' X A. In the resulting matrix, entry ij is the number of participants wishing to attend both presentation i and presentation j. We then have 4 1 2 0 2 1 3 1 1 1 A'A= 2 15 15 0 1 1 3 1 2 15 15 notice that B=A' x A is symmetric (B;, =B, for all i.]), so the entries below the main diagonal (entries ij where i < 1) need not be calculated. If we supply zeros for the unnecessary entries, the resulting matrix is termed upper triangular matrix. The entries on the main diagonal (BA) represent the total participants wanting to attend presentation i. (a) Write a C function TotalPart that creates the matrix A of participants preferences, from data received from data read from a file as sequence of couples of integers, where the first couple is such that the first number represent the number of presentation and the second number represents the number of participants and the rest of couples are such that for each couple the first number represents the participant and the second number represents one of the presentations he/she wants to attend: this means a participant can appear several times in the sequence if he/she wants to attend more than one presentation. For example, the file containing the sequence 3 4 1 2 3 4 1 4 3 1 2 4 will produce 0 1 0 1 A= 0 1 1 0 0 1 (b) Given a matrix T with n rows and p columns and a matrix S with p rows and 4 columns, if the product T x S is equal to P-1 C then C; = 14 Skj. where i = 0,1....,- 1 and j = 0,1.....9-1. Given the matrix of preferences A write the function ComputeAtA that computes A' x A and saves it in another matrix C, and displays how many participants wish to attend each conference. (e) Write a C function AvoidBad Schedule that receives as argument the matrix A of preferences, finds the three largest numbers in the entries above the main diagonal of A' x A, and displays on the screen up to three pairs of presentations that the conference committee should avoid scheduling at the same time. You will display fewer than three pairs if one or more) of the three largest number is 1. (d) Provide a driver program that prompts the user to enter the name (scheduling.txt) the file containing the attendance to presentations sequence as described in (a), and displays the pairs of presentations to be avoided. 0 0 0
A= - 6 is A' Exercise 2: Minimization of scheduling conflicts The transpose of a matrix is formed by interchanging the matrix's rows and columns. Thus the transpose of matrix of 4 2 6 10 8 10 12 4 8 12 The organizers of an in-house Cloud Computing conference for small consulting