Node-based generalized friendship paradox fails

The Friendship Paradox—the principle that “your friends have more friends than you do”—is a combinatorial fact about degrees in a graph; but given that many web-based social activities are correlated with a user’s degree, this fact has been taken more broadly to suggest the empirical principle that “your friends are also more active than you are.” This Generalized Friendship Paradox, the notion that any attribute positively correlated with degree obeys the Friendship Paradox, has been established mathematically in a network-level version that essentially aggregates uniformly over all the edges of a network. Here we show, however, that the natural node-based version of the Generalized Friendship Paradox—which aggregates over nodes, not edges—may fail, even for degree-attribute correlations approaching 1. Whether this version holds depends not only on degree-attribute correlations, but also on the underlying network structure and thus can’t be said to be a universal phenomenon. We establish both positive and negative results for this node-based version of the Generalized Friendship Paradox and consider its implications for social-network data.


Introduction
The Friendship Paradox is a well-known graph-theoretical statement about the relationship between nodes' degrees (their number of neighbors or friends, a first-order quantity) and their friends' degrees (a second-order quantity) in a simple connected finite graph (1).In fact, in any such graph, the mean of the latter is no smaller than the mean of the former, meaning the gap (difference) between them is non-negative, regardless of whether we calculate the secondorder mean at the node level and then at the network level, or directly at the network level.
For non-regular graphs, the statement may be strengthened to a strict inequality.In this way, the Friendship Paradox establishes a fundamental property of node degrees, which are a key concept in both pure graph theory (2) and in analyses of the Web and other large networked systems (3).
The Friendship Paradox comes in two related forms, both of which represent natural ways of formalizing this gap.In one, the degrees of a node's friends feature separately in the final mean; we essentially aggregate over each edge separately.We refer to this as a "list" version because each node contributes a list of numbers, its friends' degrees, to the final mean (4).In the second version, for each node, we first calculate the average degree of its friends (the second-order degree for this node), and then average over those for a final mean (5).We refer to this as a "singular" version because each node contributes one number, the mean of its friends' degrees, to the final mean.
It's intuitive to think of degree as a node attribute, and the next thought is whether any numbers assigned as attributes would produce results similar to when degrees act as attributes.
Eom and Jo looked at just that in their 2014 paper, generalizing the Friendship Paradox (FP) to the Generalized Friendship Paradox (GFP) (6).They claimed that as long as the degree sequence and the attribute sample of a non-regular simple connected finite graph are positively correlated, the gap between the second-order mean and the first order mean is positive, i.e. the list version of GFP holds.Note that the graph needs to be non-regular for the degree-attribute correlation to be defined.If either degrees or attributes of a graph's nodes are all equal, it is undefined.For both regular graphs and graphs where all attributes are equal, the gap would be 0.
The result of Eom and Jo makes concrete an important finding about network structure, which is that many correlates of degree seem to satisfy the principle that your friends have "more of it than you do."This is relevant in many contexts on the World Wide Web, where different types of user activity are often positively correlated with a user's degree in the underlying social network (7)(8)(9)(10).For example, in an influential early analysis of the Facebook network as a paradigmatic example of a large web-based social media system, Ugander et al. showed that attributes such as the time spent on the site exhibited an analogue of the friendship paradox, and observed that the correlation between time on site and number of friends made such a finding natural (11).The correlation between degree and activity also forms part of the motivation for using individuals' social network degree in immunization strategies (12,13).And social comparison theory (14-16) suggests that the greater average degree of one's friends may be a source of comparison (17).
Eom and Jo's claim concerned specifically the list ("edge-based," "network-level") version of the paradox: as noted above, this is the version where the attributes of a node's friends feature separately in the final mean, and not as part of a fraction representing a node's single-number second-order quantity.Indeed, suppose that in a simple connected finite graph G, node i's degree is d i , its attribute is a i , the degree sequence has mean d > 0 and standard deviation (s.d.)Given the generality of this result, it is important to understand whether it also holds for the singular version of the Friendship Paradox, since that would be the most direct way to formalize the idea that for any attribute positively correlated with degree, including online activity metrics, "your" friends have more of it than "you" do (what's important here is the emphasis on individuals' singular-number second-order values, implying an averaging over nodes).Our paper starts from the surprising fact that the principle that attributes positively correlated with degree lead to the gap being positive is false, as a general statement, for the singular version of the Generalized Friendship Paradox.Given how naturally the list version of the Friendship Paradox generalizes to attributes that are positively correlated with degree, it's striking to see GFP fail for the singular version.It's all the more notable since the two versions of the original Friendship Paradox tend to behave very similarly in a mathematical sense, and to exhibit roughly the same properties, whereas the failure of this generalization for one version but not the other drives an unexpected technical wedge between them.
This paper explores what conditions are required for the singular version of GFP to fail and to hold.We will refer to "the singular version of GFP" as SGFP.Below, we discuss that for degree-attribute correlations as close to 1 as we want we can find a graph topology and an attribute assignment for which SGFP fails (Section 3) but also that each "path to correlation 1" goes to infinity in the number of nodes (Section 4).We mention that correlation 1 can't fail SGFP for any topology because the calculations would reduce to those of the Singular Friendship Paradox (full proof in the Supplementary Information).We also show that we can split all graph topologies into those for which we can find an attribute sample with positive r d,a (at some value) and for which SGFP fails-so-called anti-SGFP topologies; and those for which we can't find such a sample, meaning that any attribute sample with r d,a > 0 leaves SGFP standing-pro-SGFP topologies (Section 5).We also explore how often random networks are pro-SGFP (as the number of nodes grows they are less and less common) and how high SGFPfailing correlations may be for random anti-SGFP networks (Section 6).Finally, we turn to realworld data and see that real attributes may fail SGFP (Section 7).We also find how non-trivially large SGFP-failing correlations may be for real social networks and explore what happens if we remove social structure by rewiring the graphs (Section 8).

