Priority algorithms part 1: exact algorithms Joan Boyar 1 , Kim S. - - PowerPoint PPT Presentation

priority algorithms part 1 exact algorithms
SMART_READER_LITE
LIVE PREVIEW

Priority algorithms part 1: exact algorithms Joan Boyar 1 , Kim S. - - PowerPoint PPT Presentation

Priority algorithms part 1: exact algorithms Joan Boyar 1 , Kim S. Larsen 1 , and Denis Pankratov 2 1 University of Southern Denmark 2 Concordia University OLAWA 2020 What is a Greedy Algorithm? CLRS: A greedy algorithm always makes


slide-1
SLIDE 1

Priority algorithms — part 1: exact algorithms

Joan Boyar1, Kim S. Larsen1, and Denis Pankratov2

1 University of Southern Denmark 2 Concordia University

OLAWA 2020

slide-2
SLIDE 2

What is a Greedy Algorithm?

  • CLRS: “A greedy algorithm always makes the choice that looks best at

the moment. That is, it makes a locally optimal choice in the hope that this choice will lead to a globally optimal solution.”

  • Pros: conceptually simple, easy to design, describe and implement,

fast running times.

  • Cons: don’t always work well.
  • To study power and limitations of greedy algorithms we need a formal

model.

  • Surprise: there is no universally agreed upon model!
slide-3
SLIDE 3

Models of Greedy Algorithms

  • Matroid – Whitney (1935), Edmonds (1971)
  • Greedoid – Korte and Lovasz (1981)
  • Online Algorithms/Competitive Analysis – Sleator and Tarjan (1985),

Graham (1966), …

  • “In a somewhat vacuous sense, all online algorithms are greedy, since an
  • nline algorithm is defined by a function f of the current request, the current

state, and the history.” – Karlin and Irani

  • Priority Algorithms – Borodin, Nielsen, Rackoff (2002)
  • Online algorithms on steroids
slide-4
SLIDE 4

Priority Algorithms

  • Many greedy algorithms have the structure:
  • Sort input items in some way
  • Run some online algorithm on the sorted input
  • E.g.: Kruskal’s algorithm for MST
  • Sometimes the algorithm resorts remaining input items in between online

decisions, e.g., Prim’s algorithm for MST

  • Modelling obstacle:
  • Many problems admit an input order for which trivial online algorithm is
  • ptimal (e.g., matching)
  • How do we restrict sorting functions?
slide-5
SLIDE 5

Priority Algorithms

  • Input is a collection 𝐽 = ⟨𝑦!, … , 𝑦"⟩ of items from the universe 𝑉
  • Overcoming modelling obstacle:
  • Sorting function is not allowed to depend on 𝐽
  • Sorting function has to order the entire universe 𝑉
  • Often specified by a priority function 𝑄 ∶ 𝑉 → ℝ
slide-6
SLIDE 6

Priority Algorithms

Fixed Priority Algorithm: Specify 𝑄 ∶ 𝑉 → ℝ While 𝐽 is not empty 𝑦 ← 𝑏𝑠𝑕𝑛𝑏𝑦#∈%{𝑄 𝑦 } make an irrevocable decision on 𝑦 𝐽 ← 𝐽 ∖ {𝑦} Adaptive Priority Algorithm: Specify initial 𝑄 ∶ 𝑉 → ℝ While 𝐽 is not empty 𝑦 ← 𝑏𝑠𝑕𝑛𝑏𝑦#∈%{𝑄 𝑦 } make an irrevocable decision on 𝑦 𝐽 ← 𝐽 ∖ {𝑦} Update 𝑄 ∶ 𝑉 → ℝ

slide-7
SLIDE 7

MST Example

  • 𝑉 = ℕ × ℕ × (ℝ ∪ {−∞, +∞})
  • Item 𝑣, 𝑤, 𝑥 : 𝑣, 𝑤 – endpoints of an edge; 𝑥 – weight of the edge
  • Kruskal’s algorithm:
  • fixed priority 𝑄 𝑣, 𝑤, 𝑥 = −𝑥, i.e., negative projection on the third

