Unit 2 Test Flashcards
Scheduling, Bin Packing, and Voting Theory Deifnitions/Concepts
Digraph
Directed graph where each edge is given an orientation (one way travel)
Idle time
Time in the schedule when a processor doesn’t work
Finishing time
How long it takes to complete all the tasks
Critical time
Shortest finishing time, regardless of number of processors
Processors
“Workers” (humans or machines)
Optimal schedule
Minimizes finishing time of tasks
Priority
How important each task is
Priority list
Order we’d like to perform the tasks in, if possible
Number of priority lists if n tasks?
n!
Critical path
Longest path in the digraph
List processing algorithm
Critical time is greater than or equal to the length of the critical path. At any given time, assign the lowest # processor to the first task on the priority list that is ready at the time and hasn’t yet been assigned. If no such task is ready, let the remaining processors remain idle until a task is finished, then check again
Decreasing time algorithm (making a priority list)
Create the priority list by listing the tasks in order from longest completion time to shortest completion time
Critical path algorithm (making a priority list)
Find the critical path (use lowest number if a tie), add first task in path to priority list, remove that task from the digraph, and repeat, finding the new critical path with the revised digraph
Backflow algorithm (2nd version of critical path algorithm)
Introduce an “end” vertex and assign it a time of 0 in brackets, then draw an arrow from each “sink” vertex (not a prereq for any tasks) to the new end vertex. Work backwards from the end vertex to all the previous vertices, redefining each task’s time as the time it takes to reach the end vertex (use the largest time if multiple). Use the decreasing time algorithm to make a priority list using these new task times.
Bin
Can be shifts, items, etc of size N that will contain a list of objects of size a, b, c, where each item is no bigger than N
Capacity
The maximum size of bins, which the list a,b,c cannot be larger than and will be made to fit into
First fit algorithm
Put the object into the first bin that has enough room for it, and open a new bin if none have enough room
Next fit algorithm
Work with one bin at a time, never returning to a previous bin. Put the object into the current bin if there is room, and if not, close the current bin and open a new one, never returning to the closed one
Worst fit algorithm
Put the next object into the bin that has the most room available
First fit deceasing algorithm
First order the objects in order of decreasing size, then use first fit algorithm on this list
Next fit decreasing algorithm
First order the objects in order of decreasing size, then use the next fit algorithm on this list
Worst fit decreasing algorithm
First order the objects in order of decreasing size, then use the worst fit algorithm on this list
Lower bound of bin packing
Worst-case scenario, number of tasks
Upper bound of bin packing
Best-case scenario. Sum of task times divided by length of shifts/bin capacity (round up to whole number)
First fit advantage
Don’t need the full list in advance (efficient)
First fit disadvantage
Can be up to 70% off (ineffective)