Definitions
Our domain is simple connected finite graphs.We are looking at connected graphs, but similar to the Friendship Paradox, our results are easily generalized to disconnected graphs including those with isolates.For a graph with disjoint connected components of size ≥ 2, the gap can be calculated node-by-node without regard for disconnectedness.(Note that while graph regularity plays a role in our discussion, it would generalize to graph regularity within each component in the case of multiple components).If there are isolated nodes whose second-order attributes are undefined, we can simply disregard them.When dealing with real data, we follow these principles to calculate the gaps.For the theoretical part of this paper, we assume connectedness so we can rule out isolates and iterate over all node indices when computing various values.
For a node i in such a graph on n nodes, let d i be its degree and a i be its attribute for some attribute assignment a (we use terms "attribute sample" and "attribute assignment" interchangeably).Let s i be i's singular second-order attribute, i.e. the single-number mean of its friends' attributes.Let the degree sequence have mean d, the attribute sample have mean a, and the set of second-order attributes have mean s.Let the gap g be equal to the difference between the mean second-order attribute and the mean first-order attribute, so This can also be written more compactly as g = s − a, or in more detail as where N (i) is the set of neighbors, or friends, of i.It will also be useful to express the gap differently.In the first term of equation 1, index i refers to nodes (seeds) and index j to i's friends, and we look at the seeds' calculations of their second-order attributes.Here, we do the opposite and see how each node j's attribute features in its friends' second-order values.
j's coefficient in the second-order mean is equal to 1 n times the sum of j's friends' reciprocal degrees: where N (j) is the set of j's friends.We call k∈N (j) 1 d k , the sum of j's friends' reciprocal degrees, δ j , and could also write: We say that SGFP fails if g < 0 and holds otherwise.
If all degrees or all attributes in a graph are the same, the degree-attribute correlation is undefined.In each of these cases, the gap is 0, so SGFP doesn't fail.See Supplementary Information for a proof.
While graphs that exhibit regularity in degrees or attributes produce a gap of 0, these are not the only cases when that happens (See the end of Section 5 for details).For SGFP, it's important not to think of a gap of 0 as implying a graph's regularity.As a simple example, consider a path graph x − y − z with a x , a y and a z as attributes.The gap is equal to which is equal to 0 if a x + a z = 2a y .So a path graph x − y − z with 1, 2, and 3 as attributes is neither regular nor has the same attributes but produces a gap of 0.
Having dealt with the "regular" cases, below we will further assume that our simple connected finite graphs are non-regular and that for each attribute sample, not all its values are the same, so the correlation between the degree sequence and the attribute sample is defined.It is a measure of linear dependence between them and it is given by (3)

