+ All Categories
Home > Documents > arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28...

arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28...

Date post: 08-Oct-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
26
arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs Saeed Akhoondian Amiri 1 Szymon Dudycz 2 Stefan Schmid 3 Sebastian Wiederrecht 1 1 TU Berlin, DE 2 University of Wroclaw, PL 3 Aalborg University, DK Abstract. We initiate the theoretical study of a fundamental practical problem: how to schedule the congestion-free rerouting of k flows? The input to our problem are k path pairs: for each of the k unsplittable flows (of a certain demand), there is an old and a new path along which the flow should be routed. As different flows can interfere on the physical links, the updates of the different flows at the different nodes must be scheduled such that transient congestion is avoided. This optimization problem finds immediate applications, e.g., in traffic engineering in com- puter networks. We show that the problem is generally NP-hard already for k = 2 flows. Interestingly, we find that for general k, deciding whether an unsplittable multi-commodity flow rerouting schedule exists, is even NP-hard on DAGs. Both NP-hardness proofs are non-trivial. We then present two polynomial-time algorithms to solve the route update prob- lem for a constant number of flows on DAGs. Both algorithms employ a decomposition of the flow graph into smaller parts which we call blocks. Based on the given block decomposition, we define a dependency graph whose properties can be leveraged to compute an optimal solution for k = 2 flows. For arbitrary but fixed k, we introduce a weaker depen- dency graph and present our main contribution: an elegant linear-time algorithm which solves the problem in time 2 O(k log k) O(|G|). 1 Introduction While congestion-aware routing problems have been studied inten- sively [1,6,7,8,13,14,15,17], surprisingly little is known today about how to update the routes of flows in a capacitated network in a congestion-free manner. Flow re routing problems are not only natural and of fundamental the- oretical interest, but also practically very relevant, e.g., in the context of traffic engineering problems. For two reasons: First, we currently witness a renaissance of routing based on unsplittable flows : traffic engineering mechanisms based on RSVP-TE [3] or OpenFlow resp. Software-Defined Networks (SDNs) [5,18] are The research of Saeed Akhoondian Amiri and Sebastian Wiederrecht has been sup- ported by the European Research Council (ERC) under the European Union’s Hori- zon 2020 research and innovation programme (ERC consolidator grant DISTRUCT, agreement No 648527). Stefan Schmid was supported by the Danish VILLUM foun- dation project ReNet.
Transcript
Page 1: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

arX

iv:1

611.

0929

6v1

[cs

.DS]

28

Nov

201

6

Congestion-Free Rerouting of

Flows on DAGs⋆

Saeed Akhoondian Amiri1 Szymon Dudycz2

Stefan Schmid3 Sebastian Wiederrecht1

1 TU Berlin, DE 2 University of Wroclaw, PL 3 Aalborg University, DK

Abstract. We initiate the theoretical study of a fundamental practicalproblem: how to schedule the congestion-free rerouting of k flows? Theinput to our problem are k path pairs: for each of the k unsplittable flows(of a certain demand), there is an old and a new path along which theflow should be routed. As different flows can interfere on the physicallinks, the updates of the different flows at the different nodes must bescheduled such that transient congestion is avoided. This optimizationproblem finds immediate applications, e.g., in traffic engineering in com-puter networks. We show that the problem is generally NP-hard alreadyfor k = 2 flows. Interestingly, we find that for general k, deciding whetheran unsplittable multi-commodity flow rerouting schedule exists, is evenNP-hard on DAGs. Both NP-hardness proofs are non-trivial. We thenpresent two polynomial-time algorithms to solve the route update prob-lem for a constant number of flows on DAGs. Both algorithms employ adecomposition of the flow graph into smaller parts which we call blocks.Based on the given block decomposition, we define a dependency graphwhose properties can be leveraged to compute an optimal solution fork = 2 flows. For arbitrary but fixed k, we introduce a weaker depen-dency graph and present our main contribution: an elegant linear-timealgorithm which solves the problem in time 2O(k log k)O(|G|).

1 Introduction

While congestion-aware routing problems have been studied inten-sively [1,6,7,8,13,14,15,17], surprisingly little is known today about howto update the routes of flows in a capacitated network in a congestion-freemanner. Flow rerouting problems are not only natural and of fundamental the-oretical interest, but also practically very relevant, e.g., in the context of trafficengineering problems. For two reasons: First, we currently witness a renaissanceof routing based on unsplittable flows : traffic engineering mechanisms based onRSVP-TE [3] or OpenFlow resp. Software-Defined Networks (SDNs) [5,18] are

⋆ The research of Saeed Akhoondian Amiri and Sebastian Wiederrecht has been sup-ported by the European Research Council (ERC) under the European Union’s Hori-zon 2020 research and innovation programme (ERC consolidator grant DISTRUCT,agreement No 648527). Stefan Schmid was supported by the Danish VILLUM foun-dation project ReNet.

Page 2: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

2 S.A. Amiri et al.

based on unsplittable flows, to provide a better quality-of-service (compared totraditional packet-switched networks). Second, real networks are dynamic, andthe ability to update routes is essential in a number of scenarios: to account forchanges in the security policies, in response to new route advertisements, duringmaintenance (e.g., replacing a router), to support the migration of virtualmachines, etc. With the advent of more programmable computer networks [9],traffic engineering is likely to become even more dynamic and adaptive, entailingmore frequent route updates [10].

However, the migration of flows from their old (simple) paths to the given new(simple) paths can be challenging, due to the asynchrony introduced by impre-cisions of clock synchronization protocols as well as by variations in the updatetimes of the internal data structures of the router’s forwarding tables [12]. In par-ticular, updates simultaneously sent out by a logically centralized SDN controlleror updates scheduled for a certain time at a certain router, can take effect asyn-chronously. Accordingly, to avoid transient inconsistencies, the updates of thedifferent flows at the different routers must be scheduled carefully: potentiallyconflicting updates should be scheduled at different times or rounds.

Figure 1 presents an example of the congestion-free rerouting problem ofunsplittable flows considered in this paper.

In this paper we present a succinct definition of consistency which generalizeswell-studied properties such as congestion-freedom [5] and loop-freedom [2,11,16].We make the following technical contributions:

1. We present a non-trivial proof that deciding whether a consistent networkupdate schedule exists is NP-hard, already for 2 flows.

2. We prove that the problem is even NP-hard on loop-free networks, i.e., onDAGs, for general k.

3. We present a deterministic and polynomial-time algorithm for updatingk = 2 flows on DAGs, whenever a feasible schedule exists. The algorithmis based on a decomposition of the flow graph into so-called blocks. Usingthese blocks, we introduce a dependency graph on which an optimal flowmigration schedule can be found efficiently.

4. For constant k > 2, the block decomposition of the flow graph is still useful,however, a weaker dependency graph is described. Based on this dependencygraph, we present an elegant linear-time algorithm which solves the problemin time and space 2O(k log k)O(|G|).

2 Model and Preliminaries

We assume basic familiarity with directed graphs and we refer the reader to [4]for further reading. For a set of integers 1, . . . , k, we will write [k]. We denote adirected edge e with head v and tail u as e = (u, v). For an undirected edge ebetween vertices u, v, we write e = {u, v}; u, v are called endpoints of e.

We are given a flow network : a directed capacitated graph G = (s, t, V, E, c),where s is the source, t the terminal, V is the set of vertices with s, t ∈ V ,

Page 3: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 3

11

12

01

01

11

12

11

11

b1 b2

r1

11

11

12

01

01

11

12

11

01

12

11

01

11

22

11

11

22

11

01

01

12

01

11

12

11

11

01

12

11

s t

u v

w

s t

u v

w

s t

u v

w

s t

u v

w

s t

u v

w

s t

u v

w

initial network G

b2→r1→b1

block dependency prepare blocks

update b1 update r1 update b2

Fig. 1. Example: The congestion-free flow update problem for k = 2 (s, t)-flows, redand blue, each of demand 1. Each of the two flows is initially routed along a simplepath (indicated as a solid line of the respective color), and needs to be migrated toa (simple) update path (indicated as a dashed line of the respective color). Each edgein the flow graph is annotated with its current load (top) and its capacity (bottom).Note that the flow graph is a DAG. To reroute the flows from their old to their newpaths in a congestion-free manner, the forwarding rules (i.e., the out-edges) of the twoflows at the different nodes need to be scheduled carefully. In particular, as links (s, w)and (v, t) are of capacity 1 and initially saturated, an update dependency is introduced.This dependency can be expressed in terms of flow blocks: we can decompose the red(resp. the blue) flow into red (resp. blue) blocks where the old and the new flow meet.In our case, there is one red block r1 (the old and the new path only meet at t again)and two blue blocks b1 and b2 (the old and the new flow first meet at w and then againat t). We observe that b2 can only be updated after r1 has been updated; similarly,r1 can only be updated after b1 has been updated. An update scheduling respectingthese dependencies can be constructed as follows. We can first prepare the blocks byupdating the following two out-edges which currently do not carry any flow (we use thenotation (vi, col) to denote an update of the rule of color “col” at node vi): (w, red),(u, blue), and (v, blue). Subsequently, the three blocks can be updated in a congetion-free manner in the following order: Prepare the update for all blocks in the first round.Then, update b1 in the second round, r1 in the third round, b2 in the fourth round.

