Question
Implement a program that uses a Constraint Satisfaction Problem (CSP) formulation to find possible degree plans for students in the program. Can only use constraint
Implement a program that uses a Constraint Satisfaction Problem (CSP) formulation to find possible degree plans for students in the program.
Can only use constraint and pandas packages.
Requirements
Use Python 3 with the python-constraint package to determine the number of possible degree plans for a given start and end term under the constraints given below. Also, your code should generate one possible degree plan that satisfies all constraints. The information needed for formulating the CSP is given within the two sheets of the csp_course_rotations.xlsx file. The first sheet (course_rotations) provides a listing of all available courses, their type (foundation, core, elective, or capstone), and the term availability (0 - unavailable, 1 - available) for each of the terms (1: Fall 1, 2: Fall 2, 3: Spring 1, 4: Spring 2, 5: Summer 1, 6: Summer 2). The second sheet (prereqs) specifies which course must be taken before another. Note that a course may have multiple prerequisites.
Your program must output the number of possible degree plans and one possible degree plan for a student that starts in Year 1 Fall 1 and finishes in Year 3 Fall 2. The degree plan must satisfy the following requirements:
- Student will take one and only one course per term.
- Course that has prerequisites must be taken in a term that follows the term in which all prerequisites are done.
- The student does not need to repeat courses.
- Some terms may be skipped as long as the student finishes in Year 3 Fall 2.
- Student needs to take 3 out of the 8 elective courses. It doesnt matter which ones are included in the degree plan. Those courses which are not taken will be labeled as Not Taken (see sample output).
- Student must take all foundation and core courses.
Solution should look like the following:
START TERM = Year 1 Fall 1
Number of Possible Degree Plans is 9488
Sample Degree Plan
Not Taken CPSC-57400
Not Taken CPSC-57200
Not Taken CPSC-57100
Not Taken CPSC-55200
Not Taken CPSC-51700
Year 1 Fall 1 CPSC-50600
Year 1 Fall 2 MATH-51100
Year 1 Spring 1 MATH-51000
Year 1 Spring 2 MATH-51200
Year 1 Summer 1 CPSC-50100
Year 2 Fall 1 CPSC-51100
Year 2 Fall 2 CPSC-53000
Year 2 Spring 1 CPSC-54000
Year 2 Spring 2 CPSC-55500
Year 2 Summer 1 CPSC-51000
Year 2 Summer 2 CPSC-52500
Year 3 Fall 1 CPSC-55000
Year 3 Fall 2 CPSC-59000
spread sheet file
Course | Type | 1 | 2 | 3 | 4 | 5 | 6 |
CPSC-50100 | foundation | 1 | 1 | 1 | 0 | 1 | 0 |
MATH-51000 | foundation | 1 | 0 | 1 | 0 | 1 | 0 |
MATH-51100 | core | 0 | 1 | 0 | 1 | 0 | 0 |
MATH-51200 | core | 0 | 0 | 0 | 1 | 0 | 0 |
CPSC-51000 | core | 1 | 0 | 0 | 0 | 1 | 0 |
CPSC-51100 | core | 1 | 0 | 1 | 0 | 1 | 0 |
CPSC-53000 | core | 0 | 1 | 0 | 0 | 1 | 0 |
CPSC-54000 | core | 0 | 1 | 1 | 0 | 0 | 0 |
CPSC-55000 | core | 1 | 0 | 0 | 0 | 1 | 0 |
CPSC-50600 | elective | 1 | 0 | 1 | 0 | 1 | 0 |
CPSC-51700 | elective | 0 | 1 | 0 | 0 | 0 | 0 |
CPSC-52500 | elective | 0 | 1 | 0 | 1 | 0 | 1 |
CPSC-55200 | elective | 0 | 1 | 0 | 0 | 0 | 0 |
CPSC-55500 | elective | 1 | 0 | 0 | 1 | 0 | 0 |
CPSC-57100 | elective | 0 | 0 | 1 | 0 | 0 | 0 |
CPSC-57200 | elective | 0 | 0 | 0 | 0 | 1 | 0 |
CPSC-57400 | elective | 0 | 0 | 0 | 1 | 0 | 0 |
CPSC-59000 | capstone | 0 | 1 | 0 | 1 | 1 | 0 |
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