A path to correlation 1
We claim that for any ε > 0, there is a graph topology and an attribute assignment such that the degree-attribute correlation r d,a > 1 − ε and SGFP fails.In this section, we construct one example of a set of graphs such that for any ε > 0, this specific set contains a graph that fits the requirements of r d,a > 1 − ε and SGFP failing.Take a graph with n nodes and some attribute assignment for which SGFP fails, meaning the gap g is negative.Take a look at an example in Figure 1.
For the graph in Figure 1, the gap is equal to: The degree-attribute correlation for that graph is − 17 √ 451 ≈ −0.80.Now, suppose we add 4 new nodes to the graph: two nodes with degree 2, attribute 2 and second-degree attribute 2 ("triple-2" nodes) and two nodes with degree 3, attribute 3 and seconddegree attribute 3 ("triple-3" nodes) while keeping the degrees, attributes and second-order attributes of the original nodes the same.For the graph in Figure 1, we can perform the first step as shown in Figure 2. If a triple-2 node i comes between two nodes with attribute 2, its second-order attribute s i will indeed be 2, and its friends' second-order attributes will not be affected, i effectively taking the place of the former attribute-2 friend for each of its friends.Similarly, adding triple-3 nodes in a certain way ensures their second-order attribute is 3 and preserves the second-order attributes of its friends.
Here, it will help us to rewrite the gap yet another way: Since each new node p has s p = a p , the new node adds nothing to the sum.It does, however, increase the number of nodes n, so the gap remains negative but decreases in absolute value.
(While we don't discuss this in detail, it is possible to counter the gap's convergence to 0 from below with a slightly more elaborate way of adding nodes).Now that we know how to add 4 nodes to this graph and not change the sign of its gap, let's call "adding 4 nodes" a step of induction, since we can perform the same procedure to the graph in Figure 2 and so on.By induction, after each step, the gap is still negative.Let's number the initial Figure 1 nodes 1 through 8.After k steps, with 2k triple-2 nodes and 2k triple-3 nodes added, we have n = 8 + 4k nodes, and the degree-attribute correlation is given by with a (k) and d (k) being the means of the graph's attribute sample and the degree sequence respectively after k steps.We're interested in the limit of r (k) as k goes to infinity.Since The sums are finite numbers which we can write as constants: So, adding 2 triple-2 and 2 triple-3 nodes at a time preserves the negative gap and grows the correlation to 1 in the limit.For different constructions, r d,a may surpass 1 − ε in fewer or more steps depending on the degree-attribute correlation in the original graph, purposely taken to be very low in our example.It is also possible to counter the gap's convergence to 0, instead keeping the gap constant at each step.But since our goal is to provide an example path to 1 where the gap is negative at each step, not large in absolute value, we won't go into detail about those techniques here.For now, we have shown that for any ε > 0, there is a graph topology and an attribute assignment such that the degree-attribute correlation r d,a > 1 − ε and the gap is negative.
The correlation for the graph in Figure 1 is shown in Figure 3.
Figure 3: Degree-attribute correlation for the 8-node example in Figure 1 as we add pairs of triple-2 and triple-3 nodes.
The path to 1 that we've constructed has 1 as the limit, not a destination that is reached, because an attribute sample with r d,a = 1 can't fail SGFP.In the case of r d,a = 1, the calculation of the SGFP gap simplifies to that of the GFP gap, and we know that GFP holds for all nonregular connected graphs, which is our domain here.Please see the Supplementary Information for a detailed proof.