E ⊆ V × V is a set of ordered pairs known as edges, and c : E → N a capacityfunction assigning a capacity c(e) to every edge e ∈ E.

Page 4: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

4 S.A. Amiri et al.

An (s, t)-flow F of capacity d ∈ N is a directed path from s to t in a flownetwork such that d ≤ c(e) for all e ∈ E(F ).1 Given a family F of (s, t)-flowsF1, . . . , Fk with demands d1, . . . , dk respectively, we call F a valid network flow,or simply valid, if c(e) ≥

i : e∈E(Fi)di.

An update flow pair F = (F o, Fu, αF , d) consists of two (s, t)-flows F o, theold flow, and Fu, the update (or new) flow, each of demand d and coming withan activation label αF : the label indicates whether a given edge of E(F o ∪ Fu)is active or inactive.

Given any update flow pair F = (F o, Fu, αF ) with activation la-bel αF and demand d, we define the graph αF (F ) = (V (F o ∪Fu), {e ∈ E(F o ∪ Fu) | e is active}). The flow pair F is called transient, if αF (F )contains a unique (s, t)-flow UF . If there is a family F = {F1, . . . Fk} of updateflow pairs with demands d1, . . . , dk respectively, we call F a transient networkflow, iff. the family {UF1 , . . . , UFk

} is valid.An update flow network now is a graph G = (s, t, V, E,F , c), where

(s, t, V, E, c) is a flow network, and F = {F1, . . . , Fk} with Fi = (F oi , F

ui , αFi

, di)a family of update flow pairs, V =

i∈[k] V (F oi ∪F

ui ) and E =

i∈[k] E(F oi ∪F

ui ).

We call G initial, if all edges of F oi are active and all edges of Fu

i that do notbelong to F o

i , are inactive for all i ∈ [k]. Similarly an update flow network Gis called complete, if all edges of Fu

i are active, and all edges of F oi that do not

belong to Fui , are inactive for all i ∈ [k].

Updating Flows: Given an update flow network G = (s, t, V, E,F , c), an up-date is a tuple µ = (v, Fi) ∈ V ×F : the update is resolved by activating all edgese of Fu

i −F oi that have v as a tail, hence setting αFi

(e) to active, and deactivat-ing all e′ ∈ F o − Fu that have v as a tail. An update sequence ρ = (ρ1, . . . , ρℓ)is a partition of V × F into sets ρi, i ∈ [ℓ], such that the graph G0 is an initialupdate flow network, the graph Gi, i ∈ [ℓ] is an update flow network obtainedfrom G0 by resolving all updates in

j≤i ρi, and Gℓ is complete.We call ρi, i ∈ [ℓ], a round. Given an update sequence ρ, we denote the round

in which some update (v, F ) ∈ V × F is resolved by ρ(v, F ). Since the roundsare totally ordered, we will slightly abuse the notation and refer to rounds bytheir indices. An update sequence ρ is valid, or feasible, if every round ρi obeysthe following consistency rule:

Consistency Rule: Given S ⊆ ρi, let FSi be the family of update flow pairs

of the update flow network GSi , which is obtained from Gi−1 by resolving all

updates in S. We require that for any S ⊆ ρi, the family{

UF | F ∈ FSi

}

is atransient network flow.

Note that while succinct, this consistency rule models and consolidates thefundamental properties usually studied in the literature, such as congestion-freedom [5] and loop-freedom [16].

Note that we do not forbid edges e ∈ E(F oi ∩ Fu

i ) and we never activateor deactivate such an edge. Starting with an initial update flow network these

1 The assumption that flows have the same s and t is for ease of presentation andcomes with no loss of generality.

Page 5: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 5

edges will be active and remain so until all updates are resolved. Hence thereare vertices v ∈ V with either no outgoing edge for a given flow pair F at all, orit has an outgoing edge, but this edge is used by both the old and the updateflow of F . We will call such updates (v, F ) empty.

Empty updates do not have any impact on the actual problem since theynever change any transient flow. Hence they can always be scheduled in the firstround and thus w.l.o.g. we can ignore them in the following.

We can now define the k-network flow update problem: Given an initial-ized update flow network G with k update flow pairs, is there a feasible updatesequence ρ? The corresponding optimization problem is: What is the minimumℓ such that there exists a valid update sequence ρ using exactly ℓ rounds?

We conclude this section by introducing some more preliminaries. Let G =(s, t, V, E,F , c) be an acyclic update flow network, i.e., we assume that the graph(V,E) is acyclic. Let ≺ be a topological order on the vertices V = {v1, . . . , vn}.Let Fi = (F o

i , Fui , αFi

, d) be an update flow pair and let vi1, . . . , viℓoibe the induced

topological order on the vertices of F oi ; analogously, let u

i1, . . . , v

iℓuibe the order

on Fui . Furthermore, let V (F o

i )∩V (Fui ) =

{

zi1, . . . , ziki

}

be ordered by ≺ as well.

The subgraph of F oi ∪Fu

i induced by the set{

v ∈ V (F oi ∪ Fu

i ) | zij ≺ v ≺ zij+1

}

,j ∈ [ki − 1], is called the jth block of the update flow pair Fi, or simply the jthi-block. We will denote this block by bij.

For a block b, we define S (b) to be the start of the block, i.e., the smallestvertex w.r.t. ≺; similarly, E (b) is the end of the block : the largest vertex w.r.t. ≺.

Let G = (s, t, V, E,F , c) be an update flow network with F = {F1, . . . , Fk}and let B be the set of its blocks. We define a binary relation < between twoblocks as follows. For two blocks b1, b2 ∈ B, where b1 is an i-block and b2 aj-block, i, j ∈ [k], we say b1 < b2 (b1 is smaller than b2) if one of the followingholds.

i S (b1) ≺ S (b2),ii if S (b1) = S (b2) then b1 < b2, if E (b1) ≺ E (b2),iii if S (b1) = S (b2) and E (b1) = E (b2) then b1 < b2, if i < j.

Let b be an i-block and Fi the corresponding update flow pair. For a feasibleupdate sequence ρ, we will denote the round ρ(S (b), Fi) by ρ(b). We say thati-block b is updated, if all edges in b∩ Fu

i are active and all edges in b ∩F oi \ Fu

i

are inactive.

3 NP-Hardness of 2-Flow Update in General Graphs

It is easy to see that for an update flow network with a single flow pair, feasibilityis guaranteed.

Theorem 1. The 2-flow network update problem is NP-hard.

The proof is by reduction from 3-SAT. In what follows let C be any 3-SAT for-mula with n variables and m clauses. We will denote the variables as X1, . . . , Xn

Page 6: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

6 S.A. Amiri et al.

and the clauses as C1, . . . , Cm. The resulting update flow network will be de-noted as G(C). Furthermore, we will assume that the variables are ordered bytheir indices and their appearance in each clause respects this order.

We will create 2 update flow pairs, a blue one B = (Bo, Bu, αB, 1) and ared one R = (Ro, Ru, αR, 1). The pair B will contain gadgets corresponding tothe variables. The order in which the edges of each of those gadgets are updatedwill correspond to assigning a value to the variable. The pair R on the otherhand will contain gadgets representing the clauses: they will have edges that are“blocked” by the variable edges of B. Therefore, we will need to update B toenable the updates of R.

We proceed by giving a precise construction of the update flow networkG(C). In the following, the capacities of all edges will be 1. Since we are workingwith just two flows and each of those flows contains many gadgets, we give theconstruction of the two update flow pairs in terms of their gadgets.

1. Clause Gadgets: For every i ∈ [m], we introduce eight verticesui1, u

i2, . . . , u

i8 corresponding to the clause Ci. The edges (ui

j , uij+1) with

j ∈ [7] are added to Ro while the edges (uij′ , u

ij′+5) for j′ ∈ {1, 2, 3} and

(uij′ , u

ij′−4) for j

′ ∈ {6, 7} are added to Ru.

2. Variable Gadgets: For every j ∈ [n], we introduce four vertices: vj1, . . . , vj4.

Let Pj ={

pj1, . . . , pjkj

}

denote the set of indices of the clauses containing the

literal xj and P j ={

pj1, . . . , pj

k′

j

}

the set of indices of the clauses containing

the literal xj . Furthermore, let π(i, j) denote the position of xj in the clauseCi, i ∈ Pj . Similarly, π(i′, j) denotes the position of xj in Ci′ where i′ ∈ P j .To Bo we now add the following edges for every j ∈ [n]:

i) (uiπ(i,j), u

iπ(i,j)+5), for i ∈ Pj (these edges are shared with Ru),

ii) (uiπ(i,j)+5, u

iπ(i+1,j)), for i ∈ Pj , i 6= pjkj

,

iii) (vj1, upj1

π(pj1,j)

) and (upj

kj

π(pj

kj,j)+5

, vj2),

iv) (uiπ(i,j), u

iπ(i,j)+5), for i ∈ P j ,

v) (upji

π(pji,j)+5

, upji+1

π(pji+1,j)

), for i ∈ [|P j | − 1],

vi) (vj3, upj1

π(pj1,j)

) and (upj

kj

π(pj

kj,j)+5

, vj4), and

