Inequality and inequity in network-based ranking and recommendation algorithms

Though algorithms promise many benefits including efficiency, objectivity and accuracy, they may also introduce or amplify biases. Here we study two well-known algorithms, namely PageRank and Who-to-Follow (WTF), and show to what extent their ranks produce inequality and inequity when applied to directed social networks. To this end, we propose a directed network model with preferential attachment and homophily (DPAH) and demonstrate the influence of network structure on the rank distributions of these algorithms. Our main findings suggest that (i) inequality is positively correlated with inequity, (ii) inequality is driven by the interplay between preferential attachment, homophily, node activity and edge density, and (iii) inequity is driven by the interplay between homophily and minority size. In particular, these two algorithms reduce, replicate and amplify the representation of minorities in top ranks when majorities are homophilic, neutral and heterophilic, respectively. Moreover, when this representation is reduced, minorities may improve their visibility in the rank by connecting strategically in the network. For instance, by increasing their out-degree or homophily when majorities are also homophilic. These findings shed light on the social and algorithmic mechanisms that hinder equality and equity in network-based ranking and recommendation algorithms.

Let K in a (t) and K out a (t) be the sum of the in-and out-degrees of nodes from group a at time t. The overall growth of the network follows a DPAH process. Thus, the evolution of in-degree and out-degree follows: where m is the number of new links in the network at each time step t. In each time step, a node v i is chosen. That results in m new out-going links from v i . We set m = 1. Thus, in each time step only one edge is created from v i to v j . Let us denote the relative fraction of group size for each group as f a and f b and their respective activity parameters γ a and γ b that represent the exponents of the activity distribution. Thus, the behavior of the network is similar to what we have shown before [1]; only the total number of links is different. Let us also defineγ a as an average value drawn from the activity distribution of group a, ρ(γ a ) = X −γa using mean field approximation. Similarly,γ b as an average value drawn from the activity distribution of group b, ρ(γ b ) = X −γ b . We can show that in the limit of ∆t → 0, for each group, the in-degree growth function follows: Next, we focus on the case of links within group a. The same analysis applies for group b. Let p aa be the probability to establish a link between two nodes of group a. The probability for an incoming or existing node from group a to link to a node of the same group is given by: In the simple network growth model, the total degree of the groups increases linearly over time.
Denoting C as the in-degree growth factor of the minority group.

Calculating homophily from empirical network
We can calculate homophily in empirical networks using the information about in-group links. First, the total number of edges in a directed network follows: e = e aa + e ab + e ba + e bb (A6) To calculate e aa , the number of links within class a, we can simply argue that it depends on p aa , the probability of connecting two nodes belonging to class a, multiplied by the probability of the arrival or source node to be of class a, denoted by f a , the fraction of nodes in class a, as shown in Equation (A4).
Our network model grows linearly in time. That means, the in-degree growth for each group is linear. Let us assume that the in-degree growth rate of group a is denoted by C a : Since the in-degree growth remains constant over time, we can calculate C a in the empirical network by summing all in-degrees of the group Equation (A4) can be rewritten as In empirical networks, p aa represents the probability of a directed edge from class a to class a. This probability is proportional to the number of edges from a to a, normalized by the total number of directed edges that start from a: p aa = e aa e aa + e ab (A10) We can then calculate Equation (A10) in the empirical network. Finally we use maximum-likelihood estimate to find the best values for h aa and h bb in Equation (A9).
Note that the in-degree growth rate C has an sub-linear relationship to the exponent of the in-degree distribution σ and the exponent of the in-degree growth θ [1]. Thus, another method to retrieve empirical homophily is to first estimate the exponents of the in-degree distributions for minority and majority groups (σ a and σ b ) and plug that into the equation.