Each path to 1 goes to infinity in the number of nodes
Our earlier construction produced a sequence of graphs and attribute samples whose correlation with the degree sequence converged to 1, and where the gap was negative at each step.In this sequence, the size of the graphs became arbitrarily large, and it's natural to ask if this is necessary; is it possible that for some fixed finite graph topology G, there is a sequence of attribute samples with negative gaps and the degree-attribute correlation converging to 1?
In this section we show that this is not possible, because we are able to show the following result: for every finite graph G, there is a constant G < 1 such that any attribute sample in G whose correlation with the degree sequence exceeds G must produce a non-negative gap.Thus, every graph has a threshold strictly below 1 such that correlations above this threshold cannot fail SGFP.
To show this, we'll consider a graph G with degree sequence d.An attribute sample a is the set of attributes of nodes in G, indexed in the same way as the degrees, so that a degree-attribute correlation r d,a is well-defined.A sequence of attribute samples a (k) is a collection of such samples, and for our purposes r d,a (k) converges to 1.We denote individual nodes' attributes a (k) i .We'll now establish that the gaps for these attribute samples must eventually become non-negative as we move through the sequence.
We start with the following fact: ( * ) For every ε > 0 there exists an α > 0 such that the following holds.If x = (x 1 , ..., x n ) and y = (y 1 , ..., y n ) are vectors for which n i=1 We prove this fact with α = ε 2 /2.Using this as the value of α in terms of ε, we first observe that n i=1 Thus for each i from 1 to n we have and taking square roots we have |x i − y i | < ε, which proves ( * ).Now, fix a non-regular graph H on n nodes.For any n-dimensional vector a = (a 1 , ..., a n ), we can view it as an assignment of attribute values to the nodes of H. Let g H (x) be the gap for this vector of attributes under the gap definition in the paper.For the vector of degrees d = (d 1 , ..., d n ), the gap g H (d) is a constant g H > 0, by the singular version of the Friendship Paradox.
g H (a) is unaffected if we add the same constant to each coordinate of a (see Supplementary Information for the proof).This means we can subtract the mean of a from each a i ; and if the sum of the coordinates of a is now 0, then, following equation 2: Applying this to the vector of degrees, let d be the average degree in H; let ω = n i=1 (d i − d) 2 ; and let τ i = (d i − d)/ω.Then the vector τ = (τ 1 , ..., τ n ) is a unit vector whose coordinates sum to 0; that is, n i=1 τ 2 i = 1 and i τ i = 0.And since τ = d/ω − d/ω for constants ω and d, we have Now, suppose we have a sequence of attribute vectors {a (k) : k = 1, 2, 3, ...} such that g H (a (k) ) < 0 for all k, and the correlation of a (k) with d converges to 1 as k goes to infinity.Since the correlation of two vectors is unaffected if we subtract the same constant from each coordinate of one of the vectors, and multiply the vector by a positive coefficient, we can assume without loss of generality that each a (k) is a unit vector whose coordinates sum to 0. Applying the same argument to transform d to τ , it follows that the correlation of the vectors a (k) with τ converges to 1 as k goes to infinity.
For two unit vectors x and y whose coordinates each sum to 0, their correlation is simply their inner product, since in this case the numerator of the expression for correlation is n i=1 x i y i and the denominator is the square root of ( n i=1 x 2 i ) ( n i=1 y 2 i ) = 1.Therefore, the correlation of a (k) and τ is their inner product n i=1 a (k) i τ i .Let δ * be the maximum value of δ i , the coefficients in the expression for the gap.We now apply our initial fact ( * ) with ε = g H /(ωδ * ), and we obtain the corresponding α = ε 2 .Since the correlation of a (k) and τ converges to 1 as k goes to infinity, there is a value of k for which this correlation is greater than 1 − α; that is, n i=1 a In this section we show that this is not possible, because we are able to show the following result: for every finite graph G, there is a constant G < 1 such that any attribute sample in G whose correlation with the degree sequence exceeds G must produce a non-negative gap.Thus, every graph has a threshold strictly below 1 such that correlations above this threshold cannot fail SGFP.
We now show that that any attribute sample in G whose correlation with the degree sequence exceeds 1 − α must produce a non-negative gap.By fact ( * ) for such a k where the correlation is greater than 1 − α, we have |a For such a k, we have and thus g H (τ ) − g H (a (k) ) < g H /ω. But this contradicts the fact that g H (τ ) = g H /ω and g H (a (k) ) < 0. This contradiction establishes that there can't be such a sequence a (k) that produces a negative gap and whose correlation with τ (and hence with d) converges to 1 for a finite graph H.
Given this result, we can consider the set S G of all β with the property that any attribute sample in G whose correlation with the degree sequence exceeds β must produce a non-negative gap.This set has an infimum, which we can denote by G .It is a property of topology G such that degree-attribute correlations at or below G might fail SGFP, but degree-attribute correlations above it can't.