vii) (vj2, vj3).

On the other hand, Bu will contain the edges (vj1, vj3), (v

j3, v

j2) and (vj2, v

j4).

3. Blocking Edges: The goal is to block the updates (vj3, B) for every j ∈ [n]until all clauses are satisfied. To do this, we introduce 4 additional verticesw1, w2, z1 and z2. Then for Ro, we introduce the following edges:

i) (vj3, vj2) for j ∈ [n],

ii) (vj2, vj+13 ) for j ∈ [n− 1], and

iii) (z1, vj3) and (vn2 , z2),

Page 7: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 7

ui1 ui

2 ui3 ui

4 ui5 ui

6 ui7 ui

8vj1 v

j2 v

j3 v

j4u

pj1

1 upj1

6 upjkj

1 upjkj

6upj1

1 upj1

6 upj

kj

1 upj

kj

6

vj−14 v

j+11ui−1

8 ui+11

Fig. 2. Examples: A clause gadget is shown in red, the Ro edges are depicted as a solidline, and the dashed lines belong to Ru. The variable gadget is shown in blue. Again,solid lines indicate the old flow and dashed lines the update flow.

while Ru contains the edges (z1), (w1, w2) and (w2, z2).In a similar fashion, Bo contains the edge (w1, w2). For Bu, we introducethe following edges:i) (ui

4, ui5) for i ∈ [m],

ii) (ui5, u

i+14 ) for i ∈ [m− 1], and

iii) (w1, u14) and (um

5 , w2).

s

z1 w1 w2 z2

u14

u15 u2

4 u25 um

4

um5

v13 v12 v23 v22 vn3 vn2

Fig. 3. The gadget for blocking the update (vj3, B) for all j ∈ [n]. Again dashed edgescorrespond to the update flows and solid ones to the old flows.

4. Source and Terminal. Finally, to complete the graph, we introduce asource s and a terminal t.For both, Ro and Ru we introduce the following edges:i) (s, z1) and (z2, u

11),

ii) (ui8, u

i+11 ) for i ∈ [m− 1], and

iii) (um8 , t).

And for Bo and Bu we complete the flows with the following edges:i) (s, w1) and (w2, v

11),

ii) (vj4, vj+11 ) for j ∈ [n− 1], and

iii) (vn4 , t).

Lemma 1. Given any valid update sequence ρ for the above constructed updateflow network G(C), the following conditions hold for every round r < ρ(w1, B).

Page 8: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

8 S.A. Amiri et al.

1. r < ρ(z1, R)2. For any j ∈ [n], vj1 is a vertex of the transient network flow UB and

ρ(vj3, B) > r.3. Let j ∈ [n], then Pj and P j are the index sets of the clauses containing the

corresponding literals xj and xj. Then UB contains all edges of the form(ui

π(i,j), uiπ(i,j)+5) for i ∈ Pi, or all the edges (ui

π(i,j), uiπ(i,j)+5) for i ∈ P j (or

both).4. The vertex z1 and the ui

1, for all i ∈ [m], are contained in UR.

Proof. 1. Suppose ρ(z1, R) ≤ r, then there is a set of updates S ⊆ ρρ(w1,B) suchthat (w1, B) is not resolved in GS

ρ(w1,B), but (z1, R) is. If (w1, R) ∈ S, UR

and UB pass through (w1, w2) violating the capacity of 1, otherwise there isno path UR in GS

ρ(w1,B).

2. The first assertion is trivially true, since the edges (w2, v11) and (vj4, v

j+11 ) for

j ∈ [n− 1] belong to both Bo and Bu, hence UB has to always contain theseedges. From Property 1 we know, that UR has to contain the z1-z2-subpathof Ro and thus UR fills the capacity of the edges (vj3, v

j2) for all j ∈ [n]: hence

resolving (vj3, B) for all j ∈ [n] is impossible.

3. Let j ∈ [n]. By Property 2, vj1 is contained in UB, but ρ(vj3, B) > r. Hence,

if ρ(vj1, B) ≤ r, then UB traverses directly from vj1 to vj3 and then follows

along Bo to v4. Otherwise it follows along Bo from vj1 to vj3. In both caseswe are done.

4. This is again trivially true, since the edges (s, z1) and (ui8, u

i+11 ) for i ∈ [m−1]

are contained in both Ro and Ru: thus they always have to be part of UR.⊓⊔

Proof (Proof of Theorem 1). Now we are ready to finish the proof of Theorem 1.First we will show that if C is satisfiable, then there is a feasible order of updatesfor G(C).

Let σ be an assignment satisfying C. Then the update order for G(C) is asfollows (each item marks a round):

1. For each j ∈ [n], if σ(Xj) = 1 then update vj1. Otherwise update vj2.2. For each i ∈ [m], at least one of edges (ui

1, ui6), (u

i2, u

i7), (u

i3, u

i8) is no longer

used by UB. Therefore the corresponding update of R can be resolved (thisfollows from σ being a satisfying assignment).

3. For each i ∈ [m], (ui4, u

i5) is no longer used by UR. Therefore we can resolve

to blue updates along the w1-w2-subpath of Bu excluding (w1, B).4. Resolve (w1, B).5. Resolve (w1, R) and (w2, R). (Note that now all conflicts between B and R

have been resolved and we can finish the updates. We will now leave thestate described in Lemma 1.)

6. Resolve (z1, R).7. For each j ∈ [n], vjk has already been updated for exactly one k ∈ {1, 2}. If

k = 1, resolve all updates of B along the upj1

1 -upj

kj

6 -subpath of Bo together

Page 9: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 9

with (vj2, B). Otherwise resolve (vj3, B) together with all updates of B along

the upj1

1 -upj

kj

6 -subpath of Bo.8. Resolve the remaining updates of B.9. Resolve all updates of R along the v13-v

n2 -subpath of Ro and for each i ∈ [m]

resolve (ui1, R), (ui

2, R) and (ui3, R).

10. Resolve the remaining updates of R.

Now let us assume that there is a feasible update sequence ρ for G(C). Wewill show that C is satisfiable by constructing assignment σ.

Let us consider the rounds r < min {ρ(w1, R), ρ(w1, B)}. Then we will useCondition 3 of Lemma 1 to assign values to variables in the following way. Letj ∈ [n], if UB does not use the edges (uh

π(h,j), uhπ(h,j)+5) for all h ∈ Pj (or

equivalently if vj1 is updated) we set σ(Xj) := 1. Otherwise we set σ(x) := 0.Now we will show that assignment σ satisfies C. First let us notice that

because we can resolve (w1, B), none of edges (ui4, u

i5), for any i ∈ [m], can be

used by UB in ρ(w1, B). Hence, from Condition 4 of Lemma 1, we know that allvertices ui

1, for any i ∈ [n], and the vertex z1, are contained in UR.Let us consider any clause Ci, i ∈ [m]. The transient network flow UR cannot

go from ui1 to ui+1

1 along Ro: this would mean that edge (ui4, u

i5) cannot be used

by UB. Therefore, for at least one of the edges (ui1, u

i6), (u

i2, u

i7) and (ui

3, ui8), the

corresponding blue update has already been resolved. This implies that thereis some variable Xj , j ∈ [n], that appears in Ci, such that, in the gadget for

Xj , UB skips uih, for some h ∈ {1, 2, 3}. This vertex is between vj1 and vj2, if Ci

contains literal xj . In that case, we set σ(Xj) := 1, so Ci is satisfied. OtherwiseCi contains literal xj and we assign σ(Xj) := 0, so Ci is also satisfied. ⊓⊔

4 Optimal Solution for k = 2 Flows

As we have seen in the previous section, even the 2-flow update problem is com-putationally hard on general graphs. However, we will now show that an elegantpolynomial-time solution exists for the more restricted class of Directed AcyclicGraphs (DAGs). Our algorithm is based on a dependency-graph approach, andnot only finds a feasible, but also a shortest schedule (minimum number ofrounds).

In the following, let G = (s, t, V, E,F , c) be an update flow network where(V,E) forms a DAG and F = {B,R} are the two update flow pairs withB = (Bo, Bu, αB, dB) and R = (Ro, Ru, αR, dR). As in the previous section,we identify B with blue and R with red.

We say that an I-block b1 is dependent on a J-block b2, I, J ∈ {B,R}, I 6= J ,if there is an edge e ∈ (E(b1) ∩ E(Iu)) ∩ (E(b2) ∩ E(Jo)), but c(e) < dI + dJ .In fact, to update b1, we either violate the capacity condition, or we update b2first in order to prevent congestion. In this case we write b1 → b2 and say thatb1 requires b2.

We say a block b is a free block, if it is not dependent on any other block. Adependency graph of G is a graphD = (VD, ED) for which there exists a bijective

Page 10: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

10 S.A. Amiri et al.

mapping µ : V (D) ↔ B(G), and there is an edge (vb, vb′) in D if b → b′. Clearly,a block b is free if and only if it corresponds to a sink in D.

We propose the following algorithm to check the feasibility of the flow rerout-ing problem.

Algorithm 1. Feasible 2-Flow DAG Update

Input: Update Flow Network G

1. Compute the dependency graph D of G.

2. If there is a cycle in D, return impossible to update.

3. While D 6= ∅ repeat:

i Update all blocks which correspond to the sink vertices of D as inAlgorithm 2.

ii Delete all of the current sink vertices from D.

Recall that empty updates can always be scheduled in the first round, evenif it is not possible to update an update flow network at all. So for Algorithm1 and all following algorithms we simply assume these updates to be scheduledtogether with the non-empty updates of round 1.

Suppose ρ is a feasible update sequence for G.

We say a c-block b w.r.t. ρ = (ρ1, . . . , ρℓ) is updated in consecutive rounds, ifthe following holds: if some of the edges of b are activated/deactivated in roundi and some others in round j, then for every i < k < j, there is an edge of bwhich is activated/deactivated.

We update free blocks as follows:

Algorithm 2. Update a Free i-Block b

1. Resolve (v, Fi) for all v ∈ Fui ∩ b− S (b).

2. Resolve (S (b), Fi).

3. Resolve (v, Fi) for all v ∈ (b− Fui ).

Lemma 2. Let b be a c-block. Then in a feasible update sequence ρ, all vertices(resp. their outgoing c flow edges) in Fu

c ∩ b − S (b) are updated strictly beforeS (b). Moreover, all vertices in b−Fu

c are updated strictly after S (b) is updated.

Proof. In the following, we will implicitly assume flow c, and will not mention itexplicitly everywhere.We will write Fu

b for Fuc ∩b and F o

b for F oc ∩b. For the sake of

contradiction, let U = {v ∈ V (G) | tail(v) 6= S (b), v ∈ Fub −F o

b −S (b), ρ(v, c) >ρ(S (b), c)}. Moreover, let v be the vertex of U which is updated the latest andρ(v, c) = maxu∈U ρ(u, c). By our condition, the update of v enables a transientflow along edges in Fu

c ∩ b. Hence, there now exists an (s, t)-flow through b usingonly update edges.

Page 11: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 11

No vertex in F1 = F ob − (Fu

b − S (b)) could have been updated before, orsimultaneously with v: otherwise, between the time u has been updated andbefore the update of v, there would not exist a transient flow. But once weupdate v, there is a c-flow which traverses the vertices in F o

b − Fub , and another

c-flow which traverses v 6∈ F1: a contradiction. Note that F1 6= ∅. The otherdirection is obvious: updating any vertex in (F o

c ∩ b)−Fuc inhibits any transient

flow. ⊓⊔

Lemma 3. Consider G and assume a feasible update sequence ρ. Then thereexists a feasible update sequence ρ′ which updates every block in at most 3 con-secutive rounds.

Proof. Let ρ be a feasible update sequence with a minimum number of blocksthat are not updated in 3 consecutive rounds. Furthermore let b be such a c-block. Let i be the round in which S (b) is updated. Then by Lemma 2, all othervertices of Fu

c ∩ b have been updated in the previous rounds. Moreover, sincethey do not carry any flow during these rounds, the edges can all be updated inround i− 1. By our assumption, we can update S (b) in round i, and hence nowthis is still possible.

As S (b) is updated in round i, the edges of F oc ∩ b do not carry any active

c-flow in round i + 1 and thus we can deactivate all remaining such edges inthis round. This is a contradiction to the choice of ρ, and hence there is alwaysa feasible sequence ρ satisfying the requirements of the lemma. In particular,Algorithm 2 is correct. ⊓⊔

From the above two lemmas, we immediately derive a corollary regardingthe optimality in terms of the number of rounds: the 3 rounds feasible updatesequence.

Corollary 1. Let b be any c-block with |E(b ∩ F oc )| ≥ 2 and |E(b ∩ Fu

c )| ≥ 2.Then it is not possible to update b in less than 3 rounds: otherwise it is notpossible to update b in less than 2 rounds.

Next we show that if there is a cycle in the dependency graph, then it isimpossible to update any flow.

Lemma 4. If there is a cycle in the dependency graph, then there is no feasibleupdate sequence.

Proof. A cycle of length 2 in the dependency graph means that there is a c1-block b1 and a c2-block b2 whose updates mutually depend on each other: Ifthere was a feasible update sequence, then according to Lemma 3 there wouldexist a feasible update sequence which either updates b1 and then b2 (or viceversa), or which updates them simultaneously. However, this is not possible dueto the mutual dependency.

On the other hand, the dependency graph is bipartite. Therefore, every cycleof length more than two has length at least 4. So suppose that there exists a

Page 12: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

12 S.A. Amiri et al.

cycle C = b1, b2, . . . , b2ℓ−1, b2ℓ whose vertices correspond to blocks of the corre-sponding name: blocks of odd indices belong to the c-flow and blocks of evenindices belong to the c′-flow. Suppose that bc1 is the smallest block of the c-flowin C. There are two cases:

1. b2 ≤ b2ℓ2. b2ℓ ≤ b2

First suppose b2 < b2ℓ, and therefore E (b2) ≤ S (b2ℓ). As b2 requires b3, wehave S (b3) < E (b2). However, as b1 was the smallest c-block in C, we haveE (()b1) ≤ S (b3) < E (b2) or E (b1) < E (b2). On the other hand, b2h requires b1,and therefore S (b2h) < E (b1). But then S (b2h) < E (b2): a contradiction to ourassumption.

Therefore, if there is a feasible update sequence, then b2ℓ < b2. Moreover,b2ℓ−1 → b2ℓ so E (b1) ≤ S (b2ℓ−1) < E (b2ℓ) ≤ S (b2) and hence E (b1) < S (b2).But b1 → b2 and therefore S (b2) < E (b1): a contradiction. So there cannot bea cycle of length at least 4 in the dependency graph. ⊓⊔

We will now slightly alternate Algorithm 1 in order to create a new algorithmwhich will compute a feasible sequence ρ for a given update flow network inpolynomial time and which ensures that ρ uses the minimum number of rounds.For any block b let c(b) denote its corresponding flow pair.

Algorithm 3. Optimal 2-Flow DAG Update

Input: Update Flow Network G

1. Compute the dependency graph D of G.

2. If there is a cycle in D, return impossible to update.

3. If there is any block b corresponding to a sink vertex of D with (b ∩Fuc(b))− S (b) 6= ∅ set i := 2, otherwise set i := 1.

4. While D 6= ∅ repeat:i Schedule the update of all blocks b which correspond to the sinkvertices of D as in Algorithm 2 for the rounds i − 1, i, i + 1, suchthat S (b) is updated in round i.

ii Delete all of the current sink vertices from D.

iii Set i := i+ 1.

Theorem 2. An optimal (feasible) update sequence on acyclic update flow net-works with exactly 2 update flow pairs can be found in linear time.

Proof. Let G denote the given update flow network. In the following, for easeof presentation, we will slightly abuse terminology and say that “a block isupdated in some round”, meaning that the block is updated in the correspondingconsecutive rounds by Algorithm 2.

Page 13: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 13

We proceed as follows. First, we find a block decomposition and create thedependency graph of the input instance. This takes linear time only. If there isa cycle in that graph, we output impossible (cf. Lemma 4). Otherwise, we applyAlgorithm 3. As there is no cycle in the dependency graph (a property that staysinvariant), in each round, either there exists a free block which is not processedyet, or everything is already updated or is in process of update. Hence, if thereis a feasible solution (it may not be unique), we can find one in time O(|G|).

For the optimality in terms of the number of rounds, consider two feasibleupdate sequences. Let ρAlg be the update sequence produced by Algorithm 3and let ρOpt be a feasible update sequence that realizes the minimum numberof rounds. According to Lemma 2, any block b is processed only in round S (b).

Suppose there is a block b′ such that ρOpt(b′) < ρAlg(b

′). Then let bbe the block with the smallest such ρOpt(b). Hence, for every block b′′ withρOpt(b

′′) ≤ ρOpt(b), ρOpt(b′′) ≥ ρAlg(b

′′) holds. Since S (b) is updated in roundρOpt(b), there are no dependencies for b that are still in place in this round.Thus, according to the sequence ρOpt, b is a sink vertex of the dependency graphafter round ρOpt(b) − 1. Furthermore, by our previous observation, every startof some block that has been updated up to this round in the optimal sequence,and hence it is also already updated in the same round in ρAlg. This means thatafter round ρOpt(b)− 1 < ρAlg(b)− 1, b is a sink vertex of the dependency graphof ρAlg as well. Thus, Algorithm 3 would have scheduled the update of block bin the rounds ρOpt(b)− 1, ρOpt(b) and ρOpt(b) + 1. Contradiction.

Thus ρAlg(b) ≤ ρOpt(b) for all blocks b. Now let b1, . . . , bℓ be the last blockswhose starts are updated the latest under ρAlg. If there is some i ∈ [ℓ] suchthat

∣Eobi

∣ ≥ 2 and∣

∣Eubi

∣ ≥ 2, ρAlg uses exactly ρAlg(bi) + 1 rounds; otherwiseit is one round less, by Corollary 1. By our previous observation, none of theseblocks can start later than ρAlg(bi) and thus ρOpt uses at least as many roundsas Algorithm 3. Hence the algorithm is optimal in the number of rounds. ⊓⊔

5 Updating k-Flows in DAGs is NP-complete

In this section we show that if the number of flows, k, is part of the input, theproblem remains hard even on DAGs. In fact, we prove the following theorem.

