An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus.

Slides:



Advertisements
Similar presentations
A Constraint Logic Programming Solution to the Teacher Relocation Problem Nagehan Ilhan Assoc.Prof.Dr Zeki Bayram Eastern Mediterranean University Famagusta.
Advertisements

Architecture-dependent optimizations Functional units, delay slots and dependency analysis.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
Searching Algorithms Finding what you are looking for.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
CS420 lecture one Problems, algorithms, decidability, tractability.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
02/01/11CMPUT 671 Lecture 11 CMPUT 671 Hard Problems Winter 2002 Joseph Culberson Home Page.
This time: Outline Game playing The minimax algorithm
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
. Hidden Markov Model Lecture #6 Background Readings: Chapters 3.1, 3.2 in the text book, Biological Sequence Analysis, Durbin et al., 2001.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Dealing with NP-Complete Problems
CSE 830: Design and Theory of Algorithms
Program Design and Development
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
Blind Search-Part 2 Ref: Chapter 2. Search Trees The search for a solution can be described by a tree - each node represents one state. The path from.
Branch and Bound Algorithm for Solving Integer Linear Programming
Chapter 5 Outline Formal definition of CSP CSP Examples
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
1 Algorithms and Analysis CS 2308 Foundations of CS II.
The Complexity of Algorithms and the Lower Bounds of Problems
Solution methods for Discrete Optimization Problems.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Backtracking.
CSC 2300 Data Structures & Algorithms February 6, 2007 Chapter 4. Trees.
Describing algorithms in pseudo code To describe algorithms we need a language which is: – less formal than programming languages (implementation details.
Fundamentals of Python: From First Programs Through Data Structures
February 17, 2015Applied Discrete Mathematics Week 3: Algorithms 1 Double Summations Table 2 in 4 th Edition: Section th Edition: Section th.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Fundamentals of Python: First Programs
Lecture 2 We have given O(n 3 ), O(n 2 ), O(nlogn) algorithms for the max sub-range problem. This time, a linear time algorithm! The idea is as follows:
Discrete Mathematics Algorithms. Introduction  An algorithm is a finite set of instructions with the following characteristics:  Precision: steps are.
1 R. Johnsonbaugh, Discrete Mathematics Chapter 4 Algorithms.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Templatized Tree.
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Analysis of Algorithms
Chapter 3 Sec 3.3 With Question/Answer Animations 1.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
1 Trees A tree is a data structure used to represent different kinds of data and help solve a number of algorithmic problems Game trees (i.e., chess ),
September 29, Algorithms and Data Structures Lecture V Simonas Šaltenis Aalborg University
1 Analysis of Algorithms CS 105 Introduction to Data Structures and Algorithms.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
1Computer Sciences Department. Book: Introduction to Algorithms, by: Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Electronic:
CSC 211 Data Structures Lecture 13
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
Sports Scheduling Written by Kelly Easton, George Nemhauser, Michael Trick Presented by Matthew Lai.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
1 JOB SEQUENCING WITH DEADLINES The problem is stated as below. There are n jobs to be processed on a machine. Each job i has a deadline d i ≥ 0 and profit.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Data Structure and Algorithms
Adversarial Search 2 (Game Playing)
Sorting & Searching Geletaw S (MSC, MCITP). Objectives At the end of this session the students should be able to: – Design and implement the following.
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Ch03-Algorithms 1. Algorithms What is an algorithm? An algorithm is a finite set of precise instructions for performing a computation or for solving a.
Data Structures and Algorithms
COMP 103 Tree Traversals Lindsay Groves 2016-T2 Lecture 22
Heuristics Definition – a heuristic is an inexact algorithm that is based on intuitive and plausible arguments which are “likely” to lead to reasonable.
Searching CLRS, Sections 9.1 – 9.3.
Assoc. Prof. Dr. Zeki Bayram
An Investigation of the Course-Section Assignment Problem
Revision of C++.
Presentation transcript:

An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus

Problem Specification Student registration period Students should be registered to courses with the minimal number of conflicts For a specific student, courses to be taken are known. Meeting times of course-sections also known. Need to decide on which sections to register with the minimum number of clashes

Problem Specification Student/advisor preferences also play a role Course-section assignment problem: given the courses the student should take, generate schedules for the student, in increasing order of the number of conflicts each schedule contains, up to a specified maximum Student and his advisor can then choose one they prefer (semi-automated)

Computational Complexity Scheduling problems which are decision problems, of a similar nature, are NP- complete Our problem is a function problem, rather than a decision problem – enumeration, given as input courses, and section information about courses Conjecture: Related decision problem “Is it possible to schedule n courses with at most k conflicts” is NP-complete.

Proposed Algorithm – high level i = 0 Repeat Generate all schedules with exactly i conflicts i  i + 1 Until the desired number of schedules have been generated

Algorithm Issues Finding schedules at a given level done through backtracking search Search space pruned if the total number of conflicts already exceed the currently allowed level Implemented as a Javascript program and runs in the Web browser’s JavaScript engine

Web application – data entry page

Web application – Results page

Formal Problem Specification Definition 1. A meeting-time is a day-period pair, such as, meaning the third period (i.e. 10:30) on Monday. Definition 2. The function rep(D,P) is defined as (val(D) ∗ 8)+P, where is a meeting-time, val(Monday) = 0, val(Tuesday) = 1, val(Wednesday) =2, val(Thursday) = 3 and val(Friday) = 4. rep(D, P) is a unique integer representation of a meeting-time.

Formal Problem Specification Definition 3. A course-section assignment is a function that maps a course to one of its sections. Definition 4. The function meetingTimes(C,S) returns the set of meeting times (represented as integers) of section S of course C. In other words, x ∈ meetingT imes(C, S) iff is a meeting-time of section S of course C and x = rep(D, P).

Formal Problem Specification Definition 5. The function nconf(assign) takes a course-section assignment as an argument and returns the number of conflicts it contains. Specifically, let be a list of courses and assign be a course-section assignment. nconf(assign) is defined as | meetingT imes(assign(C 1 )) |+... +|meetingTimes(assign(C n )) | − |meetingT imes(assign(C 1 )) ∪... ∪ meetingTimes(assign(C n ))|

Formal Problem Specification Definition 6. Given a list of courses, the course-section assignment problem (CSAP) is to generate a sequence of course-section assignments in such a way that every assignment appears exactly once in the sequence, and if ass i comes before ass j in the sequence, then nconf(ass i ) ≤ nconf(ass j ).

Algorithm in Pseudo-Code

Input to the Algorithm C, the maximum number of conflicts that can be tolerated. List of courses course 1, course 2,..., course L for which we need to find schedules with at most C conflicts. K, the number of sections per course. The function meetingTimes(i, j) that gives the bitmap for course i, section j. maxSolutions, the maximum number of solutions that should be generated

Output of the Algorithm All combinations of course sections such that the number of conflicts does not exceed C and solutions are generated in increasing order of the number of conflicts they contain, up to a maximum of max solutions solutions

Algorithm (part 1) declare current as an array[0..L] of bitmaps declare nc as an array[0..L] of integer declare next as an array[1..L +1] of integer declare result as an array[1..L] of integer ns ← 0 // number of solutions generated so far for c ← 0 to C i ← 1 // the next course to process next[1] ← 1 // section 1 of course 1 to be processed first current[0] ← ( ) // bitmap of forty zeroes nc[0] ← 0 // initial node contains no conflicts

Algorithm (part 2) loop if ns > max solutions then exit program end if if i = 0 then exit loop end if if next[i]> K then i ← i − 1 continue loop end if if i = L + 1 then if c = nc[i − 1] then print the result array ns ← ns + 1 end if i ← i −1 // backtrack continue loop end if

Algorithm (part 3) newConflicts ← countOnes(meetingTimes(i, next[ i ])  current[i − 1]) if (newConflicts + nc[i − 1]) ≤ c then nc[i] ← nc[i − 1] + newConflicts current[i] ← current[ i − 1 ]  meetingTimes(i, next[ i ]) result[ i ] ← next[ i ] next[ i ] ← next[ i ] + 1 next[ i +1 ] ← 1 i ← i + 1 continue loop end if next[ i ] ← next[ i ] + 1 end loop end for

Implicit Tree traversed by the algorithm Level Level 1 (A, section 1) Level 2 (B, section 1) Level 2 (B, section 2) Level 2 (B, section 3) Level 1 (A, section 2) Level 2 (B, section 1) Level 2 (B, section 2) Level 2 (B, section 3) Level 1 (A, section 3) Level 2 (B, section 1) Level 2 (B, section 2) Level 2 (B, section 3)

Algorithm Complexity – Worst Case Number of nodes visited by the algorithm an accurate measure of its time complexity In the implicit tree traversed by the algorithm:  Level of the root = 0  Level of the leaf nodes = N  Branching factor (number of sections of a course) = K  Number of nodes in the tree =

Algorithm Complexity – Worst case C = Maximum number of conflicts that are tolerated Algorithm makes C+1 passes over the implicit tree Number of nodes visited in tree tree by the algorithm =

Algorithm Complexity – Average Case Notation: b ) = probability that a node at level b with exactly Y conflicts is visited c’ = Maximum number of conflicts we can tolerate in a specific iteration of the algorithm Given c’, the expected number of nodes visited by the algorithm if we can tolerate c’ or less number of conflicts =