Differentiating between pro-and anti-SGFP graphs
Given the discussion so far, it is natural to ask which graphs G have the property that there exists an attribute sample a on G that fails SGFP while r d,a > 0. We will call such a graph an anti-SGFP topology (since it is capable of refuting SGFP); and if a graph does not have this property, we will call it pro-SGFP.For pro-SGFP topologies, r d,a > 0 would imply a positive gap, r d,a = 0 a gap of 0, and r d,a < 0 a negative gap, which is the case for all non-regular connected topologies with the list version of GFP.
Is there a tractable characterization of the anti-SGFP and pro-SGFP graphs?We establish here that there is, through a clean characterization showing whether a graph is anti-SGFP or pro-SGFP.
First, consider a graph and an attribute assignment.Recall from Supplementary Information that adding a constant c to each attribute doesn't change the gap.It also doesn't change the correlation, since in the correlation formula we subtract a from each a i , and if each a i grows by c, a grows exactly by c.Thus, for any SGFP-failing attribute assignment, we can change it so its mean a is 0 (by subtracting the original mean from each attribute value) and retain the SGFP-failing property.Meaning, if we can find an attribute assignment a with r d,a > 0 that fails SGFP, we can find an attribute assignment a with all the same characteristics and an additional constraint a = 0.Then, our gap formula becomes: or, given our discussion of δ i above: where δ i = j∈N (i) 1 d j .The correlation becomes: The correlation is positive if and only if its numerator is positive: From here, we get i So, if we have an attribute assignment a with mean 0 and r d,a > 0 and that assignment fails SGFP, we have 3 constraints: Then, given a graph G, we want to see if we can find an attribute assignment that satisfies the 3 constraints above.If we can, it's an anti-SGFP graph, and if we can't, it's a pro-SGFP graph.
Before we go further, we want to show that if we can satisfy i a i = 0, i δ i a i < 0 (negative gap) and i d i a i = 0 (zero correlation) for a graph G, we will also be able to satisfy i d i a i > 0 (positive correlation).Let's say that for an attribute sample a with r d,a = 0, g 0 = 1 n i δ i a i = x < 0 meaning SGFP fails.Let node i be the highest-degree node, or one of them, and node j be the lowest-degree node, or one of them.Since the graph is non-regular, we know d i > d j .We will raise a i by ε > 0 and decrease a j by ε. a will remain at 0, the change in i d i a i will be ε(d i − d j ) > 0 so we satisfy inequality 5 and get r d,a > 0. The change in the gap will be 1 n ε(δ i − δ j ).In order to keep the gap negative and inequality 6 satisfied, we need So, if there is an SGFP-failing attribute assignment with r d,a = 0, there is also one with r d,a > 0. This means that we can replace constraint We can also replace with the equivalent pair of inequalities The final system has 4 inequalities We will use Farkas's Lemma to deal with them (18).
Farkas's Lemma: Let A be a matrix and b a vector.There exists a vector x ≥ 0 satisfying Ax = b if and only if there does not exist a vector y satisfying yb < 0 and yA ≥ 0.
Our system fits naturally into the format of the "y" system in Farkas's Lemma: we let y be the vector (a 1 , a 2 , . . ., a n ), b be the vector (δ 1 , δ 2 , . . ., δ n ), and A be a matrix with n rows and 3 columms, where the first column is (d 1 , d 2 , . . ., d n ), the second column has all 1's, and the third column has all −1's, Then our system of inequalities is indeed yb < 0 and yA ≥ 0. By Farkas's Lemma, this system has no solution (in other words, the graph G is a pro-SGFP graph) if and only if the system Ax = b has a solution with x ≥ 0. What would this mean?Since A has only three columns, x is a 3-dimensional vector: x = (x 1 , x 2 , x 3 ).The i th row of Ax = b corresponds to the equation Now, it's unnecessary to have to write x 2 − x 3 , where x 2 and x 3 are both non-negative in each of these n equations (one for each i = 1, 2, . . ., n).Instead, we can define the variable z = x 2 − x 3 and notice that z can be an arbitrary number, not necessarily non-negative, since it's equal to one arbitrary non-negative number minus another one, and hence can be anything at all.Let's also rewrite x 1 as x.
Therefore, ( * * ) Our system yb < 0 and yA ≥ 0 has no solution if and only if we can find two numbers, x ≥ 0 and z (unconstrained in sign), so that d i x + z = δ i for each i.
A graph G is a pro-SGFP graph if and only if two such numbers x and z exist; otherwise, it is an anti-SGFP graph.
Note that if all δ i in a connected graph are equal, it is a regular graph (see Supplementary Information for the proof).Our domain is non-regular connected graphs, so we know both d i and δ i have variation.This means that for all graphs in our domain, the degree-delta correlation r d,δ is defined.
For pro-SGFP graphs, x in ( * * ) can't be equal to 0 (since that would mean all δ i are the same), and so x > 0. Complying with ( * * ) in this case means that r d,δ = 1.So, A (non-regular connected) graph is pro-SGFP if its r d,δ = 1 and anti-SGFP otherwise.
Note that for a graph to have two nodes i and j such that d i = d j but δ i = δ j would be sufficient (but not necessary) for a graph to be anti-SGFP.That means that attaching a path p − q − r − s − t to any graph at node p would make said graph anti-SGFP: nodes r and s would both have degree 2, but δ r = 1 dq + 1 ds = 1 2 + 1 2 = 1 and δ s = 1 dr + 1 dt = 1 2 + 1 1 = 1.5.Attaching two leaf nodes to different-degree nodes of any graph would make that graph anti-SGFP as well since the two leaf nodes would have different δ i .
It's clear that regular graphs (which are not part of our domain, don't have defined r d,δ , and aren't characterized as pro-SGFP) satisfy the property ( * * ) above, and it's interesting to think of that property as being part of the regularity of regular graphs.Then, we could think of pro-SGFP graphs as "semi-regular," where they satisfy the property ( * * ) (the first requirement for being a regular graph) but do not actually have all nodes sharing degrees (the second requirement for being a regular graph).
For a pro-SGFP graph G, the fact that we can't find an attribute sample a with r d,a > 0 and a negative gap means that for all possible attribute samples a such that r d,a > 0, the gap is non-negative.We can strengthen that to each gap being positive.
Suppose we have a pro-SGFP graph G and an attribute sample a such that r d,a > 0. As shown above, we can alter a to have mean 0 and keep r d,a and the gap the same.Then we have 4 constraints: with the second constraint satisfying the positive correlation requirement and the third constraint indicating the graph being pro-SGFP.The sign of i δ i a i would indicate the sign of the gap.Expressing i δ i a i in terms of d i given the third constraint, we get The first term is positive by the multiplication of constraints 2 and 4. The second term is 0 by the first constraint.This means that i δ i a i is positive and for pro-SGFP topologies, r d,a > 0 implies specifically a positive gap.Changing the sign of the second constraint to indicate zero and negative r d,a , we can also see that for r d,a = 0, the gap is 0, and for r d,a < 0, it is negative.