Theorem 3. Finding a feasible update sequence for k-flows is NP-complete,even if the update graph G is acyclic.

To prove the theorem, we provide a polynomial time reduction from the 3-SAT problem. Let C = C1 ∧ . . . ∧ Cm be an instance of 3-SAT with n variablesX1, . . . , Xn, where each variable Xi appears positive (xi) or negative (xi) insome clause Cj .

We construct an acyclic network update graph G such that there is a feasiblesequence of updates ρ for G, if and only if C is satisfiable by some variableassignment σ. By Lemma 3, we know that if G has a feasible update sequence,then there is a feasible update sequence which updates each block in consecutiverounds.

Page 14: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

14 S.A. Amiri et al.

In the following, we denote the first vertex of a directed path p with head(p)and the end vertex with tail(p). Furthermore, we number the vertices of a path pwith numbers 1, . . . , |V (p)|, according to their order of appearence in p (head(p)is number 1). We will write p(i) to denote the i’th vertex in p.

We now describe how to construct the initial update flow network G.

1. G has a start vertex s and a terminal vertex t.2. We define n variable selector flow pairs S1, . . . , Sn, where each Si =

(Soi , S

ui , αSi

, 1) defined as follows:(a) Variable Selector Old Flows are n s, t-flows So

1 , . . . , Son defined as

follows: Each consists of a directed path of length 3, where every edge inpath So

i (for i ∈ [n]) has capacity 1, except for the edge (Soi (2), S

oi (3)),

which has capacity 2.(b) Variable Selector Update Flows are n s, t-flows Su

1 , . . . , Sun de-

fined as follows: Each consists of a directed path of length 5, where theedge’s capacity of path Su

i is set as follows. (Sui (2), S

ui (3)) has capcity 2,

(Sui (4), S

ui (5)) has capacity m, and the rest of its edges has capacity 1.

3. We define m clause flow pairs C1, . . . , Cn, where each Ci = (Coi , C

ui , αCi

, 1)is defined as follows.

(a) Clauses Old Flows arem s, t-flows Co1 , . . . , C

om, each of length 5, where

for i, j ∈ [m], Coi (3) = Co

j (3) and Coi (4) = Co

j (4). Otherwise they aredisjoint from the above defined. The edge (Co

i (3), Coi (4)) (for i ∈ [m])

has capacity m, all other edges in Coi have capacity 1.

(b) Clauses Update Flows are m s, t-flows Cu1 , . . . , C

um, each of length 3.

Every edge in those paths has capacity 3.

4. We define a Clause Validator flow pair V = (V o, V u, αV ,m), defined asfollows.(a) Clause Validator Old Flow is an s, t-flow V o whose path consists of

edges (s, Su1 (4)), S

ui (4), S

ui (5)), (S

ui (5), S

ui+1(4)), (S

un(4), S

un(5)), (S

un(5), t)

for i ∈ [n−1]. Note that, the edge (Sui (4), S

ui (5)) (for i ∈ [n]) also belongs

to Sui . All edges of V have capacity m.

(b) Clause Validator Update Flow is an s, t-flow V u whose path haslength 3, such that V u(2) = Co

1 (3), Vu(3) = Co

1 (4). All new edges of V u

have capacity m.5. We define 2n literal flow pairs L1, . . . , L2n. Each Li = (Lo

i , Lui , αLi

, 1) isdefined as follows:

(a) Literal’s Old Flows are 2n s, t-flows Lo1, . . . , L

on and Lo

1, . . . , Lon. Sup-

pose xi appears in clauses Ci1 , . . . , Ciℓ , then the path Loi is a path of

length 2ℓ+ 5, where Loi (2j + 1) = Cu

ij(2), Lo

i (2j + 2) = Cuij(3) for j ∈ [ℓ]

and furthermore Loi (2ℓ + 3) = Su

i (2), Loi (2ℓ + 4) = Su

i (3). On the otherhand, if xi appears in clauses Ci1 , . . . , Ciℓ′

, then Loi is a path of length

2ℓ′ + 5 where Loi (2j + 3) = Cu

ij(, Lo

i (2j + 4) = Cuij(3) for j ∈ [ℓ′], and

furthermore Loi (2ℓ

′ + 3) = Sui (2), L

oi (2ℓ

′ + 4) = Sui (3). All new edges in

Loi (resp. Lo

i ) have capacity 3. Note that some of Loi s may share common

edges.

Page 15: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 15

(b) Literal’s Update Flows are 2n s, t-flows Lu1 , . . . , L

un and Lu

1 , . . . , Lun.

For i ∈ [n], Lui and Lu

i are paths of length 5 such that Lui (2) = Lu

i (2) =Soi (2) and Lu

i (3) = Lui (3) = So

i (3). All new edges in those paths havecapacity 3.

Note that G is acyclic and every flow pair in G forms a single block. Let ρbe a feasible update sequence of G. We suppose in ρ, every block is updated inconsecutive rounds (Lemma 2). For a single flow F , we write ρ(F ) for the roundwhere the last edge of F updated.

Lemma 5. For ρ and G, we have the following observations.

i) We either have ρ(Loi ) < ρ(So

i ) < ρ(Loi ), or ρ(Lo

i ) < ρ(Soi ) < ρ(Lo

i ), for alli ∈ [n] .

ii) ρ(Coi ) < ρ(V o) for all i ∈ [m].

iii) ρ(Soi ) < ρ(V o) for all i ∈ [n].

iv) For every i ∈ [m] there is some j ∈ [n] such that ρ(Coi ) < ρ(Lo

j) or ρ(Coi ) <

ρ(Loj).

v) We either have ρ(Loj) < ρ(Co

i ) < ρ(Loj), or ρ(Lo

j) < ρ(Coi ) < ρ(Lo

j), for alli ∈ [m] and all j ∈ [n].

Proof.

i) As the capacity of the edge e = (Soi (2), S

oi (3)) is 2, and both Lu

i , Lui use that

edge, before updating both of them, Soi (resp. Su

i ) should be updated. Onthe other hand, the edge e′ = (Su

i (2), Sui (3)) has capacity 2 and it is in both

Loi and Lo

i . So to update Soi , e

′ for one of the Loi , L

oi should be updated.

ii) The edge (V u(2), V u(3)) of V u also belongs to all Coi (for i ∈ [m]) and its

capacity is m. Moreover, the demand of (V o, V u) is m, so V o cannot beupdated unless Co

i has been updated for all i ∈ [m].iii) Every Su

i (i ∈ [n]) requires the edge (Sui (4), S

ui (5)), which is also used by

V o, until after round ρ(V o).iv) This is a consequence of Observation iii and Observation ii.v) This is a consequence of Observation iv and Observation i.

⊓⊔

Proof (Proof of Theorem 3). Given a sequence of updates, we can check if it isfeasible or not. The length of the update sequence is at most k times the size ofthe graph, hence, the problem clearly is in NP.

To show that the problem is complete for NP, we use a reduction from 3-SAT. Let C be as defined earlier in this section, and in polynomial time we canconstruct G.

By the construction of G, if there is a satisfying assignment σ for C, weobtain a sequence ρ to update the flows in G as follows. In the first round, ifin σ we have Xi = 1 for some i ∈ [n], update the literal flow Lo

i ; otherwiseupdate the literal flow Lo

i . σ satisfies C, therefore, for every clause Ci there issome literal flow Lj or Lj, which is already updated. Hence, for all i ∈ [m] the

Page 16: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

16 S.A. Amiri et al.

s t

Soi (2) So

i (3)

Lui (4) Lu

i (5)

Lu

i (4) Lu

i (5)

Cok(2)

Cok′

(2)

Cok(3) Co

k(4)

Cok′

(5)

Cok(5)

Cuh (3)

Cup (3)

Cuk (2) Cu

k (3)

Cuh′(2)

Cup′

(2)

Loi (2ℓ+ 2)

Loi (2ℓ + 2)

Sui (2) Su

i (3)

Loi (2ℓ+ 5)

Loi (2ℓ + 5)

Su1 (4) Su

i−1(5)

Sui (4) Su

i (5)

Sui+1(4)

2

2 m

m

3

Fig. 4. Gadget Construction for Hardness in DAGs: There are 4 types of flows:Clause flows, Literal flows, Clause Validator flow and Literal Selector flows. The edge(So

i (2), Soi (3)) cannot route 3 different flows So

i , Lui ,L

ui at the same time. On the other

hand the edge (Sui (2), S

ui (3)) cannot route the flow Su

i before updating either Loi or Lo

i ,hence by the above observation, exactly one of the Li or Li’s will be updated strictlybefore Si and the other will be updated strictly after Si was updated. Only after allClause flows are updated, the edge (Co

k(3), Cok(4)) can route the flow V (Clause Val-

idator flow). A Clause flow Ck can be updated only if at least one of the Literal flowswhich goes along (Cu

k (2), Cuk (3)) is updated. So in each clause, there should be a valid

literal. On the other hand the Clause validator flow can be updated only if all ClauseSelector flows are updated, this is guaranteed by the edge (Su

i (4), Sui (5)). Hence, before

updating all clauses, we are allowed to update at most one of the Li or Li’s, and thiscorresponds to a valid satisfying assignment.