Algorithm Complexity – Average case C = Maximum number of conflcits we can tolerate in the solution Average case comlexity for the whole algorithm =

Computing i ) Base cases 0 ) = 1 1 ) = 1 = 0 for j > 0 = 0 for j > 0

Computing i ) Base cases (cont) R = Number of hours a course is taught in a week 2 ) =

Computing i ) Recursive case Let mean that k new conflicts are introduced when going from a node at level i-1 to a node at level i. Let mean the probability of introducing k new conflicts when going from a node at level i-1 to a node at level i, if there are already e conflicts at the node at level i-1.

Computing i ) Recursive case For i>2, we have where

Explanation R is the number of hours per week each course is taught. At level i-1, we have alrady allocated sections to i-1 courses. Since they have e conflicts, (i-1)R-e slots (out of 40) are already taken.To go to the next level node, k slots of the new course must coincide with already taken slots at level i-1, and R-k slots must coincide with the free slots at level i-1.

Explanation is just all possible ways of choosing R slots from 40 slots.

Conclusion We defined formally the course-section assignment problem We proposed an algorithm for it We investigated the time-complexity of the algorithm using a probabilistic approach We showed a Web application that implements the algorithm

Future Work Investigating the applicability of the proposed algorithm to similar scheduling problems Adapting the probabilistic approach for computing the the average-case complexity of the algorithm to other scheduling algorithms

References form.asp form.asp