Overall, this means that
For pro-SGFP topologies, the sign of r d,a determines the sign of the SGFP gap.
In their discussion of the list version of GFP, Eom and Jo noted that for all non-regular connected topologies, the sign of r d,a determined the sign of the LGFP gap (6).This means that in our vocabulary, all non-regular connected topologies are pro-LGFP.This is starkly different from SGFP, where there is a further strict constaint of r d,δ = 1.
Simple examples of pro-SGFP graphs are "star" graphs, where one node is connected to many leaf nodes.Consider also that for each n, there is one complete graph K n , and n 2 labeled networks K n − e, complete graphs missing an edge.In fact, each K n − e ("knee") graph is pro-SGFP, as it only has two kinds of degrees (n − 1 and n − 2), and nodes that share degrees also share δ i due to symmetry, with r d,δ = 1.
Another thing to note is that a pro-SGFP topology with r d,a = 0 is an example of a nonregular graph with differing attributes producing a gap of 0, the value of 0 not indicating regularity (we mentioned that there are such cases in Section 1, and in fact, the 3-node path we described there is pro-SGFP).
As a final point, r d,a = 0 may, but wouldn't always produce 0 gaps for anti-SGFP topologies.For an example of that, see Figure 4. First note that this graph's d i and δ i don't lie on a straight line, so r d,δ = 1 and the graph is anti-SGFP.Then note that all 3 attribute samples ({1,1,2,0},{1,1,1,0},{1,1,3,0}) have correlation 0 with the degree sequence {1,3,2,2}.Finally, note the different signs of the gaps for the 3 cases.Here too, a 0 gap doesn't indicate regularity in degrees, or in attributes, or the graph being pro-SGFP.All pro-SGFP topologies would produce a gap of 0 if r d,a = 0, but anti-SGFP topologies may or may not do that.