Regression model
We build a RandomForestRegressor [2, 3] model to explain rank inequality and inequity given the structure of networks. Features (or independent variables) are transformed by scaling them between zero and one. During training, the model uses n estimators = 100 and all default values from the Python package. We use R 2 scores to evaluate the performance of the 10-fold cross-validated model on the test set. As shown in Table S1, the global model takes into account the overall behavior or trend regardless of top-k ranks, while the local model includes the top-k ranks. We add as a dummy variable, with randomly generated values between 0 and 1, to compare the importance of each feature to random chance.
We report the importance of features given by the feature importances property of the RandomForestRegressor model. The higher the value, the more important the feature. The importance of a feature is computed as the (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance [3].

Who-To-Follow produces higher inequality compared to PageRank
In the main manuscript we see that Who-To-Follow (WTF) produces skewer rank distributions compared to PageRank. To understand this behavior, we need to first understand how the algorithms work. PageRank scores reflect the global importance of nodes in the network, and this global importance is mostly determined by in-degree [4] and the age of nodes [5]. On the other hand, the WTF score of a node is the number of times the node appears in the top-10 recommendation across all nodes in the network. This top-10 is determined by the circle-of-trust of each node, similar to a Personalized PageRank. This means that this top-10 contains the most visited nodes by a random walker that always starts at the node who is getting the recommendation. Thus, that (local) top-10 will be highly influenced by in-degree too. However, since the WTF score counts the number of times a node appears as a recommendation, it is likely that the highest WTF scores refer to high degree nodes due to preferential attachment. Therefore, the high inequality produced by WTF can be explained by the fact that WTF combines a local random walk with a global count.
Appendix B: Additional Tables and Figures   TABLE S1: Regression models. Dependent and independent variables of the four models of interest: Global/Local inequality (Gini) and inequity (ME). We add the dummy variable (with randomly generated values between 0 and 1) to verify whether the network-based features are better than random or not.
Type Dependent variable (Y) Independent variable (Xs) : 10-fold cross-validation for WTF. We use a Random Forest Regressor to assess feature importance and report the mean and standard deviation of the out-of-sample R 2 . Features are ranked in descending order based on their mean importance (from left to right) and highlighted if their importance represents at least 50% of the total importance. Features with a mark (*) are less important than random . Corr shows the disparity as the Spearman correlation between inequality and inequity scores (p-values ≈ 0).
Type Outcome Corr.  Figure 4 in main article), we see that, on average, there is never low global inequality. Also, depending on the level of homophily within groups, minorities on average can be under-represented (region I, red), or over-represented (region III, blue). Note that the fair case (region II, green) rarely occurs. . The x-axis denotes the top-k% rank and the y-axis shows homophily within majorities. Colors refer to the regions of disparity (see Figure 2 in main article). As in the case of PageRank (cf. Figure 5 in main article), we see that the minority suffers most (red) when the majority is homophilic and the minority is either heterophilic or neutral. Also, inequity remains mostly consistent regardless of top-k%. In contrast to PageRank (up to top-5%), WTF manages to capture nodes with very similar ranking scores (roughly) up to the top-30% (i.e., Gini is low, regions VII, VIII, IX).  Figure 6 in main article), all models generate higher inequality (y-axis), whereas inequity remains similar. Vertical and horizontal error bars represent the standard deviation over 10 runs of the Gini and ME, respectively. Inequality computed on the PageRank distribution is shown in red, while the inequality on WTF is shown in blue. We see different trends for each algorithm. First, the inequality (Gini coefficient) of PageRank is very low when the edge density is extreme (i.e., either too low or too high). This means that in these regimes most nodes are similarly important regardless of the magnitude of their degrees. Second, the inequality of WTF is in general negatively correlated with density (i.e., the lower the density, the higher the inequality [6]). However, in the extreme case of denser networks (i.e., d = 0.1), inequality raises. Recall that ranking inequity is very close to zero (M E ≈ 0) in random networks. Further studies are required to analytically understand the limits of inequality with respect to density. Additionally, we adjust γM and γm, the activity of majority and minority groups, respectively. Red represents networks where the majority is more active (higher out-degree) than the minority. In contrast, purple represents networks where the minority is more active than the majority. In comparison with their counterpart γ = γM = γm = 3.0 in Figure S5, we see that a more active minority (γM = 3.0, γm = 1.5), reduces inequality (lower Gini) by amplifying its visibility in the rank (positive ME). Conversely, a more active majority (γM = 1.5, γm = 3.0) can amplify minority representation at the cost of increasing inequality. However, in general, active majorities benefit themselves in the rank. Vertical and horizontal error bars represent the standard deviation over 10 runs of the Gini and ME, respectively. Columns represent the fraction of minorities in the network, x-axis indicates the homophily within minorities, and y-axis the homophily within majorities. Colors denote the regions where the disparity lies according to our interpretation (see Figure  2 in main article). These results correspond to the red data points in Figure S6, γM = 1.5 < γm = 3.0. We see that when the majority is more active than the minority, the algorithm reduces the representation of minorities in almost all combinations of homophily and group size. The exception lies in extreme heterophilic majorities. In this case, the ranking may amplify or replicate the visibility of minorities in the rank. Columns represent the fraction of minorities in the network, x-axis indicates the homophily within minorities, and y-axis the homophily within majorities. Colors denote the regions where the disparity lies according to our interpretation (see Figure  2 in main article). These results correspond to the purple data points in Figure S6, γM = 3.0 > γm = 1.5. We see that when the minority is more active than the majority, the algorithm amplifies the representation of minorities in the rank in almost all combinations of homophily and group size. The exception is an interplay between the fraction of minorities and the homophily of the majority group when minorities are heterophilic. Inequality and inequity are shown in the y-and x-axis, respectively. The disparities in ranking that we see in these empirical networks are best explained by preferential attachment and homophily DPAH.