 # Finding popular branchings in vertex-weighted digraphs

Popular matchings have been intensively studied recently as a relaxed concept of stable matchings. By applying the concept of popular matchings to branchings in directed graphs, Kavitha et al. (2020) introduced popular branchings. In a directed graph G=(V_G,E_G), each vertex has preferences over its incoming edges. For branchings B_1 and B_2 in G, a vertex v∈ V_G prefers B_1 to B_2 if v prefers its incoming edge of B_1 to that of B_2, where having an arbitrary incoming edge is preferred to having none, and B_1 is more popular than B_2 if the number of vertices that prefer B_1 is greater than the number of vertices that prefer B_2. A branching B is called a popular branching if there is no branching more popular than B. Kavitha et al. (2020) proposed an algorithm for finding a popular branching when the preferences of each vertex are given by a strict partial order. The validity of this algorithm is proved by utilizing classical theorems on the duality of weighted arborescences. In this paper, we generalize popular branchings to weighted popular branchings in vertex-weighted directed graphs in the same manner as weighted popular matchings by Mestre (2014). We give an algorithm for finding a weighted popular branching, which extends the algorithm of Kavitha et al., when the preferences of each vertex are given by a total preorder and the weights satisfy certain conditions. Our algorithm includes elaborated procedures resulting from the vertex-weights, and its validity is proved by extending the argument of the duality of weighted arborescences.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Popular matchings provide a relaxed concept of stable matchings. Popular matchings were introduced by Gärdenfors , and have been attracting intensive attention recently since Abraham et al.  started studying their algorithmic aspects. In a bipartite graph, each vertex has preferences over its adjacent vertices, and a matching is more popular than another matching if the number of vertices that prefer the adjacent vertex in to that in is greater than the number of vertices that prefer the adjacent vertex in to that in . A matching is called a popular matching if no matching is popular than . For popular matchings, several algorithms are known. Abraham et al.  were the first to give an efficient algorithm determining whether a popular matching exists and finding one if exists.

There have been various other studies on popular matching in recent years, including [2, 3, 4, 8, 10]. Among those, Mestre  provided an algorithm for weighted popular matching. In the weighted popular matching problem, weights are attached to the vertices and, instead of the number of vertices, the popularity of matchings is defined by the sum of the weights of the corresponding vertices. The algorithm  runs in polynomial time for both of the cases where ties are allowed and not.

By applying the concept of popular matchings to branchings in directed graphs, Kavitha, Király, Matuschke, Schlotter, and Schmidt-Kraepelin  introduced popular branchings. In a directed graph , each vertex has preferences over its incoming edges. Let and be branchings in . We say that a vertex prefers to if prefers the incoming edge in to that in , where having an arbitrary incoming edge is preferred to having none. We say that is more popular than if the number of vertices that prefer is greater than the number of vertices that prefer . A branching is called a popular branching if there is no other branching more popular than .

Kavitha et al.  proposed an algorithm for finding a popular branching when the preferences of the vertices are given by a strict partial order. This algorithm determines whether a popular branching exists, and if so, outputs one. Its validity is proved by a characterization of popular branchings which utilizes the duality of weighted arborescences. The algorithm constructs a directed graph from by adding a dummy vertex as a root and an edge for each .

Each branching in is extended to an -arborescence in by adding an edge for every vertex with no incoming edge in . They proved that an -arborescence in is a popular arborescence if and only if it is a minimum cost arborescence with respect to edge weights defined in a certain manner.

For these edge weights, they further proved that, for an integral optimal solution of the dual problem, the laminar structure of the support has at most two layers. This structure leads to a one-to-one correspondence between the support and the vertex set , and the concept of safe edges, which are candidates of the edges in a popular arborescence. The algorithm of Kavitha et al.  essentially relies on this structure.

In this paper, we generalize popular branchings to weighted popular branchings in the same manner as weighted popular matchings . Each vertex is assigned a positive integer weight . For an -arborescence in and a vertex , let denote the edge in entering . For two -arborescences and in , we define an integer by

 Δw(A,A′)=∑v:A(v)≻vA′(v)w(v)−∑v:A′(v)≻vA(v)w(v), (1)

where denotes that prefers to . If , we say that is more popular than . An -arborescence in is a popular arborescence if no arborescence is more popular than .

The main contribution of this paper is an algorithm for finding a popular arborescence in vertex-weighted directed graphs, which extends the algorithm of Kavitha et al. . Its validity builds upon a characterization of weighted popular arborescences, which extends that for popular branchings , and our algorithm includes elaborated procedures resulting from the vertex-weights.

The following two points are specific to our algorithm. The first is that the preferences of each vertex are given by a total preorder, while they are given by a strict partial order in . The second is that it requires an assumption on the vertex weights:

for any vertex ,

 w(s)+w(t)>w(u)

holds.