Pro-SGFP topologies aren't common
Given the Farkas' Lemma discussion in Section 5, if a graph has two differing degrees and two differing δ i (true for all non-regular graphs), being pro-SGFP means having r d,δ = 1.How common are pro-SGFP topologies in practice?To come up with a simple answer to that question, we use a G n,p random graph generator with p = 1 2 which makes all edge arrangements (not to be confused with topologies, which are nodeID-agnostic) equally likely.We restrict the generator to only non-regular connected graphs and create 100,000 graphs for n = 3, 4...10.In addition to seeing what proportion of the graphs is pro-SGFP, we also want to find how high an r d,a an SGFP-failing attribute sample a may have.
To see this, we use Simplex optimization (specifically the high performance dual revised simplex implementation algorithm) on the 4 constraints that we obtained in Section 5: The third constraint, given the first two, is the numerator of r d,a .The denominator of r d,a is 1 if the sum of squares of the elements of a is 1, or i a 2 i = 1.Note that we can rescale the elements of any attribute sample so that i a 2 i = 1, which doesn't change r d,a or the sign of the gap (see Supplementary Information for a proof).Hence we can assume our attribute sample a follows i a 2 i = 1 and r d,a = i d i a i (the third constraint).We'd like to maximize i d i a i given constraints 1, 2, and 4.
The fourth constraint represents a negative gap.We change it to i δ i a i ≤ −0.001 for the purposes of linear optimization.Removing the strict inequality will not allow us to achieve a true maximum r d,a for which SGFP fails, but the optimization is still useful because the true maximum correlation is at least as large as what we find.Note also that there may not be an achievable maximum but instead a supremum, which is connected to our discussion of G in Section 4.
We call the correlation we obtain a "high correlation" instead of a "max correlation" and denote it r (high) G for a given graph G. Table 1 provides the resulting proportions of pro-SGFP graphs as well as r (high) G and r d,δ for pro-and anti-SGFP graphs.It's clear that as the number of nodes n increases, pro-SGFP topologies are seen less and less often.As predicted, all the pro-SGFP topologies we found have r d,δ = 1.Interestingly, r d,δ is high even for anti-SGFP topologies.Naturally, for pro-SGFP topologies, r (high) G is not positive since no attribute sample with r d,a > 0 can fail SGFP for a pro-SGFP topology.For anti-SGFP topologies, r (high) G is around 0.25.While the pro-SGFP proportion goes down as n grows, there are some non-trivial pro-SGFP topologies that can be easily described, such as "star" graphs and K n −e graphs as mentioned at the end of Section 5. Overall, though, it's hard to characterize the specific "look" of pro-SGFP graphs, so looking at whether r d,δ is 1 or not is the way to go.
For n = 3, the graph generator found only pro-SGFP topologies and no anti-SGFP topologies because the only 3-node connected non-regular topology is the 3-node path, which is K 3 − e.
For n = 4, the pro-SGFP topologies we found are a path graph w − x − y − z; a star graph with w connected to {x, y, z} only; and a complete graph on 4 nodes with one edge removed (which is K 4 − e).