edge (Cui (3), C

ui (4)) incurs a load of 2 while its capacity is 3. Therefore, we can

update all of the clause flows and afterward the clause validator flow V o. Next,

Page 17: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 17

we can update the clause selector flows and at the end, we update the remaininghalf of the literal flows.

On the other hand, if there is a valid update sequence ρ for flows in G, byLemma 5 Observation v, there are exactly n literal flows that have to be updated,before we can update Co

i . To be more precise, for every j ∈ [n], either Loj , or

Loj has to be updated, but never both. If Lo

j is one of those first n literal flows

to be updated for some j ∈ [n], we set Xj := 1; otherwise Loj is to be updated

and we set Xj := 0. Since these choices are guaranteed to be unique for everyj ∈ [n], this gives us an assignment σ. After these n literal flows are updated,we are able to update the clause flows, since ρ is a valid update sequence. Thismeans in particular, that for every clause Ci, i ∈ [m], there is at least one literalwhich is set to true. Hence σ satisfies C and therefore solving the network updateproblem on DAGs, is as hard as solving the 3-SAT problem. ⊓⊔

6 Linear Time Algorithm for Constant Number of Flows

on DAGs

We have seen that for an arbitrary number of flows, the problem is hard evenon DAGs. In this section, we show that if the number of flows is a constant k,then a solution can be computed in linear time. More precisely, we describe analgorithm to solve the network update problem on DAGs in time 2O(k log k)O(|G|),for arbitrary k. In the remainder of this section, we assume that every block hasat least 3 vertices (otherwise, postponing such block updates will not affect thesolution).

We say a block b1 touches a block b2 (denoted by b1 ≻ b2) if there is a vertexv ∈ b1 such that S (b2) ≺ v ≺ E (b2), or there is a vertex u ∈ b2 such thatS (b1) ≺ v ≺ E (b1). If b1 does not touch b2, we write b1 6≻ b2. Clearly, therelation is symmetric, i.e., if b1 ≻ b2 then b2 ≻ b1.

For some intuition, consider a drawing of G which orders vertices w.r.t. ≺ ina line. Project every edge on that line as well. Then two blocks touch each otherif they have a common segment on that projection.Algorithm and Proof Sketch: Before delving into details, we provide the mainideas behind our algorithm. We can think about the update problem on DAGsas follows. Our goal is to compute a feasible update order for the (out-)edges ofthe graph. There are at most k flows to be updated for each edge, resulting ink! possible orders and hence a brute force complexity of O((k!)|G|) for the entireproblem. We can reduce this complexity by considering blocks instead of edges.Let TouchSeq(b) contain all feasible update sequences for the blocks that touchb: still a (too) large number, but let us consider them for now. For two distinctblocks b, b′, we say that two sequences s ∈ TouchSeq(b), s′ ∈ TouchSeq(b′) areconsistent, if the order of any common pair of blocks is the same in both s, s′.It is clear that if for some block b, TouchSeq(b) = ∅, there is no feasible updatesequence for G: b cannot be updated.

We now create a graph H whose vertices correspond to elements ofTouchSeq(b), for all b ∈ B. Connect all pairs of vertices originating from the

Page 18: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

18 S.A. Amiri et al.

same TouchSeq(b). Connect all pairs of vertices if they correspond to inconsis-tent elements of different TouchSeq(b). If (and only if) we find an independentset of size |B| in the resulting graph, the update orders corresponding to thosevertices are mutually consistent: we can update the entire network according tothose orders. In other words, the update problem can be reduced to finding anindependent set in the graph H .

However, there are two main issues with this approach. First, H can be verylarge. A single TouchSeq(b) can have exponentially many elements. Accordingly,we observe that we can assume a slightly different perspective on our problem:we linearize the lists TouchSeq(b) and define them sequentially, bounding theirsize by a function of k (the number of flows). The second issue is that findinga maximum independent set in H is hard. The problem is equivalent to findinga clique in the complement of H , a |B|-partite graph where every partition hasbounded cardinality. We prove that for an n-partite graph where every partitionhas bounded cardinality, finding an n-clique is NP-complete. So, in order tosolve the problem, we either should reduce the number of partitions in H (butwe cannot) or modify H to some other graph, further reducing the complexityof the problem. We do the latter by trimming H and removing some extra edges,turning the graph into a very simple one: a graph of bounded path width. Then,by standard dynamic programming, we find the independent set of size |B| inthe trimmed version of H : this independent set matches the independent set Iof size |B| in H (if it exists). At the end, reconstructing a correct update ordersequence from I needs some effort. As we have reduced the size of TouchSeq(b)and while not all possible update orders of all blocks occur, we show that theysuffice to cover all possible feasible solutions. We provide a way to construct avalid update order accordingly. ⊓⊔

With these intuitions in mind, we now present a rigorous analysis. Let πS1 =(a1, . . . , aℓ1) and πS2 = (a′1, . . . , a

′ℓ2) be permutations of sets S1 and S2. We

define the core of πS1 and πS2 as core(πS1 , πS2) := S1 ∩ S2. We say that twopermutations π1 and π2 are consistent, π1 ≈ π2, if there is a permutation π ofsymbols of core(π1, π2) such that π is a subsequence of both π1 and π2.

The Weak Dependency Graph, simply called dependency graph in thefollowing, of a set of permutations is a labeled graph defined recursively as follows.The dependency graph of a single permutation π = (a1, . . . , aℓ), denoted by Gπ,is a directed path v1, . . . , vℓ, and the label of the vertex vi ∈ V (Gπ) is the elementa with π(a) = i. We denote by Labels(Gπ) the set of all labels of Gπ.

Let GΠ be a dependency graph of the set of permutations Π and GΠ′ thedependency graph of the set Π ′. Then, their union (by identifying the samevertices) forms the dependency graph GΠ∪Π′ of the set Π ∪Π ′. Note that sucha dependency graph is not necessarily acyclic.

We call a permutation π of blocks of a subset B′ ⊆ B congestion free, if thefollowing holds: it is possible to update the blocks in π in the graph GB (thegraph on the union of blocks in B), in order of their appearance in π, withoutviolating any edge capacities in GB . Note that we do not respect all conditionsof our Consistency Rule here.

Page 19: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 19

πblue = (v7, c, a, v2)πgreen = (v6, b, c, v1)πred = (v3, v4, a, b, v5)

G{πblue,πgreen ,πred}

ab

cv1

v2

v4 v3v5

v6

v7

Fig. 5. Example: The weak dependency graph of three pairwise consistent permutationsπblue, πgreen and πred. Each pair of those permutation has exactly one vertex in commonand with this the cycle (a, b, c) is created. With such cycles being possible a weakdependency graph does not necessarily contain sink vertices. To get rid of them, wecertainly need some more refinement.

Lemma 6. Let π be a permutation of the set B1 ⊆ B. Whether π is congestionfree can be determined in time O(|B1| · |G|).

Proof. In the order of π, perform Algorithm 2. If it fails, i.e., if it violates con-gestion freedom for some edges, π is not a congestion free permutation. ⊓⊔

The smaller relation defines a total order on all blocks in G. Let B ={b1, . . . , b|B|} and suppose the order is b1 < . . . < b|B|.

Construction of H: We recursively construct a labeled graph H from theblocks of G as follows.

i Set H := ∅, B′ := B, TouchList := ∅.ii For i := 1, . . . , |B| do

1 Let B′|B|−i+1 := {b′1, . . . , b

′t} be the set of blocks in B′ which touch b|B|−i+1.

2 Let π := {π1, . . . , πℓ} be the set of congestion free permutations ofB′

|B|−i+1.

3 Set TouchList(b) := ∅.4 For i ∈ [ℓ] create a vertex vπi

with Label(vπi) = πi and set TouchList(b) :=

TouchList(b) ∪ vπi.

5 Set H := H ∪ TouchList(b).6 Add edges between all pairs of vertices in H [TouchList(b)].7 Add an edge between every pair of vertices v ∈ H [TouchList(b)] and u ∈

V (H)− TouchList(b) if the labels of v and u are inconsistent.8 Set B′ := B′ − b|B|−i+1.

Lemma 7. For Item (ii1) of the construction of H, it holds that t ≤ k.

Proof. Suppose for the sake of contradiction that t is bigger than k. So there arec-blocks b, b′ (where b|B|−i+1 corresponds to a flow pair different from c) thattouch b|B|−i+1. But then one of S (b) or S (b′) is strictly larger than S (b|B|−i+1).This contradicts our choice of b|B|−i+1 in that we deleted larger blocks from B′

in Item (ii8). ⊓⊔

Page 20: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

20 S.A. Amiri et al.

. . . . . . . . .

VbiVbi+1 Vbj = TouchSeq(bj)

. . . . . . c . . . dd . . . cd . . . c a . . . bb . . . a. . . . . .

Fig. 6. Example: The graph H consists of vertex sets Vbi , i ∈ [|B|], where each suchpartition contains all congestion free sequences of the at most k iteratively chosentouching blocks. In the whole graph, we then create edges between the vertices of twosuch partitions if and only if the corresponding sequences are inconsistent with eachother, as seen in the three highlighted sequences. Later we will distinguish betweensuch edges connecting vertices of neighboring partitions (w.r.t. the topological orderof their corresponding blocks), Vbi and Vbi+1 , and partitions that are further away, Vbi

