0% found this document useful (0 votes)
18 views

Scheduling and Resource Allocation

Uploaded by

Clemen Kok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Scheduling and Resource Allocation

Uploaded by

Clemen Kok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

COMP70068 Scheduling and Resource Allocation

Clemen Kok
December 2024

1 Introduction to Scheduling
What is Scheduling? Job - Unit of work we want to process; Machine - Re-
source that can process jobs. Sequence - When to start, end, and resume. Also
consider parallel workflows, Due dates, Uncertain information.

Applications of Scheduling. Comp Arch, Cloud, Production Scheduling,


Project Planning.

2 Single Machine Scheduling


Gantt Chart. How many schedules can we find to sequentially run n jobs
without idling times on a single machine - n!

Sequencing. Optimising functions f (C1 , ..., Cn ) - regular measures - mono-


tonically non-decreasing with respect to each of the job completion times Cj , j ≤
n.

Examples of regular measures:


1. Cmax = max(C1 , ..., C2 ) - time at which the last operation is completed
(Makespan)
2. ΣCj - Total completion time

3. Σwj Cj - total weighted completion time


4. Σwj (1 − e−rCJ ) - discounted weighted completion time with discount rate
0 ≤ r ≤ 1 (e.g. inflation)

1
Why would you choose to minimise Cmax ? Minimises Makespan, To-
tal time needed to complete all jobs, Ensures set of jobs is completed ASAP,
Ensures system resources are utilised efficiently, maximises throughput, higher
cost efficiency, Minimise idleness.

When to NOT minimise Cmax ? - Cost to idle.

Classifying Scheduling Problems. Use notation a|β|γ with α: machines,


β: job characteristics and γ: optimality criterion.

Assignments:
1. α = 1 Single Machine, P Parallel Machines

2. β: pmtn - preemption (interrupts and suspension for higher priorities), rj :


release times (time when job becomes available for scheduling), dj : due
dates, prec precedences
3. γ: Cmax , ΣCj , Σwj Cj

4. E.g. 1||ΣCj , 1|rj , pmtn|ΣCj , P |prec|Σwj Cj

P ART IT ION . Theoretical problem that illustrates the hardness of schedul-


ing for load balancing with known, deterministic, job processing times. Given a
set of S integers (e.g. job processing times) with repetitions allowed, P ART IT ION
asks to form two subsets with identical sum, or return that they do not exist.
N P -hard. With S = {1, 1, 1, 2, 2, 2, 3} we may choose S1 = {1, 1, 1, 3} and
S2 = {1, 2, 3} or ... or ...

Proof that P ART IT ION is N P Complete. Reduce from Subset Sum


Problem.

3 Release Times
Assumptions
• A set of n jobs is immediately ready to be scheduled.

• Deterministic Processing Times, known in advance.


• No preemption.

2
• Single server machine.
• No explicit setup times.
• No machine idling while jobs are waiting.
– Idle - non pre-emptive - higher priority.

Preemptive vs Non-preemptive Scheduling


• No interrupts can lead to improved C.
• In single machine scheduling, if performance is monotonic with respect to
completion times, there is no advantage in using preemption.

Scheduling on a Single Resource


• Scheduling on a single resource is the simplest scheduling problem.
• More complex real-world situations can often reduce to analyzing single
machine problems when we model the bottleneck machine.
• Non-idling schedules: no gains in regular measures by inserting idle times
within a single machine. Not true in general outside assumptions.
• 1||Cmax is trivial: under non-idling, makespan minimization is optimized
by any random schedule since:
X
Cmax = pj = const
j

where pj is the processing time of job j = 1, . . . , n.


P
Total Completion Time Problem (1|| Cj )
• Shortest Processing Time (SPT) Rule is optimal.
• Let [j] denote the j-th scheduled job, which will have processing time p[j]
and completion time C[j] . Since all jobs are released at time 0, the latter
will be:
C[1] = p[1]
C[2] = p[1] + p[2]
..
.
C = p[1] + p[2] + · · · + p[n]
X [n]
Cj = np[1] + (n − 1)p[2] + · · · + p[n] .

• Shorter jobs are best scheduled earlier.


• Note: job completion time is accumulative.
Q: Computational Complexity of SPT? P |n log n

3
P
1|| wj Cj Problem
• Weighted Shortest Processing Time (WSPT) Rule (Smith’s rule).
• Schedules jobs in non-decreasing pj /wj ratio order.

• Proof follows adjacent pairwise interchange argument:


– Assume that S is optimal, but not a WSPT schedule. Thus, we can
p
find two adjacent jobs i and j in S such that wpii > wjj .