coordinate

  • decision: accept the item if and only if it does not create a cycle
  • Prim’s algorithm:
  • Adaptive priority: let 𝑇 be the set of encountered vertices so far
  • 𝑄 𝑣, 𝑤, 𝑥 = −𝑥 if 𝑣 or 𝑤 is in 𝑇 and −∞ otherwise
slide-8
SLIDE 8

Properties of the model

  • Information-theoretic
  • Similar to online algorithms
  • Makes lower bounds very strong
  • Upper bounds typically translate to polynomial time algorithms
  • Does not capture all greedy algorithms
  • In particular, greedy algorithms could precompute some functions

providing useful side-information for the online phase

  • This could be modeled with advice
slide-9
SLIDE 9

Adding Advice to Fixed Priority

Borodin, Boyar, Larsen, Pankratov. Advice Complexity of Priority

  • Algorithms. WAOA 2018

Priority function 𝑄 does not depend on advice

slide-10
SLIDE 10

Adding Advice to Adaptive Priority

𝐽 is the input 𝑄!: 𝑉 → ℝ is the initial priority function 𝑗 ← 1 While 𝐽 ≠ ∅ 𝑦" ← 𝑏𝑠𝑕𝑛𝑏𝑦#∈%{𝑄"&' 𝑦 } read zero or more bits of advice from the tape 𝑡" ← known contents of the advice tape 𝑒" ← decision of 𝐵𝑀𝐻 on 𝑦" 𝑄" ← updated priority function 𝐽 ← 𝐽 ∖ {𝑦"} 𝑗 ← 𝑗 + 1

Model 1: 𝑄! ≔ 𝑄!(𝑦", … , 𝑦!, 𝑡!) Model 2: 𝑄! ≔ 𝑄!(𝑦", … , 𝑦!, 𝑒", … , 𝑒!)

slide-11
SLIDE 11

Rest of the Talk

  • 𝐻 = 𝑊, 𝐹 - simple undirected graph;
  • 𝑊 = 𝑜, 𝐹 = 𝑛
  • 𝑇 ⊆ 𝑊 is a vertex cover if 𝑣, 𝑤 ∈ 𝐹 implies either 𝑣 ∈ 𝑇 or 𝑤 ∈ 𝑇
  • Input items 𝑤, 𝑂 𝑤

∈ ℕ × ⋃&∈ℕ

ℕ &

  • Theorem. There is an adaptive priority algorithm, 𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢, that solves the

Minimum Vertex Cover (VC) problem with at most

# $$ 𝑜 ≈ 0.3182 𝑜 bits of

advice in Model 2 on triangle free graphs with maximum degree at most 3.

slide-12
SLIDE 12
  • Exact algorithm, so also solves MIS (Maximum Independent Set)
  • Graph class might seem restrictive, but MIS/VC for this class or

related classes has rich history:

  • Brooks (1941), Staton (1979), Jones (1990), Heckman and Thomas (2001),

Harant et al (2008), Kanj and Zhang (2010), …

  • No adaptive priority algorithm without advice can achieve

approximation ratio better than 4/3. (Borodin et al. 2010).

  • No online algorithm with fewer than

" ( − 𝑑 bits of advice can achieve

  • ptimality. (this work, not presented).
  • Theorem. There is an adaptive priority algorithm, 𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢, that solves the

Minimum Vertex Cover (VC) problem with at most

# $$ 𝑜 ≈ 0.3182 𝑜 bits of

advice in Model 2 on triangle free graphs with maximum degree at most 3.

slide-13
SLIDE 13

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Intuition

  • Suppose vertices are revealed in order

𝑤!, 𝑤), … , 𝑤".

  • Current neighborhood of 𝑤* is

𝑂 𝑤* ∖ {𝑤!, … , 𝑤*+!}.

  • The size of the current neighborhood of 𝑤* is its current degree,

𝒅𝒆𝒇𝒉(𝒘𝒋).

  • An advice bit: accept 𝑤* into a VC or not.
  • Key idea: often we can infer whether to accept or reject 𝑤* without

advice.

  • Specify priority functions so that we maximize the number of vertices

that do not require advice.

