Download presentation
Presentation is loading. Please wait.
Published byPhilip Pierce Modified over 8 years ago
1
Class Scheduling Using Constraint Satisfaction Victoria Donelson Garrett Grimsley
2
Informal Definition Find all possible schedules based on degree audit that satisfy given constraints Constraints Day of week Time of day Preferred courses Course counts toward degree completion Prerequisites satisfied Timeslot – No overlapping courses
3
Formal Definition Simplified
4
Formal Definition Simplified Continued
5
Data Representation [[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]]
6
Data Representation Or… {'M': [(datetime.time(13, 30), datetime.time(15, 10))], 'W': [(datetime.time(13, 30), datetime.time(15, 10))]}
7
Exhaustive Search 1. Generate a possible schedule 1. Check schedule for conflicts 2. If no conflicts: 1. Sort schedule 2. If sorted schedule not in valid schedules list: 1. Add sorted schedule to valid schedules list 2. Repeat until search space exhausted
8
Genetic Algorithm 1. Randomly generate starting population of schedules 2. Parent selection possibilities Roulette 3. Recombination possibilities Mutation Crossover 4. Determine fitness of schedule Has a time conflict
9
Backtracking Drastically reduces reduces the number of schedules generated.
10
Algorithmic Complexity Comparison AlgorithmTime Complexity (O) Exhaustive SearchnLnL Backtrackingn! GeneticL2L2 n = Size of course list L = Length of schedule
11
Algorithm Comparison
13
Question 1 Q: Why was the bit string representation worse than a time object data structure?
14
Question 1 Q: Why was the bit string representation worse than a time object data structure? A: The bit strings were much larger than the time object representation. This caused additional cache misses, which lead to increased fetching from memory. Memory access can take over 200 CPU cycles, during which time additional relevant computations cannot be executed.
15
Question 2 Q: At what point does backtracking begin to outperform the brute-force approach?
16
Question 2 Q: At what point does backtracking begin to outperform the brute-force approach? A: Once the search space grows to around 25,000 possible combinations the backtracking algorithm begins to outperform the brute-force algorithm.
17
Question 3 Q: Which algorithm generally performed best for larger search spaces and why?
18
Question 3 Q: Which algorithm generally performed best for larger search spaces and why? A: In a large search space backtracking performed the best because while exhaustive search must exhaustively generate and test all possible solutions the backtracking approach does not have to explore all configuration choices.
19
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.