Under this assumption, we can derive that the laminar structure of the support of an integer dual optimal solution has at most two layers. By virtue of this laminar structure, we can define the one-to-one correspondence between and , and safe edges in the same manner as , which are essential in designing the algorithm.

Let us mention an application of popular branchings in the context of a voting system, and what is offered by the generalized model of weighted popular branchings. Kavitha et al.  suggested an application in a voting system called liquid democracy. This is a new voting system that lies between representative democracy and direct democracy. In liquid democracy, voters can choose to vote themselves or to delegate their votes to others who know more than they do, and their votes flow over a network, constructing a fluid voting system. In this system, a popular branching amounts to a reasonable delegation process. Here, if we take vertex weights into account, it represents a situation where there is a difference in voting power. That is, weighted popular branchings are of help when each voter has distinct voting power, and we want to make a decision based on the total voting power rather than the number of votes.

This paper is organized as follows. Section 2 formally defines weighted popular branchings. In Section 3, in preparation for algorithm design, we analyze some properties of weighted popular branchings and introduce safe edges. In Section 4, we present our algorithm for finding a weighted popular branching and prove its correctness.

## 2 Definition of weighted popular branching

Let be a directed graph, where every vertex has a positive integer weight and preferences over its incoming edges. The preferences of each vertex are given by a total preorder on the set of edges that enter . Let be a finite set. A binary relation on is transitive if, for all , and imply . Also, is reflexive if holds for all . A relation is called a preorder if is transitive and reflexive. In addition, is a total relation if or holds for all . That is, a total preorder is a relation which is transitive, reflexive, and total. Note that a partial order is a preorder, whereas it is not necessarily a total preorder, and a total preorder is not necessarily a partial order.

Let and be two edges entering the same vertex . Then, means that has more or the same priority than . If both and holds, we denote it by , indicating that is indifferent between and . Note that is an equivalence relation. Furthermore, if holds but does not, we denote it by . This indicates that vertex strictly prefers to . If an edge is strictly preferred to , then we say that dominates .

Instead of discussing branchings in , we mainly handle arborescences in an auxiliary directed graph . The directed graph is constructed from by adding a dummy vertex as a root and an edge for each . That is, is represented as , where and . For each vertex , let be the set of edges in that enter , and make the least preferred incoming edge in . That is, every edge in dominates for each .

An -arborescence in is an out-tree with root . For an -arborescence in and , let denote the edge in entering . For -arborescences and in , we define by

 Δw(A,A′)=∑v:A(v)≻vA′(v)w(v)−∑v:A′(v)≻vA(v)w(v). (2)

An -arborescence is more popular than if . If no -arborescence is more popular than , then we say that is a popular arborescence. Our primary goal is to find a popular arborescence in .

## 3 Properties of weighted popular branchings

### 3.1 Characterizing weighted popular arborescence

In this subsection, by extending the argument in , we give a characterization of popular arborescences by utilizing the duality theory of weighted arborescences.

Let be an -arborescence in . For each edge in , we define the cost as follows:

 cA(e)=⎧⎨⎩0(e≻vA(v)),w(v)(e∼vA(v)),2w(v)(e≺vA(v)). (3)

Since for every , we have . For an arbitrary -arborescence in , the following holds:

 cA(A′) =∑v:A(v)≻vA′(v)2w(v)+∑v:A(v)∼vA′(v)w(v)+∑v:A(v)≺vA′(v)0 =w(VG)+∑v:A(v)≻vA′(v)w(v)−∑v:A(v)≺vA′(v)w(v) =cA(A)+Δw(A,A′).

We thus obtain the following proposition.

###### Proposition 1.

An -arborescence is popular if and only if it is a min-cost -arborescence in with respect to the edge costs .

Based on Proposition 1

, consider the following linear program (LP1), which describes the min-cost

-arborescence problem, and its dual (LP2). For any non-empty set , let be the set of edges in that enter .

 (LP1) minimize ∑e∈EcA(e)⋅x(e) (4) subject to ∑e∈δ−(X)x(e)≥1 ∀X⊆VG,X≠∅, (5) x(e)≥0 ∀e∈E. (6)
 (LP2) maximize ∑X⊆VG,X≠∅y(X) (7) subject to ∑X:e∈δ−(X)y(X)≤cA(e) ∀e∈E, (8) y(X)≥0 ∀X⊆VG,X≠∅. (9)

For any feasible solution to (LP2), let be the support of .

The following proposition is a direct consequence of the definition of the costs .

###### Proposition 2.

For an -arborescence and a feasible solution to (LP2), we have that

 ∑X:v∈Xy(X)≤2w(v)(v∈VG).
###### Proof.

For every vertex , it holds that

 ∑X:v∈Xy(X)=∑X:(r,v)∈δ−(X)y(X)≤cA(r,v)≤2w(v). (10)

