Question
Problem 6. [Bonus 10 Points] Scheduling with constraints: We have 3 time slots and 6 classes A, B, C, D, E, F . The following
Problem 6. [Bonus 10 Points] Scheduling with constraints: We have 3 time slots and 6 classes A, B, C, D, E, F . The following class pairs cannot be scheduled together (A, B), (A, C), (A, E), (B, D), (C,E),(C,D),(D,F),(E,F). For each class, there are three variables. For example, for class A, there are a1,a2 and a3. If a1=True this means that class A is scheduled in period 1. Write all your functions in the following parts in python. In each part, make sure that the names of your functions match the names of the functions that we are asking you to write. Note that for each part you can call functions from previous parts. There are two sets of test cases. The autograder on Gradescope will only reveal the results of one set of cases. You will not know the results of the other set of test cases. This is done to encourage you to test your own code.
e) Define a function isValid(a1, a2, a3, b1, b2, b3, c1, c2, c3, d1, d2, d3, e1, e2, e3, f1, f2, f3) that outputs True if the schedule is valid for classes A,B,C,D,E, and F.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started