5.4 T-joins and Postman Problems Assume 𝑐≥0 and 𝐺 is connected. Thm 5.23: A connected graph 𝐺 has an Euler tour if and only if every node of 𝐺 has even degree. Let 𝑥𝑒 be the number of extra traversals of edge 𝑒 in a postman tour. Construct the graph 𝐺𝑥 by making 1+𝑥𝑒 copies of 𝑒 for each 𝑒. 1 1 1 1 𝐺, x, and 𝐺𝑥 Combinatorial Optimization 2016
Postman Problem is equivalent to the problem: Minimize (𝑐𝑒𝑥𝑒:𝑒∈𝐸) (5.30) subject to 𝑥(𝛿(𝑣))≡|𝛿(𝑣)| (mod 2), for all 𝑣∈𝑉 𝑥𝑒≥0, for all 𝑒∈𝐸. 𝑥𝑒 integer, for all 𝑒∈𝐸. There is an optimal solution for which 𝑥 is {0, 1}-valued. (since 𝑐≥0) We call a set 𝐽⊆𝐸 a postman set of 𝐺 if, for every 𝑣∈𝑉, 𝑣 is incident with an odd number of edges from 𝐽 iff 𝑣 has odd degree in 𝐺. Postman Problem Given: A graph 𝐺=(𝑉, 𝐸) and 𝑐∈𝑅𝐸 such that 𝑐≥0. Objective: To find a postman set 𝐽 such that 𝑐(𝐽) is minimum. Combinatorial Optimization 2016
Optimal T-Join Problem (T-Joins) Let 𝐺=(𝑉, 𝐸) be a graph, and let 𝑇⊆𝑉 such that |𝑇| is even. A T-join of 𝐺 is a set 𝐽 of edges such that |𝐽∩𝛿(𝑣)|≡|𝑇∩{𝑣}| (mod 2), for all 𝑣∈𝑉 𝐽 is a 𝑇-join iff the odd-degree nodes of the subgraph (𝑉, 𝐽) are exactly the elements of 𝑇. Optimal T-Join Problem Given: A graph 𝐺=(𝑉, 𝐸), a set 𝑇⊆𝑉 such that |𝑇| is even, and a cost vector 𝑐∈𝑅𝐸. Objective: Find a 𝑇-join 𝐽 of 𝐺 such that 𝑐(𝐽) is minimum. Combinatorial Optimization 2016
Postman sets: Let 𝑇={𝑣∈𝑉: |𝛿(𝑣)| is odd} ( need 𝑐≥0) Even set: Examples: Postman sets: Let 𝑇={𝑣∈𝑉: |𝛿(𝑣)| is odd} ( need 𝑐≥0) Even set: Even set is a set 𝐴⊆𝐸 such that every node of (𝑉, 𝐴) has even degree. Let 𝑇=∅. If costs are nonnegative, ∅ is optimal. A set is even iff it can be decomposed into edge-sets of edge-disjoint circuits. Hence ∅ is optimal iff 𝐺 has no negative-cost circuit. (can find a negative-cost circuit or determine that none exists.) (𝑟, 𝑠)-paths: Let 𝑟, 𝑠∈𝑉, and 𝑇={𝑟, 𝑠}. Every 𝑇-join 𝐽 contains the edge-set of an (𝑟, 𝑠)-path (otherwise, the component of the subgraph (𝑉, 𝐽) containing 𝑟 has only one node of odd degree, which is impossible.). So minimal 𝑇-joins are edge-sets of simple (𝑟, 𝑠)-paths. Combinatorial Optimization 2016
(Pf) ( ⇒) Suppose 𝐽 is a 𝑇-join and 𝐽′ is a 𝑇′-join. Let 𝑣∈𝑉. Deleting a simple (𝑟, 𝑠)-path from a (not minimal) 𝑇-join 𝐽, we obtain even sets. Hence if the graph contains no negative-cost circuit, optimal 𝑇-join (and minimal) is minimum cost simple (𝑟, 𝑠)-path. (can solve the shortest simple (𝑟, 𝑠)-path problem for undirected graphs when negative edge costs are allowed, but negative cost circuits are not.) Prop 5.24: Let 𝐽′ be a 𝑇′-join of 𝐺. Then 𝐽 is a 𝑇-join of 𝐺 if and only if 𝐽△𝐽′ is a (𝑇△𝑇′)-join of 𝐺. (Pf) ( ⇒) Suppose 𝐽 is a 𝑇-join and 𝐽′ is a 𝑇′-join. Let 𝑣∈𝑉. Then |(𝐽△𝐽′)∩𝛿(𝑣)| is even ⇔ |𝐽∩𝛿(𝑣)|≡| 𝐽′∩𝛿(𝑣)| (mod 2) ⇔ 𝑣 is an element of neither or both of 𝑇 and 𝑇′. ⇔ 𝑣∉𝑇△𝑇′. (⇐) apply "only if" part with 𝐽 replaced by 𝐽△𝐽′ and 𝑇 replaced by 𝑇△𝑇′. Combinatorial Optimization 2016
Solving the Optimal T-Join Problem First, obtain an algorithm for the case 𝑐≥0. Then transform a problem with negative costs into one with nonnegative costs. When 𝑐≥0, there is always an optimal 𝑇-join that is minimal. The minimal 𝑇-join can be characterized, as follows. Prop 5.25: Every minimal 𝑇-join is the union of the edge-sets of |𝑇|/2 edge-disjoint simple paths, which join the nodes in 𝑇 in pairs. (Pf) {∪{ 𝑃 𝑖 }} is a 𝑇-join. Now, enough to show that any 𝑇-join contains such a set of edge-disjoint paths. Let 𝑢∈𝑇, and let 𝐻 be the component of (𝑉, 𝐽) that contains 𝑢. Then there is a node 𝑣≠𝑢 in 𝑇∩𝐻. (otherwise 𝑢 is the only node in 𝐻 of odd degree) So there is a simple (𝑢, 𝑣) path 𝑃 such that 𝐸(𝑃)⊆𝐽. Now 𝐽\E(𝑃) is a 𝑇′-join, where 𝑇′=𝑇∖{𝑢, 𝑣} by Proposition 5.24. Repeat the argument. Combinatorial Optimization 2016
𝑐(𝐽\E(𝑃))+𝑐(𝐸(𝑃′)−2𝑐( (𝐽\E(𝑃))∩𝐸(𝑃′) ) ≤𝑐(𝐽)−𝑐(𝐸(𝑃))+𝑐(𝐸(𝑃′))<𝑐(𝐽), Suppose (𝑐≥0 and) an optimal 𝑇-join is expressed as union of edge-sets of paths as in Proposition 5.25, and 𝑃 is one of these paths, with 𝑃 joining 𝑢, 𝑣∈𝑇. Then 𝑃 is a minimum cost (𝑢, 𝑣)-path. Suppose there is a (𝑢, 𝑣)-path 𝑃′ in 𝐺 that has smaller cost than 𝑃. By Proposition 5.24, 𝐽△𝐸(𝑃)△𝐸(𝑃′) is a 𝑇-join. Since 𝐸(𝑃)⊆𝐽, its cost is 𝑐(𝐽\E(𝑃))+𝑐(𝐸(𝑃′)−2𝑐( (𝐽\E(𝑃))∩𝐸(𝑃′) ) ≤𝑐(𝐽)−𝑐(𝐸(𝑃))+𝑐(𝐸(𝑃′))<𝑐(𝐽), a contradiction. Hence Prop 5.26: Suppose that 𝑐≥0. Then there is an optimal 𝑇-join that is the union of |𝑇|/2 edge-disjoint shortest paths joining the nodes of 𝑇 in pairs. Combinatorial Optimization 2016
s.t. 𝑢1𝑣1, …, 𝑢𝑘𝑣𝑘 is a pairing of the elements of 𝑇. For any pair 𝑢, 𝑣 of nodes in 𝑇, let 𝑑(𝑢, 𝑣) be the cost of a least cost (𝑢, 𝑣)-path in 𝐺. Let |𝑇|=2𝑘. The minimum cost 𝑇-join is (assuming 𝑐≥0) minimize 𝑑 𝑢 𝑖 , 𝑣 𝑖 :𝑖=1,…,𝑘 s.t. 𝑢1𝑣1, …, 𝑢𝑘𝑣𝑘 is a pairing of the elements of 𝑇. Form a complete graph 𝐺 = 𝑇, 𝐸 , give edge 𝑢𝑣 weight 𝑑(𝑢, 𝑣), and find a minimum-weight perfect matching of 𝐺 . Join the selected pairs in 𝐺 using shortest paths. If some edges overlap (since 𝑐𝑒=0 allowed), take symmetric difference. 𝑞 8 2 𝑝 𝑟 𝑣 𝑏 1 1 1 4 4 3 2 2 𝑎 4 𝑢 𝑠 1 3 9 𝑡 Combinatorial Optimization 2016
𝑞 𝑞 8 2 5 2 6 5 7 𝑝 𝑟 𝑝 3 𝑟 𝑣 1 𝑏 6 1 1 4 4 5 4 3 4 3 3 2 2 𝑎 4 𝑢 𝑠 𝑢 𝑠 7 1 3 9 3 𝑞 𝑡 𝑡 8 2 𝑝 𝑟 𝑣 𝑏 1 1 1 4 3 4 2 2 𝑎 4 𝑢 𝑠 Optimal 𝑇-join 1 3 9 𝑡 Combinatorial Optimization 2016
Negative Costs Given 𝑐∈𝑅𝐸, let 𝑁={𝑒∈𝐸: 𝑐𝑒<0}. Let 𝑇′ be the set of nodes of 𝐺 that have odd degree in the subgraph (𝑉, 𝑁). Then 𝑁 is a 𝑇′-join. By proposition 5.24, 𝐽 is a 𝑇-join ⇔ 𝐽△𝑁 is a (𝑇△𝑇′)-join. 𝑐(𝐽)=𝑐(𝐽\N)+𝑐(𝐽∩𝑁) =𝑐(𝐽\N)−𝑐(𝑁∖J)+𝑐(𝑁\J)+𝑐(𝐽⋂𝑁) =|𝑐|(𝐽△𝑁)+𝑐(𝑁). ( |𝑐| is the vector defined by |𝑐|𝑒=|𝑐𝑒|.) 𝑐(𝑁) is a constant that does not depend on 𝐽. Hence 𝐽 is an optimal 𝑇-join w.r.t. cost vector 𝑐 ⇔ 𝐽△𝑁 is an optimal (𝑇△𝑇′)-join w.r.t. cost vector |𝑐|. Combinatorial Optimization 2016
Optimal T-Join Algorithm Step 1. Identify the set 𝑁 of edges having negative cost, and the set 𝑇′ of nodes incident with an odd number of edges from 𝑁. Replace 𝑐 by |𝑐| and 𝑇 by 𝑇△𝑇′. Step 2. Find a least-cost (𝑢, 𝑣)-path 𝑃𝑢𝑣 w.r.t. cost vector 𝑐 for each pair 𝑢, 𝑣 of nodes from 𝑇. Let 𝑑(𝑢, 𝑣) be the cost of 𝑃𝑢𝑣. Step 3. Form a complete graph 𝐺 = 𝑇, 𝐸 with 𝑢𝑣 having weight 𝑑(𝑢, 𝑣) for each 𝑢𝑣∈ 𝐸 . Find a minimum-weight perfect matching 𝑀 in 𝐺 . Step 4. Let 𝐽 be the symmetric difference of the edge-sets of paths 𝑃𝑢𝑣 for 𝑢𝑣∈𝑀. Step 5. Replace 𝐽 by 𝐽△𝑁. Combinatorial Optimization 2016
|𝑐|-optimal (𝑇△𝑇′)-join 𝑎 2 𝑏 𝑎 2 𝑏 -2 2 2 2 5 5 -3 3 𝑟 𝑐 𝑠 𝑟 𝑐 𝑠 1 6 1 6 1 2 1 2 2 2 𝑑 𝑒 𝑒 𝑑 𝐺, 𝑇, 𝑐 𝐺, 𝑇△𝑇′, |𝑐| 𝑎 𝑏 𝑎 𝑏 𝑟 𝑐 𝑠 𝑟 𝑐 𝑠 𝑑 𝑒 𝑑 𝑒 |𝑐|-optimal (𝑇△𝑇′)-join 𝑐-optimal 𝑇-join Combinatorial Optimization 2016