From now on, we deal with an optimal solution with certain properties. The first property is described in the following lemma.

###### Lemma 3 ([5, 6, 7]).

If the costs are integers, there exists an integral optimal solution to (LP2) such that is laminar.

Since the costs are integers, it follows from Lemma 3 that there exists an integral optimal solution to (LP2) such that is laminar. Furthermore, the following proposition can be derived by the duality of weighted arborescences, as described in .

###### Proposition 4.

For an -arborescence , the following statements are equivalent.

1. is a popular arborescence.

2. .

3. for all and for all .

Let be an -arborescence and be an optimal solution for (LP2). Let be the set of edges satisfying and let . The following lemma applies to general weighted arborescences. For a directed graph and its vertex subset , we denote the subgraph induced by is denoted by . Similarly, for an edge subset , the set of edges in induced by is denoted by .

###### Lemma 5.

For an -arborescence , there exists an integral optimal solution to (LP2) such that is laminar and is strongly connected for every .

###### Proof.

Let be an optimal integral solution to (LP2) whose support is laminar. Among those, choose such that is minimal. Assume to the contrary that is not strongly connected for some . Then there exists a strongly connected component of such that , that is, for all edges in , holds. Define by

 y′(X)=⎧⎪⎨⎪⎩y∗A(X)+ϵ(X=Z),y∗A(X)−ϵ(X=Y),y∗A(X)(otherwise). (11)

for sufficiently small . Then, for all edges in . Thus is a feasible solution to (LP2) and since the objective function values for and are equal, is also an optimal solution to (LP2). Since , this contradicts the minimality of . Therefore we conclude that is strongly connected for each . ∎

In what follows, we denote by the integer optimal solution to (LP2) described in Lemma 5. If is a popular arborescence, we can impose a stronger condition on .

###### Lemma 6.

For a popular arborescence , there exist an integral optimal solution to (LP2) such that is laminar, is strongly connected for every , and the following is satisfied.

For , let be the sets in that are maximal proper subsets of . Then,

 |Y∖(Y1∪⋯∪Yk)|=1. (12)
###### Proof.

Among described in Lemma 5, consider for which is minimal. Let and . We first show that . Since for , it follows from Proposition 4(iii) that and . It is also derived from Lemma 4(iii) that , and thus

 |Y′| =|A∩δ−(Y)∩δ−(Y′)|+|A[Y′]|+∣∣ ∣∣A∩δ−(Y′)∩(⋃i=1,…,kδ+(Yi))∣∣ ∣∣ =|A∩δ−(Y)∩δ−(Y′)| ≤|A∩δ−(Y)∩δ−(Y′)|+∣∣ ∣∣A∩δ−(Y)∩(⋃i=1,…kδ−(Yi))∣∣ ∣∣ =|A∩δ−(Y)|=1. (13)

Suppose to the contrary that . Let . First, we consider the case where . It follows from that . For any edge , it holds that from the constraint (8). We know that , and hence holds. Let and . Then . Thus, if we replace these two values with and , we can construct with a smaller value of while satisfying the constraints of (LP2). This contradicts the minimality of .

Next, consider the case where is not included in . In this case, holds. It then follows from Lemma 7 that is not minimal in , that is, always exist. Since , without loss of generality we can assume that . Note that since . Now, since we have chosen described in Lemma 5, is strongly connected. Therefore, there exists . Similarly, is also strongly connected, and hence there exists . Then, we have . If , since and each edge satisfies , it holds that , which implies and . Now, since , there is no edge such that . Therefore cannot be taken from , contradicting that and . If , it follows from that as in the previous discussion. However, this contradicts the definition of cost : .

From the above, there is no such for which , and from (12), we conclude that . ∎

For a popular arborescence, the following lemma holds.

###### Lemma 7.

If is a popular arborescence and a set is minimal in , then .

###### Proof.

Suppose to the contrary that for a minimal set in . Since , by Proposition 4(iii), we have . Also, since is an -arborescence, it holds that , and hence . It then follows that , and let be an edge in . Now is a minimal set in , implying that for any . This contradicts Proposition 4(iii). ∎

From Lemma 6 and 7, the next proposition follows.

###### Proposition 8.

Let be a popular arborescence. Then, there exists a one-to-one correspondence between the sets in satisfying (12) and the vertices in . Moreover, for each and the terminal vertex of the edge , we have .

Denote by the unique set in that is in correspondence with in the sense of Proposition 8. Note that and the unique edge in entering is . We thus refer to as the entry-point of .

### 3.2 Weight assumption and safe edges

In Kavitha et al.’s algorithm for finding popular branching , the laminar structure of has at most two layers:

 |{X∈F(y∗A)∣v∈X}|≤2(v∈VG). (14)

This structure plays an important role in the algorithm: it leads to a one-to-one correspondence between and the vertex set , and the concept of safe edges.

