9
MIN-COST ABORESCENCES YQ Lu

MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Embed Size (px)

Citation preview

Page 1: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

MIN-COST ABORESCENCESYQ Lu

Page 2: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Aborescence• Definition: Given a directed graph G=(V,E) and a root r, an

aborescence rooted at r is a subgraph T that each vertex v!= r is uniquely reachable from r

• Directed analogue of a spanning tree

• Equivalent definitions:• No directed cycles, and each vertex v != r has exactly one entering

edge

• No directed cycles, and T has |V| - 1 arcs

Page 3: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Min-cost aborescences• Given a directed graph G with:

• non-negative costs on each edge• a root r such that each vertex is reachable from r:

• Find an aborescence rooted at r of total min cost.

• Distinct from other related problems:• Minimum spanning tree• Shortest paths tree• etc

Page 4: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Main Idea of Edmond’s Algorithm• Pick edges greedily• This might not work, but helps reduce to subproblem• Solve recursively

Page 5: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Naïve Greedy Picking• Recall that an aborescence must contain exactly one

edge entering each vertex

• Strategy: for each v != r, pick the cheapest edge entering it

• Claim: if this is an aborescence, it is a min-cost aborescence

• Problem: directed cycles might result

• (this gives us a O(E) algorithm for DAGs)

Page 6: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Pre-processing graph• Label each vertex v != r by y(v), the min cost of any edge

entering v

• The reduced cost of an edge (u,v) is c’(u,v) = c(u,v) – y(v).

• Equivalence: T is a min-cost aborescence in G with costs c iff T is a min-cost aborescence in G with costs c’.

• Proof: (see board)

Page 7: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Edmond’s Algorithm• Relabel costs c in graph G by reduced costs c’• Let F* = set of 0-cost edges• If F* does not have a cycle:

• F* is a min-cost aborescence, we are done!

• If F* has cycles: • Shrink one cycle C={v_c} into one v’• Call new graph G’• Perform algorithm recursively on G’ to get T’• Extend T’, min-cost aborescence in G’, to get T, min-cost

aborescence in G

Page 8: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Extension step• Since T’ is a min-cost aborescence in G’• Each node (including the contracted cycle v’) has exactly

one incoming edge• Suppose incoming edge to v’ corresponded to (u,v) in

original graph• Return all edges in T’ and all edges in cycle except for the

one entering v

• Claim: this gives a min-cost aborescence in G• Proof: (see board)

Page 9: MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each

Runtime• Reducing costs takes O(E) time• Picking 0-cost edges takes O(E) time• Cycle detection takes O(V) time• Recursive step is carried out at most O(V) times

• Algorithm runs in O(VE) time• Possible to reduce to O(E + V log V)

• (Gabow, Galil, Spencer, Tarjan 1985)