slide-14
SLIDE 14

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

  • If 𝑑𝑒𝑓𝑕 𝑤* = 0 then 𝑤* can be rejected.
  • If 𝑑𝑒𝑓𝑕 𝑤* = 1 then 𝑤* can be rejected and its unique neighbor

accepted.

𝑤! 𝑤" 𝑑𝑒𝑓𝑕 𝑤! = 1 Has highest priority

slide-15
SLIDE 15

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

  • If 𝑑𝑒𝑓𝑕 𝑤* = 0 then 𝑤* can be rejected.
  • If 𝑑𝑒𝑓𝑕 𝑤* = 1 then 𝑤* can be rejected and its unique neighbor

accepted.

𝑤! 𝑤" 𝑤! 𝑤" Reject without advice Adaptively give its unique neighbor highest priority

slide-16
SLIDE 16

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

  • If 𝑑𝑒𝑓𝑕 𝑤* = 0 then 𝑤* can be rejected.
  • If 𝑑𝑒𝑓𝑕 𝑤* = 1 then 𝑤* can be rejected and its unique neighbor

accepted.

𝑤! 𝑤" 𝑤! 𝑤" 𝑤! 𝑤" 𝑤# 𝑤$ When it arrives, accept it

slide-17
SLIDE 17

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

  • Suppose that 𝑑𝑒𝑓𝑕 𝑤* = 2 for all remaining vertices.
  • This implies that the remaining graph is a set of vertex disjoint cycles.
  • Can be processed without advice:
  • Giving 𝑑𝑒𝑓𝑕 = 2 lowest priority allows us to detect this case.
slide-18
SLIDE 18
  • Therefore, we can handle 𝑑𝑒𝑓𝑕 = 0, 1, and 2 vertices without advice.
  • Need more tricks to avoid giving advice to many 𝑑𝑒𝑓𝑕 = 3 vertices.
  • IDEA: cooperation between the oracle and the algorithm.

INTUITION (actual details more involved)

  • Suppose 𝑑𝑒𝑓𝑕 𝑤* = 3 and 𝑤* requires advice
  • Moreover, suppose there is a minimum VC which includes 𝑤* and

there is another minimum VC which excludes 𝑤*

  • ORACLE prefers to give advice to REJECT 𝑤*

Implies that at most one neighbor of 𝑤* with accept advice is accepted

Received advice to be accepted 𝑣! 𝑤% 𝑣# 𝑣"

slide-19
SLIDE 19
  • Therefore, we can handle 𝑑𝑒𝑓𝑕 = 0, 1, and 2 vertices without advice.
  • Need more tricks to avoid giving advice to many 𝑑𝑒𝑓𝑕 = 3 vertices.
  • IDEA: cooperation between the oracle and the algorithm.

INTUITION (actual details more involved)

  • Suppose 𝑑𝑒𝑓𝑕 𝑤* = 3 and 𝑤* requires advice
  • Moreover, suppose there is a minimum VC which includes 𝑤* and

there is another minimum VC which excludes 𝑤*

  • ORACLE prefers to give advice to REJECT 𝑤*

Implies that at most one neighbor of 𝑤* with accept advice is accepted

Received advice to be accepted 𝑣! 𝑤% 𝑣# 𝑣" If ≥ 2 accepted neighbors

slide-20
SLIDE 20
  • Therefore, we can handle 𝑑𝑒𝑓𝑕 = 0, 1, and 2 vertices without advice.
  • Need more tricks to avoid giving advice to many 𝑑𝑒𝑓𝑕 = 3 vertices.
  • IDEA: cooperation between the oracle and the algorithm.

INTUITION (actual details more involved)

  • Suppose 𝑑𝑒𝑓𝑕 𝑤* = 3 and 𝑤* requires advice
  • Moreover, suppose there is a minimum VC which includes 𝑤* and

there is another minimum VC which excludes 𝑤*

  • ORACLE prefers to give advice to REJECT 𝑤*

Implies that at most one neighbor of 𝑤* with accept advice is accepted