In the unweighted case, (14) follows from Proposition 2. However, when the weights can be more than one, Proposition 2 alone does not rule out the case where . In order to maintain (14), as mentioned in Section 1, we impose an assumption on the vertex weights. Recall that the assumption is:

 w(s)+w(t)>w(u)(s,t,u∈VG). (15)

From this assumption, we can derive the following proposition.

###### Proposition 9.

Let be a popular arborescence and let satisfy (12). If the condition (15) holds for any three vertices , then holds for every vertex .

###### Proof.

Assume to the contrary that for some . In this case, there exist two vertices such that . Since from Proposition 8 and from assumption (15), we have , which contradicts the constraint (8) in (LP2). Therefore, under assumption (15), holds for every . ∎

From Proposition 8 and 9, and the laminarity of , the following corollary can be derived.

###### Corollary 10.

Under assumption (15), for satisfying (12) and with , it holds that for each .

The safe edges used in our algorithm are defined in the same way as , described below. For , an edge satisfying the following two conditions is called a safe edge in , and the set of safe edges in is denoted by .

1. is not dominated by the edges , i.e., for all .

2. dominates each with , i.e., for all .

Recall that the preference of each vertex is taken as the total preorder. Hence, if there exists such that is one of the most preferred edges in , it holds that . Otherwise, is the set of the most preferred edges in .

The edges in a popular arborescence are basically chosen from safe edges, as shown in the next proposition.

###### Proposition 11.

For any popular arborescence and satisfying (12), it holds that .

###### Proof.

Assume to the contrary that there exists an edge . It follows from that . Also, implies that there exists an edge that dominates or an edge that is not dominated by .

Suppose that there exists an edge dominating . In this case, . Here is not an entry-point of , and thus follows from Corollary 10, which does not satisfy the constraint (8) for .

Suppose that there exists an edge not dominated by . Since , we have . Also, since and , there exist an edge in whose terminal vertex is the entry-point for . Then, by Proposition 8, holds. Now, enters the two sets and in . It thus follows that , which contradicts the constraint (8) for . Therefore, we conclude that for any popular arborescence and . ∎

## 4 Weighted popular branching algorithm

We are now ready to describe our algorithm for finding a weighted popular arborescence and prove its validity. The algorithm is described as follows.

1. For each do:

• let ;

• while does not reach all vertices in the graph do:

• the set of vertices reachable from in ; let .

• let .

2. Let , , , and .

3. For each , let be the strongly connected component of such that an edge in does not enter. For each do:

• if every which has minimum weight in satisfies the following condition, then go to STEP 5.

There exist and such that

• ,

• is reachable from by the edges in ,

• holds for all .

• otherwise, for every which has minimum weight in , do:

• for every , if is not dominated by an edge in , then define an edge in by

 e′={(U,Xv)(u∈U,U∈X),(r,Xv)(u=r), (16)
• and let .

4. If does not contain an -arborescence , then go to STEP 5. Otherwise, do the following.

• let ;

• let ;

• for each , let be an -arborescence in ;

• return .

5. Return “No popular arborescence in .”

A major difference from the algorithm without the vertex-weights  appears in STEP 3. If the condition shown in STEP 3 is satisfied, there exists no popular arborescence (see Lemma 18).

We now prove the validity of the algorithm described above by showing that

• if the algorithm returns an edge set , then is a popular arborescence in (Theorem 13), and

• if admits a popular arborescence, then the algorithm returns an edge set (Theorem 19).

The following lemma in  is useful in our proof as well.

###### Lemma 12 ().

For each , let be the set defined in the algorithm STEP 1. Then, is laminar, and implies .

###### Theorem 13.

If the algorithm returns an edge set , then is a popular arborescence.

###### Proof.

First, we can show that is an -arborescence in in the same manner as .

Next, we show that is a popular arborescence. For such that , let be the terminal vertex of the edge in . Let be a strongly connected component of the subgraph induced by that contains . For a vertex such that for some with or , let . Here, based on Proposition 8, we define

 y(Y)={w(v)(Y=Yv for some v∈VG)0(otherwise). (17)

It is clear that . By Proposition 4, the proof completes by showing that is a feasible solution to (LP2) determined by .

We show that satisfies the constriant (8) of (LP2) for all edges. First, we consider the edges in for each with . The edges in do not enter any set in . For , since is not dominated by from Algorithm STEP 3, it follows that holds. Since is the only set in that enters and , satisfies the constraint (8) for in (LP2). Consider an edge . By construction of , it must hold that , and hence . Since is the only set in that enters, it follows that satisfies the constraint (8) for in (LP2).

Next, for , consider the edges in . By our algorithm, . By the definition of safe edges, for , it holds that , and hence . Since is the only set in that enters and , satisfies the constraint (8) for in (LP2).

Then, consider an edge . Let