and Vbj . Edges of the latter type, depicted as red in the figure, are called long edgesand will be deleted in the trimming process of H .

Lemma 8. Let bj1 , bj2 , bj3 be three blocks (w.r.t. <) where j1 < j2 < j3. Let bzbe another block such that z /∈ {j1, j2, j3}. If in the process of constructing H, bzis in the touch list of both bj1 and bj3 , then it is also in the touch list of bj2 .

Proof. Let us suppose that S (bj1) 6= S (bj2) 6= S (bj3). We know that S (bz) ≺S (bj1) as otherwise, in the process of creating H , we eliminate bz before weprocess bj1 : it would hence not appear in the touch list of bj1 . As bz ≻ bj3 , thereis a vertex v ∈ bz where S (bj3) ≺ v. But by our choice of elimination order:S (bj2) ≺ S (bj3) ≺ v ≺ E (bz), and on the other hand: S (bz) ≺ S (bj1) ≺S (bj2). Thus, S (bz) ≺ S (bj2) ≺ E (bz), and therefore bz touches bj2 . If some ofthe start vertices are the same, a similar case distinction applies. ⊓⊔

For an illustration of the property described in Lemma 8, see Figure 7: itrefers to the weak dependency graph of Figure 5. This example also points outthe problem with directed cycles in the weak dependency graph and the propertyof Lemma 8. We will utilize this in the next lemma and it will be key to ouralgorithm.

Lemma 9. Let I = {vπ1 , . . . , vπℓ} be an independent set in H. Then the depen-

dency graph GΠ where Π = {π1, . . . , πℓ}, is acyclic.

Proof. Instead of working on GΠ , we can now work on a supergraph G+Π of GΠ ,

which is defined as follows. For each sequence πi, vπi∈ I, create a graph G+

πi

Page 21: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 21

πbblue

πbgreen

πbred

topological order

a

b

...

...

c

a

...

a

b

c

a

Fig. 7. Example: Select one of the permutations of length at most k from every Vb.These permutations obey Lemma 8. Taking the three permutations from the examplein Figure 5, we can see that the lemma forces a to be in the green permutation aswell. Assuming consistency, this would mean a to come before b and after c. Hencea <πgreen b and b <πgreen a, a contradiction. So if our permutations are derived fromH and are consistent, we will show that cycles cannot occur in their weak dependencygraph.

which is the transitive closure of Gπi. Then we take the union of all G+

πi’s (for

i ∈ [ℓ]) by identifying the vertices of the same label, to obtain G+Π . It is clear

that GΠ ⊆ G+Π . We prove that there is no cycle in G+

Π . By case analysis, it iseasy to verify that there is no cycle of length at most 3 in G+

Π . For the sake ofcontradiction, suppose G+

Π contains a cycle and let C = (a1, . . . , an) ⊆ G+Π be a

shortest cycle. We know n ≥ 4.

The vertices of each edge (ai, ai+1) ∈ C appear as a subsequence in a labelof a vertex v ∈ TouchList(bt)∩ I, for some bt ∈ B, in the same order as inducedby the directed edge. We call a subsequence (ai, ai+1) a representation of thecorresponding bt. There are n edges in C, and therefore there are at most n suchTouchList(bt)’s. We denote the union of their corresponding blocks with a setBI = {bI1, . . . , b

In}. As C is the shortest cycle and G+

Π is created on the transitiveclosure of each sequence, |BI | = n holds. In the following as we consider thecycle C, whenever we write any index i we consider it w.r.t. cyclic order (in facti mod |C|+ 1).

Suppose bI1 < bI2 < . . . < bIn, where (ai, ai+1) is a representative ofTouchList(bI1). Clearly (ai−1, ai) is a representative of bIj for some j ∈ [n], j 6= 1.

We claim j = 2. Suppose not, then there is a block bIh with bI1 < bIh < bIj and, by

Lemma 8, ai appears in bIh as well. But now either (ai+1, ai−1) is a subsequenceof b, which would give us a cycle of length 3 in G+

Π , a contradiction, or there isa vertex a ∈ C with a ∈ Label TouchList(bh) ∩ I and a 6∈ {ai−1, ai+1, ai}. Butthen either there is an edge (ai, a) or (a, ai) in G+

Π (as both of them will appearin touching blocks of bh): either would give us a shorter cycle. So j = 2. As wecontinue like this, (ai+1, ai+2) must be a representative of some bIt where t > 2.But then considering bI1, b

I2, b

It , with a similar argument, we either have a cycle

of length 3, or we can find a shorter cycle in G+Π as seen before. Thus there is

no cycle in G+Π and hence there is no cycle in GΠ , as claimed. ⊓⊔

Page 22: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

22 S.A. Amiri et al.

The following lemma establishes the link between independent sets in H andfeasible update sequences of the corresponding update flow network G.

Lemma 10. There is a feasible sequence of updates for an update network Gon k flow pairs, if and only if there is an independent set of size |B| in H.

Proof. First we prove that if there is a sequence of feasible updates ρ, then thereis an independent set of size |B| in H . Suppose ρ is a feasible sequence of updatesof blocks. For a block b, let B[b] = {b′1, . . . , b

′ℓ} be the set of blocks that touch

b. Let πb be the reverse order of updates of blocks in B[b] w.r.t. ρ. In fact, ρupdates b′1 first, then b′2, then , . . . , b′ℓ, then πb = b′ℓ . . . b

′1.

For every two blocks b, b′ ∈ B, we have πb ≈ πb′ . From every set of verticesTouchList(b), for b ∈ B, let vbi be a vertex such that Label(vbi ) is a subsequenceof πb. Recall that, for labels of vertices in Vb, we take all possible congestion freepermutations of blocks that touch b in B′. So the vertex vbi exists. Put vbi in I.The label of every pair of vertices in I are consistent, as their supersequenceswere consistent, so I is an independent set and furthermore |I| = |B|.

For the other direction, suppose there is an independent set of vertices Iof size |B| in H . It is clear that there is only one vertex from each of theTouchList(b), for b ∈ B, in I.

Let us define the dependency graph of I = {vb | b ∈ B} as the dependencygraph D :=

b∈B GLabel(vb). By Lemma 9, we know that D is a DAG, and thusit contains at least one sink vertex. We update blocks which correspond to sinkvertices of D in parallel and we remove those vertices from D after they areupdated. Then we proceed recursively, until there is no vertex in D, similarly toAlgorithm 1 for 2-flows. We claim that this gives a valid sequence of updates forall blocks.

Suppose there is a sink vertex whose corresponding block b cannot be updated.Then there is an edge e ∈ E(b) (edges of b) which cannot be activated (updated).Edge e cannot be updated because some other blocks are incident to e and routeflows: updating b would violate a capacity constraint. These other blocks musthave been updated already by our algorithm: otherwise the label correspondingto b is an invalid congestion free label. Suppose those other blocks are updatedin the order b′1, b

′2, . . . , b

′ℓ by the above algorithm. Among b, b′1, . . . , b

′ℓ, there is

a block b′ which is the largest one (w.r.t. <). In the construction of H , weknow that TouchList(b′) 6= ∅, as otherwise I was not of size |B|. Also supposev ∈ TouchList(b′) ∩ I, then in the label of v, we have a subsequence b′′1 , . . . , b

′′ℓ+1

where b′′i ∈ {b, b′1, . . . , b′ℓ}: in the iteration where we create TouchList(b′), b′

touches all those blocks. We claim that the permutations π1 = b′′1 , . . . , b′′ℓ+1 and

π2 = b′1, . . . , b′ℓ, b are exactly the same, which would contradict our assumption

that e cannot be updated: π1 is a subsequence of the congestion free permutationLabel(v).

Suppose π1 6= π2, then there are two blocks b′′′1 , b′′′2 with π1(b′′′1 ) < π1(b

′′′2 )

and π2(b′′′2 ) < π2(b

′′′1 ). Since both, b′′′2 and b′′′1 , will appear in Label(v), there is

a directed path from b′′′2 to b′′′1 in D. Then our algorithm cannot choose b′′′2 as asink vertex before updating b′′′1 : a contradiction. Hence, the sequence of updates

Page 23: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 23

we provided by deleting the sink vertices, is a valid sequence of updates if I isan independent set of size |B|. ⊓⊔

With Lemma 10, the update problem boils down to finding an independentset of size |B| in H . However, this reduction does not suffice yet to solve ourproblem in polynomial time, as we will show next.

Finding an independent set of size |B| in H is equivalent to finding a cliqueof size |B| in its complement. The complement of H is a |B|-partite graph whereevery partition has cardinality ≤ k!. In general, it is computationally hard tofind such a clique.

Lemma 11. Finding an m-clique in an m-partite graph, where every partitionhas cardinality at most 3, is hard.

Proof. We provide a polynomial time reduction from 3-SAT. Let C = C1 ∧C2 ∧ . . . ∧ Cm be an instance of 3-SAT with n variables X1, . . . , Xn. We denotepositive appearances of Xi as a literal xi and negative appearance as a literal xi