Proof of WSPT Optimality


n
X X
wl Cl = wi (p(B) + pi ) + wj (p(B) + pi + pj ) + wk Ck
l=1 k̸=i,j
n
X X
wl Cl′ = wj (p(B) + pj ) + wi (p(B) + pi + pj ) + wk Ck
l=1 k̸=i,j
X X
wl Cl − wl Cl′ = wj pi − wi pj > 0

Since S − S ′ > 0, S > S ′ .


Key Idea: Swapping two jobs in the sequence affects completion time pro-
portional to weights and processing times.

Job Chains as an Extension of WSPT


• Sequential precedences among jobs.
• Non-interruptible execution.

• Let:
A : 1 → 2 → ··· → k
B : k + 1 → k + 2 → · · · → n.
Which should be processed first?

• A should be scheduled before B if:


Pk Pn
j=1 pj j=k+1 pj
Pk < Pn
j=1 wj j=k+1 wj

• Similar to WSPT (non-decreasing chain ratios).

Interruptible Execution:

• Interleave executions of jobs from different chains.


• Individual jobs are still executed non-preemptively.

4
• WSPT may still be applied to sub-chains.
ρ-factor:
Pl
j=1 pj
ρA = min Pl .
1≤l≤k wj
j=1

• Initial subchains of A of length l: the one with the minimum ratio deter-
mines the ρ factor.

Uncertain Processing Times


• Consider 1||
P P
Cj and 1|| wj Cj with uncertain pi .
• Relaxes assumption A2.
• Assume each processing time pi is sampled from a statistical distribution,
making pi a random variable.
• Model assumption A5 (Machine Breakdowns): A breakdown could unex-
pectedly extend the processing time of the job in service until it resumes
after machine repair.

Key Points:
• Maximum is not tractable in stochastic vs deterministic cases.

• Optimize expected total completion time E[ Cj ].


P

• SPT can be replaced by S-Expected-PT policy, scheduling jobs in order


of mean processing time.
Let pj be independent random variables:
X  
E[ Cj ] = E np[1] + (n − 1)p[2] + · · · + p[n] = nE[p[1] ]+(n−1)E[p[2] ]+· · ·+E[p[n] ].

If pj are exponentially distributed with rates µj = 1/E[pj ] and weights are


cj , the principle is known as the cµ rule.

4 Due Dates
Key Definitions
Each job has a due date dj (delivery time). Due dates are soft and can be
violated. The goal is to minimise deviations. The following metrics are defined:

• Lateness: Lj = Cj − dj
• Tardiness: Tj = max(0, Cj − dj )

5
Minimising Total Lateness (1||ΣLj )
Although the Shortest Processing Time (SPT) rule ignores the due dates dj , it
remains optimal for minimising total lateness.

Σj Lj = Σj (Cj − dj ) = Σj Cj − Σj dj
Since D = Σj dj is given and independent of the schedule, minimising total
lateness is equivalent to minimising total completion time. A similar situation
arises for the weighted analogue 1||Σwj Lj .

Focusing on Lmax
The total lateness ΣLj does not fully capture the significance of due dates.
Hence, the problem 1||ΣLj is seldom studied. Instead, the focus is often on
minimising the maximum lateness Lmax :

Lmax = max Lj
j

Earliest Due Date (EDD) Rule


For jobs with different due dates di ≥ dj , the Earliest Due Date (EDD) rule,
which schedules jobs in non-decreasing dj order, is optimal for 1||Lmax . Ties
are broken at random.
EDD is also optimal for 1||Tmax . The relationship between Tmax and Lmax
is:
• Tmax = 0 when Lmax ≤ 0

• Tmax = Lmax if Lmax > 0

Proof of EDD Optimality


Proof details can be found in the notes.

Stochastic Case
Under uncertainty, lateness and tardiness are harder to handle due to expec-
tations involving maxima of random variables. However, it can still be shown
that EDD remains optimal for 1||Lmax and 1||Tmax .

Minimising Total Tardiness (1||ΣTj )


Minimising ΣTj provides more control over tardiness distribution across jobs.
However:

• The problem is NP-hard.

6
• No optimal rule like EDD or SPT exists.
• EDD is still optimal in restricted cases.

Agreeable Jobs
Jobs are agreeable if, for any two jobs i and j, pi ≥ pj implies di ≥ dj . If
all jobs are agreeable, total tardiness is minimised by EDD sequencing with
ties broken by SPT. This can be proven using adjacent pairwise interchange
analysis.

Minimising Number of Tardy Jobs (Σj Uj )


