Title: Task Scheduling Problem Description
1Task SchedulingProblem Description
- Given
- Finite set S a1, , an of unit-time tasks
- Deadlines d1, , dn(1 di n)
- Non-negative penalties w1, , wn
- wi incurred if task ai is late
- No penalty for tasks that are early (not late).
- Find a schedule (ordering of elements of S) that
minimizes total penalty.
2Task Scheduling Algorithm and Example
- A ?
- n 0
- sort S into non-increasing order by penalty wi
- for each x in S (taken in non-increasing order)
-
- if Nt(A U x) t for all 1tn1
-
- A A U x
- n n1
-
-
- return A
3Approximation Algorithm for TSP
- Triangle inequality c(u,w) c(u,v) c(v,w)
- A simple 2-approximation algorithm assuming
triangle inequality is satisfied - Select a vertex r as root
- Compute an MST T for G from root r
- Visit the vertices of T in preorder
- Visit r
- Running time O(V2)
4Combinatorial Structures - Graphs
Adjacency Matrix
List of Edges 1,2, 1,3, 1,6, 2,3,
2,4, 2,6, 2,7, 3,4, 3,5, 3,6, 3,7,
4,7, 5,6, 5,7, 6,7
5Combinatorial Structures Incidence Matrix of
Graph
List of Edges 1,2, 1,3, 1,6, 2,3,
2,4, 2,6, 2,7, 3,4, 3,5, 3,6, 3,7,
4,7, 5,6, 5,7, 6,7
6Combinatorial Structures Projective Plane of
Order 2
Incidence Matrix
List of Lines 1,2,4,2,3,5,3,4,6,4,5,7,5
,6,1,6,7,2,7,1,3
7(7,4,3) Hamming Code Generator Matrix
List of Codewords
8Lexicographic Order Subsets of 1, , n
- Algorithm to find rank of subset T
- FindRank(n, T)
-
- rank 0
- for (i 1 i lt n i)
- if i is in T
- rank rank 2(n-i)
- return rank
9Lexicographic Order Subsets of 1, , n
- Algorithm to find subset that has rank r
- Unrank(int n, int r)
-
- T
- for (i n i gt 1 i--)
-
- if ((r 2) 1)
- T T U i
- r r/2 // integer division!
-
- return T