Finding high SGFP-failing correlations for real networks
Another interesting question to ask of the Facebook100 data is how high r d,a can be for some SGFP-failing attribute sample a assigned to a real graph that represents a school.To see this, we use the optimization technique introduced in Section 6 and find r (high) G for each school.We expect a negative correlation between the r d,δ and r (high) G , since r d,δ of 1 implies that a graph is pro-SGFP and its SGFP-failing correlation is bound by 0 from above (so r (high) G too is negative), but if r d,δ is lower than 1, the graph is anti-SGFP and we could expect to find a positive SGFPfailing correlation through optimization (so r (high) G > 0).We find that r (high) G > 0 and r d,δ < 1 for all networks, meaning they all are anti-SGFP.The blue points in Figure 6 represent r (high) G and r d,δ for each school.The correlation for the blue points is -0.85, a strong linear relationship.
It is also interesting whether this relationship is influenced by the social structure inherent in Facebook100 data.To check this, we rewire each network using the configuration model (removing any parallel edges and self-loops).The resulting networks, like the original Face-book100 graphs, may contain isolates, but when computing the gap we can disregard them, and they also don't have weight in the optimization.We plot r (high) G vs r d,δ for the rewired networks in red in Figure 6.The correlation is -0.98 for the red points, and the r d,δ values are similar to those of the random networks from Section 6 (Table 1).The striking difference between the two sets of points suggests that, given a degree sequence, social structure plays a role when it comes to higher possible SGFP-failing degree-attribute correlations.The results also suggest that, given a degree sequence, having social structure provides for smaller r d,δ .

Conclusion
In contrast to the Friendship Paradox and the List (network-level) Generalized Friendship Paradox, the Singular (node-level) Generalized Friendship Paradox is not a phenomenon that applies to networks in general, or regardless of their structure.The degree-attribute correlation is not the only parameter that determines whether SGFP holds, and the correlation being positive or very close to 1 doesn't mean SGFP won't fail.
If the network structure is pro-SGFP, SGFP will fail if and only if the degree-attribute correlation is negative.If the network structure is anti-SGFP, SGFP may fail for both negative and positive degree-attribute correlations; it would also hold for negative correlations for attribute samples −a where r d,a is positive and SGFP fails (r d,−a = −r d,a and g(−a) = −g(a)).Given our data analysis and simulation, we conclude that anti-SGFP topologies are very common.How high SGFP-failing correlations can be depends on the specific anti-SGFP graph topology as shown in the discussion of r (high) G in Sections 6 and 8. Taking all this together, we conclude that we can't simply assume that "your friends' attributes are greater than yours."Each real-world network we want to study needs to be checked for whether SGFP applies to it given its structure and attribute sample.

σ d > 0
indicating non-regularity in degrees, the attribute sample has s.d.σ a > 0 indicating non-regularity in attributes, and the degree-attribute correlation is r d,a .Then the list version gap can be expressed as g list = r d,a σ d σ a /d.Since σ d , σ a , d are all positive, any attribute sample a with positive r d,a satisfies the list version of GFP (LGFP); an attribute sample with zero correlation makes the gap 0, and negative r d,a fails LGFP.In contrast to the regular Friendship Paradox, zero LGFP gap does not make a statement about a graph's regularity, since our domain here is non-regular graphs.

Figure 1 :
Figure 1: Starting with an SGPF-failing graph such as this, we could grow it by adding nodes so that each new graph still fails SGFP and the degree-attribute correlation approaches 1.

Figure 2 :
Figure 2: Adding nodes in a specific way preserves the Singular Generalized Friendship Paradox gap sign and increases the degree-attribute correlation to the limit of 1.This figure is an example of a first step of this process, with new nodes and edges in green.

Figure 4 :
Figure 4: An anti-SGFP graph such as this may produce differently-signed gaps for r d,a = 0, depending on the attribute sample.

Figure 5 :
Figure 5: Plotting r d,a and the gap for 100 Facebook100 networks with "proportion of friends with the same reported gender" (including NULL) as attribute.For 9 schools, the gap is negative while r d,a is positive.These are real-world examples of failing SGFP with attributes positively correlated with degree.

Figure 6 :
Figure 6: For Facebook100 data, it's possible to find SGFP-failing attribute samples with r d,a up to 0.45.When we remove social structure with a configuration model, the correlations we find with Simplex optimization are much lower.