for i ∈ [m]. So we have at most 2n different literals x1, . . . , xn, x1, . . . , xn. Createan m-partite graph G as follows. Set G to be an empty graph. Let Ci = li1 , li2 , li3be a clause for i ∈ [m], then add vertices vili1

, vili2, vili3

to G as partition pi. Note

that li1 = xt or li1 = xt for some t ∈ [n]. Add an edge between each pair ofvertices vix, u

jy for i, j ∈ [m], i 6= j if x = xt for some t ∈ [n] and y 6= xt or if

x = xt and y 6= xt. It is clear that G now is an m-partite graph with exactly 3vertices in each partition.

Claim: There is a satisfying assignment σ for C if, and only if, there is anm-clique in G.

Define a vertex set K = ∅. Let σ be a satisfying assignment. Then from eachclause Ci for i ∈ [m], there is a literal lij which is set to true in σ. We take allvertices of G of the form vilj and add it to K. The subgraph G[K] forms a cliqueof size m. On the other hand suppose we have an m-clique Km as a subgraph ofG. Then, clearly from each partition pi, there exists exactly one vertex vilj whichis in Km. We set the literal lj to true. This gives a valid satisfying assignmentfor C. ⊓⊔

Now we trim H to avoid the above problem. Again we will use the specialproperties of the touching relation of blocks. We say that some edge e ∈ E(H)is long, if one end of e is in block type Vbi , and the other in block type Vb′

jwhere

j > i + 1. The length of e is j − i. Delete all long edges from H to obtain thegraph RH .

Lemma 12. H has an independent set I of size |B| if, and only if, I is also anindependent set in RH .

Proof. One direction is clear: if I is an independent set of size |B| in H , thenit is an independent set of size |B| in RH . On the other hand, suppose I is anindependent set of size |B| in RH . Then for the sake of contradiction, supposethere are vertices u, v ∈ I and an edge e = {u, v} ∈ E(H), where e has the

Page 24: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

24 S.A. Amiri et al.

shortest length among all possible long edges in H [I]. Let us assume that u ∈Vbi , v ∈ Vbj where j > i + 1. Suppose from each Vbℓ for i ≤ ℓ ≤ j, we havevbℓ ∈ I, where vbi = u, vbj = v. Clearly as I is of size |B| there should be exactlyone vertex from each Vbℓ . We know core(Label(u),Label(v)) 6= ∅ as otherwisethe edge {u, v} 6∈ E(H). On the other hand, as e is the smallest long edge whichconnects vertices of I, then there is no long edge between vbi and vbj−1 inH . Thatmeans Label (vbi) ≈ Label (vbj−1 ) but then as Label (vbi ) 6≈ Label (vbj ) and byLemma 8 we know that core(Label(u),Label(v)) ⊆ Label(vbj−1 ), so Label(vbj ) 6≈Label(vbj−1 ). Therefore, there is an edge between vbj and vbj−1 : a contradiction,by our choice of I in Rh. ⊓⊔

Now we have the following main theorem as a corollary of the previous lem-mas.

Theorem 4. There is a linear time FPT algorithm which finds a solution forthe network update problem, whenever it exists, and otherwise outputs there isno feasible solution for a given instance.

Proof. Recall that we can resolve all empty updates in the first round, so weignore them in the following.

First directly construct the graph RH in time O(k! · |G|). Then we find anindependent set of size |B| (or we output there is no such set) by dynamicprograming as follows. Define a function f : [|B|]× V (RH) → 2V (RH) as follows.

1. Set f(i, v) := ∅ for all i ∈ [|B|], v ∈ V (RH).2. Set f(1, v) := v for all v ∈ TouchList(b1).3. For 2 ≤ i ≤ [|B|] do

(a) For all v ∈ TouchList(bi)i. If there is a vertex u ∈ TouchList(bi−1) and |f(i− 1, u)| = i− 1 and

{u, v} 6∈ E(RH) then f(i, v) := f(i− 1, u) ∪ {v},ii. otherwise set f(i, v) := ∅

4. If ∃v ∈ TouchList(b|B|) where |f(|B|, v)| = |B| then output f(|B|, v),5. otherwise output there is no such independent set and output the instance

is infeasible.

If the above algorithm finds an independent set of size |B|, then, using thealgorithm provided in the proof of Lemma 10, find the corresponding updatesequence. The whole algorithm runs in O(k!2 · |G|) which is 2O(k log k)O(|G|). ⊓⊔

7 Conclusion

This paper initiated the study of a natural and fundamental problem: thecongestion-free rerouting of unsplittable flows. The main open question of ourwork concerns the optimality of our algorithm for fixed k. In particular, it wouldbe interesting to see whether some modifications of our algorithm provides an ap-proximation guarantee in terms of the required number of update rounds. Moregenerally, it will be interesting to chart a more comprehensive landscape of the

Page 25: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

Congestion-Free Rerouting of Flows on DAGs 25

computational complexity for the network update problem, also for other graphfamilies and from a randomized algorithm’s perspective.

Acknowledgments. We would like to thank Stephan Kreutzer and Arne Lud-wig for discussions on this problem.

References

1. Saeed Akhoondian Amiri, Stephan Kreutzer, Daniel Marx, and Roman Rabinovich.Routing with congestion in acyclic digraphs. In Piotr Faliszewski, Anca Muscholl,and Rolf Niedermeier, editors, 41st International Symposium on Mathematical

Foundations of Computer Science, MFCS, volume 58 of LIPIcs, pages 7:1–7:11.Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2016.

2. Saeed Akhoondian Amiri, Arne Ludwig, Jan Marcinkowski, and Stefan Schmid.Transiently consistent sdn updates: Being greedy is hard. In 23rd International

Colloquium on Structural Information and Communication Complexity, SIROCCO,2016.

3. D. Awduche, L. Berger, D. Gan, T. Li, V. Srinivasan, and G. Swallow. Rsvp-te:Extensions to rsvp for lsp tunnels. In RFC 3209, 2001.

4. Jørgen Bang-Jensen and Gregory Gutin. Digraphs - theory, algorithms and appli-

cations. Springer, 2002.

5. Sebastian Brandt, Klaus-Tycho Forster, and Roger Wattenhofer. On consistentmigration of flows in sdns. In 35th Annual IEEE International Conference on

Computer Communications, INFOCOM, pages 1–9, 2016.

6. Chandra Chekuri, Alina Ene, and Marcin Pilipczuk. Constant congestion routingof symmetric demands in planar directed graphs. In 43rd International Colloquium

on Automata, Languages, and Programming, ICALP, 2016.

7. Chandra Chekuri, Sreeram Kannan, Adnan Raja, and Pramod Viswanath. Multi-commodity flows and cuts in polymatroidal networks. SIAM J. Comput., 44(4):912–943, 2015.

8. Shimon Even, Alon Itai, and Adi Shamir. On the complexity of timetable andmulticommodity flow problems. SIAM J. Comput., 5(4):691–703, 1976.

9. Nick Feamster, Jennifer Rexford, and Ellen Zegura. The road to sdn: an intellectualhistory of programmable networks. ACM SIGCOMM Computer Communication

Review, CCR, 44(2):87–98, 2014.

10. Klaus-Tycho Foerster, Stefan Schmid, and Stefano Vissicchio. Survey of consistentnetwork updates. In arXiv Technical Report, 2016, 2016.

11. Klaus-Tycho Forster, Ratul Mahajan, and Roger Wattenhofer. Consistent Updatesin Software Defined Networks: On Dependencies, Loop Freedom, and Blackholes.In 15th IFIP Networking, 2016.

12. Xin Jin, Hongqiang Liu, Rohan Gandhi, Srikanth Kandula, Ratul Mahajan, Jen-nifer Rexford, Roger Wattenhofer, and Ming Zhang. Dionysus: Dynamic schedulingof network updates. In ACM SIGCOMM 2014, 2014.

13. Ken-ichi Kawarabayashi, Yusuke Kobayashi, and Stephan Kreutzer. An excludedhalf-integral grid theorem for digraphs and the directed disjoint paths problem. InSymposium on Theory of Computing, STOC, pages 70–78, 2014.

14. Jon M. Kleinberg. Decision algorithms for unsplittable flow and the half-disjointpaths problem. In 30th Annual ACM Symposium on Theory of Computing, STOC,1998.

Page 26: arXiv:1611.09296v1 [cs.DS] 28 Nov 2016stefan/netup-dag-arxiv.pdf · arXiv:1611.09296v1 [cs.DS] 28 Nov 2016 Congestion-Free Rerouting of Flows on DAGs⋆ Saeed Akhoondian Amiri1 Szymon

26 S.A. Amiri et al.

15. Frank Thomson Leighton and Satish Rao. Multicommodity max-flow min-cuttheorems and their use in designing approximation algorithms. J. ACM, 46(6):787–832, 1999.

16. Arne Ludwig, Jan Marcinkowski, and Stefan Schmid. Scheduling loop-free networkupdates: It’s good to relax! In ACM Symposium on Principles of Distributed

Computing, PODC, 2015.17. Martin Skutella. Approximating the single source unsplittable min-cost flow prob-

lem. Math. Program., 91(3):493–514, 2002.18. Amin Vahdat, David Clark, and Jennifer Rexford. A purpose-built global network:

Google’s move to SDN. ACM Queue, 13(8):100, 2015.


Recommended