The number of tardy jobs is defined as:
(
0 if Cj ≤ dj
Uj =
1 otherwise

Moore-Hodgson Algorithm
The problem 1||Σj Uj is solvable exactly in polynomial time using the Moore-
Hodgson Algorithm. However, the weighted case is NP-hard.

1. Jobs j = 1, . . . , n are added one by one, in EDD order, to the on-time


schedule SO .
2. If job j completes after time dj , the job i ∈ SO with the largest pi is
declared late and moved to the late schedule SL in an arbitrary position.
3. Step 2 is repeated until either job j can be added to SO or it is moved to
SL if it has the largest pi .
4. After all jobs are added, the algorithm returns S = {SO , SL }:

• On-time jobs (SO ) are scheduled before late jobs (SL ).


• The order of jobs in SL is arbitrary.

Example:

• Remove J2 , then J1 (by processing time pi ).

• These jobs will be late regardless.

7
5 Enumeration and Local Search
Introduction
Many scheduling problems are NP-Hard and cannot be solved efficiently if the
problem size is large enough. Combinatorial optimization involves minimizing
a cost function g(S) over all feasible schedules S.

In most cases, the cost function is an additive function:


X
g(S) = gj (S),
j

where gj (S) is the cost of scheduling


P job j prescribed by schedule S. - Example:
gj (S) = wj Uj defines
P a 1|| j w j U j problem. - Example: gj (S) = max(0, Cj −
dj ) defines a 1|| j Tj problem.

Local Search
Similar to hill climbing but applied to discrete problems. A neighborhood N (S)
of the current solution S is generated using adjacent pairwise interchange, sub-
ject to constraints. The solution evolves by selecting the next one in N (S). May
get trapped in local optima.

Simulated Annealing (SA)


A random-walk-based search that explores the solution space while being guided
towards the global optimum over time. Escape tendency around local optima is
controlled by a temperature parameter Tk , reduced over time until convergence.

Algorithm:
1. Start with an initial solution x0 .
2. At iteration k + 1, randomly choose a neighbour y ∈ N (xk ).
3. Compute cost change ∆ = g(xk ) − g(y): If ∆ ≥ 0, accept y as xk+1 = y.
If ∆ < 0, accept y with probability e∆/Tk .
4. Update temperature:

Tk+1 = αTk = αk+1 T0 , T0 > 0, 0 < α < 1.

5. Stop when k > K.


Alternative cooling model:
T0
Tk = .
1 + log(1 + k)

8
Tabu Search
A deterministic global optimization method using a memory structure called
the tabu list T . Tracks recently swapped job pairs to avoid cycling back to
previous solutions. Exceptions (aspiration criteria) allow revisiting a solution if
it improves the best overall result.

Algorithm:
1. Swap adjacent jobs i and j in schedule S. Add pair (i, j) to T .
2. Prevent re-swapping (i, j) for L iterations unless aspiration criteria are
met.
3. Stop when no further improvements are possible.

Handling Constraints
Schedules may have equality and inequality constraints:

gbest = min g(S), s.t. fi (S) = 0, hk (S) ≤ 0.


S

Rejection Method
Skip candidate solutions violating constraints. Valid initial schedules required.

Penalty Function Method


Modify the cost function:
I
X K
X
g ′ (S) = g(S) + λi fi (S) + γk max(0, hk (S)).
i=1 k=1

Dynamic Programming (DP)


Define J as a set of jobs. Let G(J) be the minimum cost of scheduling the jobs
in J, where G(J) is obtained recursively:

G(J) = min {G(J − {j}) + gj (J)}, G(0) = 0.


j∈J

Complexity: O(n2n ).

Branch and Bound


Combines branching (partitioning solutions) and bounding (eliminating subop-
timal solutions). Nodes in a search tree represent subproblems with specific jobs
fixed in the schedule. Subproblems are pruned using bounds to save computa-
tion.

9
6 Parallel Machine Scheduling
Introduction
1. Jobs are mapped to m identical parallel machines. 2. A job cannot run on
two machines at the same time. 3. The makespan problem, denoted P ||Cmax ,
is no longer trivial and equates to balancing job loads across machines. 4. For
m = 2, the problem is denoted P2 (parallel scheduling on two machines).

Total Completion Time Problems


P
1. The Shortest PProcessing Time (SPT) optimality for 1|| Cj can be gen-
eralized to P || Cj . 2. Adding indices to represent completion times and
processing on m machines, the goal is to minimize:

n1
X
C1,j = n1 p1,[1] + (n1 − 1)p1,[2] + · · · + p1,[n1 ] ,
j=1
.. ..
. .
nm
X
Cm,j = nm pm,[1] + (nm − 1)pm,[2] + · · · + pm,[nm ] .
j=1

3. SPT optimizes the system by sorting jobs in ascending size and then
applying round-robin across machines. 4. Weighted Shortest Processing Time
(WSPT) assigns jobsPto the first idle machine in increasing pi /wi ratios. While
not optimal for P || wj Cj , which is NP-hard, it serves as an approximation
with a worst-case ratio: √
1+ 2
R= ≈ 1.21.
2
5. Round-robin schedules jobs cyclically through m1 , m2 , . . . , mn .

Makespan Problems
1. With m machines, the makespan admits the lower bound:
P
pj
M ⋆ = max(pmax , ),
m
P
where pmax = max pj . 2. The term pj /m represents the optimal case where
all machines finish jobs simultaneously. 3. The pmax term arises because no job
can run on multiple machines simultaneously, so the longest job determines a
minimum makespan.

10
McNaughton’s Wrap Around Rule
1. Schedule an arbitrary job on machine m1 at time 0. 2. Start any unscheduled
job as soon as possible on the same machine. 3. Repeat the process until the
makespan on a machine exceeds M ⋆ or all jobs are scheduled. 4. Reassign
processing beyond M ⋆ to the next machine, starting at time 0. Repeat the
process.

Non-Preemptive Case
1. The non-preemptive makespan problem P is NP-hard, even with m = 2 ma-
chines. 2. Assuming integer pj and pj divisible by 2, P2 ||Cmax asks to
partition integers into two subsets summing to M ⋆ , equivalent to the partition
problem.

List Scheduling (LS)


1. List scheduling is a popular approximation. Given a priority list of jobs, LS
assigns the first available job to the first available machine. 2. The worst-case
ratio for P ||Cmax is:
1
R=2− .
m

Proof of the Worst-Case Ratio


LS
1. Let tk = Cmax − pk be the time when job k starts. Since machines are always
busy before tk :
n
X
m · tk ≤ pj − pk .
j=1

LS
2. Substituting tk = Cmax− pk and rearranging:
Pn
LS j=1 pj (m − 1)pk
Cmax ≤ + .
m m
OP T
3. The optimal makespan satisfies Cmax ≤ M ⋆ , where:
Pn
j=1 pj OP T OP T
≤ Cmax , pk ≤ pmax < Cmax .
m
4. Therefore:
LS
Cmax 1
OP T
=2− .
Cmax m

11
Longest Processing Time (LPT)
1
1. List scheduling achieves a (2 − m ) approximation if no specific job priority
order is specified. 2. LPT assigns jobs in non-increasing order of size. LS with
LPT achieves a smaller worst-case ratio:
4 1
R= − .
3 3m

7 Workflow Scheduling
Directed Acyclic Graphs (DAGs)
1. Job precedences are represented as a Directed Acyclic Graph (DAG) G =
(V, E):
• Vertices V are jobs.
• An edge (i, j) ∈ E indicates that job i must complete before job j
can start.
2. Precedence constraints frequently require forced idleness.
3. Scheduling theory under precedence constraints is challenging:

• Most problems with precedences are NP-hard.


• Complexity remains an open question in some cases.
4. Optimal methods exist only under restrictive assumptions:

• Unit processing times (pj = 1, ∀j).


• Fixed number of processors (e.g., two).
• Restricted topologies (chains, in-trees, out-trees):
– In-tree: Every node has at most one child.
– Out-tree: Every node has at most one parent.
– Chain: Every node has at most one parent and one child.

Hu’s Algorithm
1. Hu’s algorithm solves P |i.t., pj = 1|Cmax (parallel scheduling with in-tree
precedence constraints).
2. Assign a level αj to each job j as follows:
• The exit node is labeled with αj = 1.
• For all other nodes:
αj = 1 + max αi .
i:(j,i)∈E

12
3. The maximum level is L = maxi αi , and αj − 1 is the path length from j
to the exit node. The longest path is called the critical path.
4. Hu’s algorithm schedules ready jobs in non-decreasing αj order, with com-
plexity O(n).

5. The algorithm achieves optimal schedules for P |i.t., pj = 1|Cmax .

Optimality of Hu’s Algorithm


1. Reduction to in-tree cases ensures optimality:

• Reverse the arc orientations in out-tree problems to create an equiv-


alent in-tree problem.
• For disjoint in-trees, add a dummy task as the successor of all exit
nodes.
2. The algorithm approximates P |prec, pj = 1|Cmax :

• Worst-case ratio:
(
4
R= 3, if m = 2,
1
2− m−1 , if m ≥ 3.

Muntz-Coffman Algorithm
1. The Muntz-Coffman algorithm extends Hu’s algorithm to the preemptive
case.
2. A subset sequence S1 , S2 , . . . , Sk is defined as follows:
• Each job a ∈ G belongs to some Si .
• If a ∈ Sj is a successor of b ∈ Si , then j > i.

3. Given a subset sequence, schedule subsets in increasing i:


• If |Sj | > m, use McNaughton’s wrap-around rule, assigning |Sj |/m
time on m processors.
• If |Sj | ≤ m, assign one unit of time on |Sj | processors.

4. The method is optimal for general DAGs, subject to m = 2 and pj = 1.

Optimality of Muntz-Coffman Algorithm


1. The algorithm is optimal for:

• P2 |pmtn, prec, pj = 1|Cmax .


• P |pmtn, i.t., pj = 1|Cmax .

13
• P |pmtn, o.t., pj = 1|Cmax .
2. Under preemptive scheduling, pj > 1 can be divided into jobs with pj = 1.
3. The worst-case ratio for general preemptive scheduling P |pmtn, prec|Cmax
is:
2
R = 2 − , m ≥ 2.
m
4. The algorithm is optimal for m = 2 and near-optimal for small m > 2.

8 Bottleneck Analysis
System Overview
1. Jobs arrive at the system, are processed by machines, and then completed.
2. Assumptions:
• A1: The system has M machines with arbitrary speeds.
• A2: Jobs arrive at arbitrary times, not known in advance.
• A3: Jobs may visit more than one machine and do not incur com-
munication overheads.
• A4: Job processing times are arbitrary and machine-dependent.
• A5: Job sequencing at machines is arbitrary.
• A6: Inside the system, there is no job creation, destruction, or par-
allel execution of a single job.
3. Key questions:
• Bottleneck Analysis: Which machines limit the peak completion
rate?
• What-if Analysis: How will changes in job arrival rates or machine
speeds impact the system?
4. Performance factors:
• Arrival rate of jobs.
• Processing time of jobs at the machine.
• Utilization (fraction of time the machine is busy).
• Contention.

14
Job Classes
1. The open system:
• Processes jobs using M machines.
• Offers C types of services (job classes).
• Receives class-c jobs at rate λc .
2. For a class-c job:
• Visits machine i, on average, vic times.
• Requires a mean processing time pic for each visit.
• Demand:
Dic = vic pic ,
the total processing time accumulated on average during visits to
machine i.

Operational Analysis
1. Monitor a machine for an observation period T seconds and collect:
• Ac : Total number of arrived jobs of class c.
• Bic : Total time machine i is busy processing class-c jobs.
• Fc : Total number of finished jobs of class c.

2. Compute:
• λc = Ac /T : Average arrival rate of jobs of class c.
• Xc = Fc /T : Average system throughput of jobs of class c.
• Uic = Bic /T : Utilization of machine i for class-c jobs.

3. Stability:
• If the number of pending jobs remains finite, the system is stable.
• In a stable system:
Fc
λc = Xc = lim .
T →∞ T
• Unstable systems cannot cope with arrival rates, causing the backlog
of pending jobs to grow unbounded.

15
Utilization Law
1. Demand:
Bic
Dic = .
Ac
2. Utilization:
Bic Ac Bic
Uic = = · = λc Dic .
T T Ac
3. For C job classes, the total utilization of machine i is:
C
X C
X C
X
Ui = Uic = λc Dic = Xc Dic .
c=1 c=1 c=1

4. Estimating demand:
• Use multivariate linear regression to fit hyperplanes to samples of Ui
and λc .
• Estimated demands Dic are hardware-dependent and change after
machine upgrades.

Bottleneck Analysis
1. Bottlenecks:
• Machines that limit performance by struggling to handle arrival rates.
• Tend to operate near 100
2. Single class (C = 1):
• For every machine i:
Ui = λDi .
• Maximum arrival rate:
1
λ≤ ,
Dmax
where Dmax = max(D1 , . . . , DM ).
• Bottlenecks correspond to machines with Dmax .
3. Multi-class (C > 1):
• Machine usage is described by:
C
X
Ui = λc Dic .
c=1

• A machine j can saturate if there exists a mix of arrival rates λ1 , . . . , λC


such that Uj = 1.

16
• Verify saturation using linear programming (LP):
C
X
Ujmax = max λc Djc ,
c=1

subject to:
C
X
λc Dic ≤ 1, λc ≥ 0.
c=1

• If Ujmax = 1, the machine can saturate.

9 Competitive Decision Making


Introduction
1. Multi-agent settings lack a clear notion of what is optimal.
• Focus is on equilibria rather than global optimizers.
• An equilibrium is ”good” if it overlaps with system optima.
2. Game setup:

• Players: i = 1, . . . , N .
• Each player has a set of actions xi ∈ Xi .
• Each player incurs a cost Ji (x1 , . . . , xN ), which depends on everyone’s
choices.

3. Example: The 2/3 game.

2 1 X
Ji (x1 , . . . , xN ) = · xj − xi .
3 N j

4. Bimatrix representation example:

R S
R (30, 0) (30, 10)
S (100, 100) (0, 10)

Nash Equilibria
1. A Nash equilibrium (N.E.) models emergent behavior.
• A pure N.E. is a feasible allocation such that no player can decrease
their cost by unilateral deviation.

17
2. Definition:

(x⋆1 , . . . , x⋆N ) ∈ X1 ×· · ·×XN is a N.E. if Ji (x⋆i , x⋆−i ) ≤ Ji (xi , x⋆−i ) ∀xi ∈ Xi , ∀i.

Here:
• x−i represents the strategies of all players except i.
• xi is the strategy of player i.
3. Example:
A B
A (30, 0) (30, 10)
B (11, 11) (0, 10)
The N.E. is (10, 10), as neither player has an incentive to deviate.

Best Response Algorithm


1. Given other players’ strategies x−i , the best response is:

BR(x−i ) = arg min Ji (xi , x−i ).


xi ∈Xi

2. Steps:
(a) Initialize strategies x and set i = 1.
(b) Check if x is an equilibrium; if so, stop.
(c) Update xi ← BR(x−i ).
(d) Set i ← (i mod N ) + 1.
(e) Repeat.
3. Convergence:
• If the current allocation minimizes the cost, no one will change their
strategy.
• The algorithm converges to a Nash equilibrium.

Mixed Nash Equilibria


1. Players may randomize their actions, minimizing expected cost.
2. For finite actions, let σi ∈ ∆i represent the probabilities of player i’s
actions. The expected cost is:
X
Ci (σ1 , . . . , σN ) = Ex∼σ [Ji (x)] = p(x)Ji (x).
x∈X

3. Definition:

(σ1⋆ , . . . , σN

) ∈ ∆1 ×· · ·×∆N is a mixed N.E. if Ci (σi⋆ , σ−i

) ≤ Ci (x′i , σ−i

) ∀x′i ∈ Xi , ∀i.

18
Matching Pennies Example
1. Game:
H T
H (1, −1) (−1, 1)
T (−1, 1) (1, −1)

2. No pure Nash equilibria exist.


3. Mixed Nash equilibria:
• Let p be the probability the row player chooses H.
• Let q be the probability the column player chooses H.

4. Expected payoffs:
(
H : 1 · q + (−1) · (1 − q) = 2q − 1,
Row Player (P1):
T : (−1) · q + 1 · (1 − q) = −2q + 1.
(
H : −1 · p + 1 · (1 − p) = −2p + 1,
Column Player (P2):
T : 1 · p + (−1) · (1 − p) = 2p − 1.

5. Solve for indifference:


1
2q − 1 = −2q + 1 =⇒ q = ,
2
1
−2p + 1 = 2p − 1 =⇒ p = .
2
1 1

6. The mixed Nash equilibrium is (p, q) = 2, 2 .
7. Expected cost:
1 1 1 1 1 1 1 1
E[C1 ] = · − · − · + · = 0.
2 2 2 2 2 2 2 2
Similarly, E[C2 ] = 0.
8. Deviation:
• If one player deviates, the expected cost remains 0.

10 Potential and Congestion Games


Potential Games
1. A potential game is a ”nice” game where the cost functions of all players
can be described by a single potential function.

19
2. Formal definition:
• A strategic game is a potential game if there exists a function Φ :
X → R such that:

Ji (xi , x−i ) − Ji (yi , x−i ) = Φ(xi , x−i ) − Φ(yi , x−i ),

for all xi , yi , x−i , and for all players i.


3. The differences in the potential function, rather than its absolute values,
determine the dynamics.
4. A potential game guarantees:

• Existence of at least one Nash Equilibrium (NE).


• Convergence of the Best Response (BR) algorithm in a finite number
of steps for games with finite actions.
5. Intuition:

• Each time a player improves their utility, the potential changes ac-
cordingly.
• Cyclic behavior is impossible as it would imply Φ(x1 ) > Φ(x2 ) >
· · · > Φ(x1 ), which is contradictory.

Congestion Games
1. Congestion games model scenarios where players share resources, and the
cost depends on resource usage.
2. Components:

• Set of resources R.
• Resource cost functions ↕r (·): latency functions specific to each re-
source.
• Set of players {1, . . . , N }.
• Feasible set Xi ⊆ 2R for each player i, representing the resources
they can choose.
• Player cost: X
Ji (x) = ↕r (|x|r ),
r∈xi

where |x|r is the number of players using resource r.


3. Example: Load balancing.
• Resources are machines.
• Players are tasks managed by players.

20
• Each player’s cost equals the runtime of their chosen machine.
4. Best Response (BR) convergence:
• Congestion games are potential games, with potential function:
|x|r
XX
Φ(x) = ↕r (j).
r∈R j=1

• The BR algorithm converges because the potential decreases with


each step.

Convergence in Singleton Congestion Games


1. Definition:
• A singleton congestion game is a congestion game where each player
chooses a single resource (|xi | = 1 for all xi ∈ Xi ).
2. Example:
• Load balancing games are singleton congestion games because each
task can choose only one machine.
3. Convergence:
• In singleton congestion games with n players and m resources, BR
converges in O(n2 m).
4. Proof intuition:
• Replace original latencies with bounded integer values while preserv-
ing player preferences.
• The potential Φ(x) measures total latency across all resources:
|x|r
m X
¯↕r (j),
X
Φ(x) =
r=1 j=1

where ¯↕r (j) are the sorted integer latencies for resource r.
• The potential is bounded by n2 m, as the maximum decrease in po-
tential per BR step is at least 1.
5. Example calculation:
• Suppose R1 and R2 are resources with latencies:
↕R1 (1) = 1, ↕R1 (2) = 3, ↕R1 (3) = 5,
↕R2 (1) = 2, ↕R2 (2) = 4, ↕R2 (3) = 6.
After sorting latencies, assign new integer values:
¯
↕R1 (1) = 1, ¯↕R (1) = 2, ¯↕R (2) = 3.
2 1

21
• Compute potential:
– R1 has 2 players. Sum latencies:
¯↕R (1) + ¯↕R (2) = 1 + 3 = 4.
1 1

– R2 has 1 player. Sum latency:


¯↕R (1) = 2.
2

– Total potential:
Φ(x) = 4 + 2 = 6.
• The potential decreases with each BR step and is bounded by n2 m.

11 Efficiency of Equilibria
Braess Paradox
1. Consider two routes from A to B:
• North: road and ferry.
• South: ferry and road.
2. Initially, 200 players split equally between the two routes (100, 100).

3. Introducing a new bridge changes the equilibrium:


• Everyone avoids the ferry, resulting in:

Ji (x) = 2(15 + 0.1 · 200) = 70, ∀i.

• Using the road and ferry leads to a higher cost:

15 + 0.1 · 200 + 400 = 75.

4. The new equilibrium increases overall travel cost, illustrating Braess Para-
dox.

Price of Anarchy (PoA)


1. Definition:

• In a strategic game, a social cost function SC : X → R measures the


quality of each allocation for the whole population.
• The price of anarchy is defined as:

maxx∈P N E SC(x)
P oA = .
minx∈X SC(x)

22
2. Interpretation:
• Measures the performance degradation from selfish decision-making.
• SC(x) is typically the sum of players’ costs.
3. Example:
• Worst Nash equilibrium (no ferry): SC = 14000.
• Optimal allocation: SC = 12875.
• Price of anarchy:
14000
P oA = ≈ 1.087.
12875
4. Implication:
• PoA quantifies the inefficiency caused by selfish behavior.
• Use incentives to reduce P oA.

Bounding the Price of Anarchy


1. Definition of a smooth game:
• A strategic game is (λ, µ)-smooth if there exist constants λ > 0 and
µ < 1 such that:
X
Ji (x′i , x−i ) ≤ λSC(x′ ) + µSC(x), ∀x′ , x ∈ X .
i

2. PoA bound:
• In a (λ, µ)-smooth game:
λ
P oA ≤ .
1−µ
3. Proof:
• Let x be a Nash equilibrium and x′ an optimal allocation.
• From the definition of Nash equilibrium:
X X
SC(x) = Ji (x) ≤ Ji (x′i , x−i ).
i i

• Using the smoothness property:


X
Ji (x′i , x−i ) ≤ λSC(x′ ) + µSC(x).
i

• Combining:
SC(x) ≤ λSC(x′ ) + µSC(x).
• Rearranging:
SC(x)(1 − µ) ≤ λSC(x′ ),
SC(x) λ
≤ .
SC(x′ ) 1−µ

23
Affine Congestion Games and Exact PoA
1. For congestion games with affine latencies:
ℓr (|x|r ) = αr |x|r + βr .

2. Every such game is 35 , 13 -smooth, giving:




5
P oA ≤ = 2.5.
2
3. Proof (outline):
• Social cost:
X X
SC(x) = Ji (x) = |x|r ℓr (|x|r ).
i r

• Smoothness condition:
X 5 1
Ji (x′i , x−i ) ≤ SC(x′ ) + SC(x).
i
3 3

• Goal:
5 ′ 1
|x′r |ℓr (|x|r + 1) ≤ |x |ℓr (|x′r |) + |xr |ℓr (|x|r ), ∀x, x′ , r.
3 r 3

Congestion Pricing
• Design tolls τr (|x|r ) for each resource to incentivize optimal behavior:
ℓr (|x|r ) + τr (|x|r ).

12 Auctions
Utility of a Bidder
(
0, if loses auction,
Utility Bidder i =
vi − p, if wins auction,
where vi is the bidder’s valuation and p is the price paid.

Sealed-Bid Auction
• Each bidder privately submits a bid to the auctioneer.
• The auctioneer:
1. Decides who gets the good (e.g., highest bid wins).
2. Sets the selling price (affects bidder behavior).
• Bidders underbid because bidding true valuation yields zero utility. The
degree of underbidding depends on unseen competitor bids.

24
Second-Price Auction (Vickrey)
• In a second-price auction, every bidder has a dominant strategy: bid their
true valuation.
• Key properties:

1. Dominant-Strategy Compatible (DSIC): Bidding truthfully is always


the best strategy.
2. Surplus Maximization: Bidding truthfully maximizes the social sur-
plus:
Xn
vi xi ,
i=1

where xi = 1 if bidder i wins.


3. Efficient Implementation: Can be implemented in linear time.

• Truthful bidding avoids the following risks:


1. Overbidding: May result in winning at a price greater than valuation,
causing negative utility.
2. Underbidding: May result in losing an auction even when the item’s
value exceeds the second-highest bid.
• Utility of a truth-telling bidder:
(
vi − B, if wins (where B is the second-highest bid),
Ui =
0, if loses.

Sponsored Search Auctions


• Goals:
1. DSIC: Truthful bidding should be dominant and yield non-negative
utility.
2. Surplus Maximization: Truthful bidding should maximize social sur-
plus.
3. Polynomial-Time: Assignments and payments should be computable
efficiently.
• Process:
1. Assign slots to bidders in descending order of bids to maximize sur-
plus.
2. Set prices to ensure DSIC behavior.

25
Myerson’s Lemma
• Setting:
1. Allocation Space X :
– Single-item auctions: X = {0, 1}n , with i xi = 1.
P

– Sponsored search: xi = αj if bidder i is assigned slot j.


2. Allocation Rule x(b) : Rn≥0 → X :
– Single-item auctions: Allocate the good to the highest bid.
– Sponsored search: Assign slot j to the j-th highest bid.
3. Payment Rule p(b) : Rn≥0 → Rn≥0 :
– Single-item auctions: Second-price payment.
– Sponsored search: Determined via Myerson’s Lemma.
4. Utility:
Ui (b) = vi xi (b) − pi (b).
• Myerson’s Lemma:
1. An allocation rule x is implementable if and only if it is monotone:
b′i ≥ bi =⇒ xi (b′i , b−i ) ≥ xi (bi , b−i ), ∀b′i , bi , b−i , ∀i.

2. For monotone x, there exists a unique payment rule p such that (x, p)
is DSIC.
3. The payment rule can be derived analytically.
• Observations:
– Monotonicity ensures implementability.
– The payment rule is unique.

Proof of Monotonicity and Payment Rule


• DSIC implies that truthful reporting is the best strategy:
z · x(z) − p(z) ≥ z · x(y) − p(y),
and
y · x(y) − p(y) ≥ y · x(z) − p(z).
• Combining, the ”sandwich inequality” holds:
z · [x(y) − x(z)] ≤ p(y) − p(z) ≤ y · [x(y) − x(z)].

• Implications:
– x(z) must be monotone; otherwise, the inequality is violated.
– The payment difference p(y) − p(z) is bounded by changes in alloca-
tion probability scaled by z and y.

26
Guessing the Price Function
• Use discontinuities in x to derive p:

z · (x(y) − x(z)) ≤ ∆p ≤ y · (x(y) − x(z)).

• At a discontinuity:
∆p = h · z,
where h is the height of the discontinuity.
• Fix p(0) = 0. Candidate formula:
l
X
pi (bi , b−i ) = zj · (jump in xi (·, b−i ) at zj ).
j=1

27

You might also like