Received advice to be accepted 𝑣! 𝑤% 𝑣# 𝑣" If ≥ 2 accepted neighbors Could have been rejected 𝑣! 𝑤% 𝑣# 𝑣" Then there is another VC of same size where 𝑤% is rejected

slide-21
SLIDE 21

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

𝑣! 𝑤′ 𝑣# 𝑣" Received advice to be accepted, (*) At most 1 of 𝒗𝟐, 𝒗𝟑, 𝒗𝟒 can be accepted in the future Dashed edges are not yet revealed Use this to avoid giving advice to other degree 3 vertices If there exists 𝑤 such that 𝑑𝑒𝑓𝑕 𝑤 = 3 and | | 𝑂 𝑤 ∩ 𝑣!, 𝑣", 𝑣# ≥ 2 then accept 𝑤 Why? Property (*) guarantees 𝑤 has a rejected neighbor

slide-22
SLIDE 22

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Ideas

𝑣! 𝑤′ 𝑣# 𝑣" Received advice to be accepted, (*) At most 1 of 𝒗𝟐, 𝒗𝟑, 𝒗𝟒 can be accepted in the future 𝑤 Use this to avoid giving advice to other degree 3 vertices If there exists 𝑤 such that 𝑑𝑒𝑓𝑕 𝑤 = 3 and | | 𝑂 𝑤 ∩ 𝑣!, 𝑣", 𝑣# ≥ 2 then accept 𝑤 Why? Property (*) guarantees 𝑤 has a rejected neighbor

slide-23
SLIDE 23

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Priority Function

slide-24
SLIDE 24

𝑆𝑓𝑘𝑓𝑑𝑢𝐺𝑗𝑠𝑡𝑢 Main Loop

slide-25
SLIDE 25

Key Notion in the Analysis

  • Interactions of 𝑑𝑒𝑓𝑕 = 3 through common neighbors have effect on

advice complexity.

  • Component: captures related sequences of 𝑑𝑒𝑓𝑕 = 3 vertices with

shared neighbors during runtime.

slide-26
SLIDE 26

Example

Current degree 3 Receives advice to be accepted

slide-27
SLIDE 27

Example

New component gets started Include advice-vertex and its neighbors

slide-28
SLIDE 28

Example

New component gets started Include advice-vertex and its neighbors Current degree 3 Receives advice to be accepted

slide-29
SLIDE 29

Example

Component gets closed New component gets started Include advice-vertex and its neighbors

slide-30
SLIDE 30

Example

Current degree 3 Shares 1 neighbor with previous advice-vertex Receives advice

slide-31
SLIDE 31

Example

The vertex and its neighbors get added to the current component

slide-32
SLIDE 32

More notation

  • For component 𝑗 ∈ [𝑑]
  • 𝑡! - total number of vertices in component 𝑗
  • 𝑏! - number of vertices that received advice in component 𝑗

𝑜 = ∑*-!

.

𝑡* and 𝑏 ≔ ∑*-!

.

𝑏*

  • Lemma 1

𝑡* ≥ 3 𝑏* + 1

  • Lemma 2

10 𝑏 − 4 𝑑 ≤ 3 𝑜 Proofs: elaborate charging arguments: vertex-based for Lemma 1 and edge-based for Lemma 2.

slide-33
SLIDE 33

Proof of the Main Result Follows

  • Total number of advice bits is 𝑏

3 𝑏 + 𝑑 ≤ 𝑜 (Lemma 1) 10𝑏 − 4 𝑑 ≤ 3𝑜 (Lemma 2) 4 × first inequality + 1 × second inequality implies 22 𝑏 ≤ 7 𝑜, i.e., 𝑏 ≤ 7 22 𝑜 QED.

slide-34
SLIDE 34

Exact Algorithms

  • Adaptive priority algorithm ⇒ exact offline algorithm
  • Enumerate all possible advice strings and run the algorithm
  • Runtime is bounded by 2

! "" "𝑞𝑝𝑚𝑧 𝑜 = 𝑃(1.2468")

  • Potentially could be improved by a more careful measure and

conquer analysis technique

  • Generate advice recursively one bit at a time
  • Not all branches have equal depth
  • Keep track of its branch depths carefully