Abstract

Calculation of assortative mixing by degree in networks indicates whether nodes with similar degree are connected to each other. In networks with scale-free distribution high values of assortative mixing by degree can be an indication of a hub-like core in networks. Degree correlation has generally been used to measure assortative mixing of a network. But it has been shown that degree correlation cannot always distinguish properly between different networks with nodes that have the same degrees. The so-called -metric has been shown to be a better choice to calculate assortative mixing. The -metric is normalized with respect to the class of networks without self-loops, multiple edges, and multiple components, while degree correlation is always normalized with respect to unrestricted networks, where self-loops, multiple edges, and multiple components are allowed. The challenge in computing the normalized -metric is in obtaining the minimum and maximum value within a specific class of networks. We show that this can be solved by using linear programming. We use Lagrangian relaxation and the subgradient algorithm to obtain a solution to the -metric problem. Several examples are given to illustrate the principles and some simulations indicate that the solutions are generally accurate.

1. Introduction

Assortative mixing by node degree (i.e., the number of connections of a node) is the tendency of nodes to be connected to other nodes of similar degree and an important concept in network analysis [13]. For example, assortative mixing in social networks could reflect the notion that well-connected people, who know many people, have a tendency to know mainly other well-connected people [4]. Or in a network of actors, where connections indicate that actors worked together on a film, actors with many connections are likely to have worked together with other well-connected actors [5]. As a final example, in symptom networks in psychopathology, where connections represent symptoms belonging to the same disorder, it appears that core symptoms, which are common to multiple disorders, have a high tendency to be mutually connected [6]. Assortative mixing is becoming more and more important, because it points to relevant network characteristics, such as self-similarity and other emergent properties, if it is detected in networks with a power-law degree distribution [1, 7]. Here we propose to compute assortative mixing in undirected networks using linear programming.

Several measures of assortative mixing for undirected graphs exist [5]. One of the most popular ones is the Pearson assortativity coefficient, or degree correlation [1], which is Pearson’s correlation applied to the degrees of each node in the network. Degree correlation is a normalized metric and obtains values between and . However, Alderson and Li [8] have shown that the same value of degree correlation can occur from very different configurations of edges (topology) of a network and that the use of degree correlation may lead to incorrect conclusions. The reason for this is that degree correlation is normalized with respect to general networks with a specific degree sequence (number of connections for all nodes) that can have multiple edges, self-loops and can even be disconnected (i.e., consist of multiple disconnected components). However, in many situations the objective is to compare assortativity with networks that are similar, that is, that are connected and simple (no self-loops, connected, and no multiple edges). To remedy this objection to degree correlation, Li et al. [9] proposed the -metric (first called -metric and later -metric), which is a linear transformation of the degree correlation. In the normalized version of the -metric, normalization is calculated with the maximal and minimal values of with respect to the class of networks that have the desired properties of connectedness and simplicity for the specified degree sequence. The minimal () and maximal () possible values of in the class of simple and connected networks with the same degree sequence are compared to the obtained -value for the network at hand. Then, in contrast to the degree correlation coefficient which is normalized with respect to unrestricted networks of the same degree sequence, the normalized -metric is obtained by comparing of the network under consideration to similar networks that are within the same class of networks of the same degree sequence yet are maximal () or minimal () with respect to assortative mixing.

Obtaining the maximal and minimal network in the class of simple (undirected networks without self-loops and no multiple edges) and connected networks with the same degree sequence is not trivial [8]. The algorithm introduced in Alderson and Li [8] and described in van Mieghem et al. [2] ranks all edges according to the product of degrees of the pair of nodes and then connects nodes according to a nodes degree such that the graph is connected. Unfortunately, this algorithm does not always achieve the exact degree sequence as desired. Alternatively, van Mieghem et al. [2] proposed a rewiring approach increasing (or decreasing) the assortativity, while the degree sequence remains unchanged. The constraint of a connected graph here is sacrificed, however, resulting in possibly disconnected graphs. We propose to use a linear program (LP) to identify and . Obtaining the minimum and maximum value of within the class of graphs with a specific degree sequence that are simple and connected is formulated as a binary integer program (BIP). A binary integer program is a program to optimize a linear objective function given certain linear constraints for a binary (0/1) solution (e.g., [10, 11]). Here the objective function to be optimized is and the constraints are that the optimal graph is simple and connected and has the specified degree sequence. The -metric problem resembles the traveling salesman problem (e.g., [12]), except that the degree constraints can be different from value 2. As a consequence we cannot use the approach of Held and Karp [13], where the problem is reformulated to a 1-tree problem and was shown to lead under certain circumstances to a linear program with the same solution as the binary integer problem. We prove a weaker result that leads to an efficient solution of the problem by moving the degree constraints to a penalty term in the optimization (Lagrangian relaxation), which is solved by a subgradient algorithm.

2. Correlation and the -Metric

Let be an undirected graph, where is the set of nodes and is the set of edges with size . The degree sequence of graph is the vector containing for each node the number of connections and the degrees of the nodes in . The degrees are not necessarily ascending or descending. We are mostly interested in simple connected graphs, that is, no self-loops and no multiple edges with a single component. This class of graphs with degree sequence is denoted by . The unconstrained class of graphs with self-loops, multiple edges, and possibly multiple components having degree sequence is denoted by . It is immediate that .

The degree correlation or assortative mixing of an undirected graph is defined in terms of the degree sequence as [1, 8] It is equivalent to the Pearson correlation coefficient and its value is between . The first term in the numerator calculates assortativity by degree for the graph [7]. The first term in the denominator can be interpreted as the maximal value for assortative mixing that can be obtained within the class of graphs that may have multiple connections and self-loops and need not be connected in . The second term in the numerator and in the denominator can be seen as the central point in the class of graphs in with minimal assortativity [8]. Hence, the Pearson degree correlation or assortativity can be considered as the normalized assortativity within the general class of graphs that may contain self-loops and multiple edges and need not be connected that are in (see the discussion on p. 502 of Li et al. [7] for more details).

Another insightful way of considering the degree correlation is given by van Mieghem et al. [2]. Let be the symmetric adjacency matrix with a 1 if two nodes are connected and 0 otherwise, and let be a diagonal matrix with the degrees on the diagonal and zero otherwise. The matrix is called the Laplacian matrix. Then it is shown that the degree correlation is From this version of degree correlation, it is easily seen that a regular graph has degree correlation , since all degrees are equal. Additionally, it is shown in van Mieghem et al. [2] that a connected Erdös-Renyi random graph has zero assortativity.

For a graph the -metric is defined by [7, 9] It is clear from its definition that the -metric can obtain values between and for the complete graph of size , . It is therefore convenient to normalize the -metric such that it obtains values between and . The normalized -metric of graph is defined by [7, 9] where and refer to the minimal or maximal value of in a specific class, like . The value of the normalized -metric is between . The first term in the nominator of is , which is the same as that of degree correlation above. The difference between and is the normalization. The -metric is normalized with respect to the maximum and minimum obtainable in a specific class, whereas degree correlation is always normalized by the central and maximal values of assortativity by degree within the general class of graphs having self-loops, multiple connections and being possibly disconnected in .

Example 1. We generated two topologically different graphs, shown in Figure 1. The first graph, shown in Figure 1(a), has nodes, edges, and ascending degree sequence . The other graph in Figure 1(b) has nodes, edges, and ascending degree sequence . The networks have similar degree sequence but the topology is different, as can be seen in Figure 1. However, both networks have approximately zero degree correlation (assortativity), and , respectively. This suggests that the networks are similar in topology. The normalized -metric does pick up the topological differences. The values of the normalized -metric are and , respectively, indicating that the networks can be correctly distinguished and may have a hub-like core. The values of are higher because the normalization is made within the class of simple, connected graphs, whereas the correlation coefficient is approximately zero with respect to normalization within the general class of graphs with self-loops and multiple connections that are possibly disconnected. This example shows that there are differences in degree sequence of a connected graph that are not picked up at all by degree correlation but are picked by the -metric; and the reason for this is that the normalization for the -metric is within whereas the normalization of the correlation is within the larger class .

The main practical difference between the correlation coefficient and normalized -metric is that the correlation coefficient does not distinguish certain graphs that are configurationally (topologically) different whereas the normalized -metric does distinguish between them. Alderson and Li [8] show that two networks can have a completely different topology but the correlations of both networks are approximately the same. Additionally, there is a large range of values of the coefficient of variation for which the correlation is approximately zero, whereas the -metric shows clear changes across the same range of values. There is also a set of graphs for which both the degree corruption and the normalized -metric are approximately zero (see Figure 1 in [8]). One solution to this is to compute the local assortativity [14]. Piraveenan et al. [3] show that assortative graphs can heave locally disassortative hubs, and vice versa, suggesting that local information can be relevant.

The main problem in calculating the normalized -metric identified by Alderson and Li [8] is that the normalization requires calculation of and . The algorithm proposed in Li et al. [7] orders all edges according to the weights . Nodes are then connected corresponding to this ordering as long as the degree sequence remains unchanged and the graph is connected. Such a heuristic greedy search type algorithm seems to work reasonably well for the maximum within but does not always achieve the exact degree sequence [7]. Additionally, only the maximum is obtained, not the minimum, with this algorithm [8]. The minimum is usually approximated by a lower bound, the minimum in the class of unrestricted graphs. The alternative algorithm introduced in van Mieghem et al. [2] randomly rewires two links simultaneously (leaving the degree sequence unchanged) such that nodes with the highest degree are connected and nodes with the lowest degrees are connected, increasing assortativity. Although with this algorithm the correct degree sequence is obtained, the resulting graph is not necessarily connected. In the following sections we present an integer program using a Lagrangian relaxation that obtains both and for simple, connected graphs that have exactly the specified degree sequence.

Example 2. We continue with the two graphs from the previous example with nodes shown in Figure 1. The graphs that maximize the -metric within the class of simple, connected graphs for and are shown in Figures 2(a) and 2(b). It can be seen that node degree is similar to that of neighbors, as the optimization requires. In contrast, the graphs with minimal value in Figures 2(c) and 2(d) have low degree nodes connected to high degree nodes. For the value for the graph is and the minimal and maximal values within the class are and , so that The minimal and maximal values within are and , respectively. For the value for the graph is and the minimal and maximal values within the class are and , so that The minimal and maximal values within are and , respectively. As expected the minimal values within , , were similar to the minimal values within . However, the maximal values are quite different for and , indicating the importance that the maximal value needs to be determined specifically for .

3. Linear and Integer Programming to Obtain

In this section we first give the formulation of the -metric problem for binary integer programming. We use the cutset formulation to ensure that the resulting graph is connected. We then show that in general the polytope for a linear program is not integral. However, we can relax the constraints and show that while constraining the solution to be integral, we need not constrain it to be binary, which is what we require.

The objective is to find a graph such that the minimal and maximal values of within the class of simple and connected graphs with degree sequence , , can be obtained to compute , the normalized -metric. We will show that obtaining the minimum (or maximum) can be reformulated into a binary integer program (BIP) with a linear relaxation such that a solution can be obtained within polynomial time.

3.1. Problem Formulation

The objective function is to be optimized subject to two constraints to obtain a graph in . Since maximization is equivalent to minimizing its negative, we limit our discussion to minimization. The objective function can be rewritten in terms of an incidence vector and the weights , the product of degrees for nodes and . Let denote the set of all possible edges for the nodes in (Kronecker set). Then for an edge in the set , when an edge is present and otherwise. We can then rewrite the objective function for preferential attachment as To obtain a graph in the class of simple and connected graphs with degree sequence in , we require several types of constraint. The first is that the degree sequence of the graph should be exactly . Define, for any , the cut by the partition , where is the complement of . Denote the edges in the cut by . Then is the incidence set of node , and the degree constraint can be defined as . The second type of constraint is to ensure that the graph is connected, for which we use the cutset formulation [11, 15, 16]. The idea is that for any nonempty subset of nodes at least one edge has to connect both sets of vertices in and . This implies that for any nonempty the cutset has to contain at least one edge. Finally, we require that the optimal solution is binary; that is, should be in . We now have the binary integer program (BIP) as follows: where means the integer part. The degree constraints in (10) combined with the cutset constraints (11) imply nonnegativity since for all . The cutset constraints (11) run to size since we do not need to check subsets twice. For any cut we have and so for a cut , we have that this is the same as when .

Example 3. Consider a graph with nodes and edges shown in Figure 3 (solid lines). The edge set can be considered as an instance of the incidence vector of dimension . The incidence vector in this case is For this we have degree sequence and so With nodes there are constraints for the degrees to equal , giving the degree constraints (10). For connectedness there are sets of size , and so the number of cutsets to be checked is . For this the cutsets are shown in Table 1. For example, take the first partition and . All elements in for this partition are in the first row. Since nodes 1 and 2 are in the same set , no edge is required here for connectedness; nodes 1 and 3 are in and , respectively, and so an edge is required for connectedness. This is repeated for all different partitions and . In total there are 15 constraints from the degrees and the cutset constraints.

Note that the number of constraints for this formulation is exponential in the size of the graph , because all nonempty subsets are required for connectedness, with (see, e.g., [11], p. 471). Specifically, the number of constraints to check whether all subsets of size connect to at least one other node is , where . One possibility is to change formulation to obtain a connected graph, for example, to a subtour elimination formulation, as used in minimal spanning trees (e.g., [11, 12, 15]). The subtour elimination formulation for the constraints in optimizing is However, the subtour elimination formulation is in this case inappropriate since the total number of edges can in general exceed , which means we are not dealing with a tree.

3.2. Linear and Integer Program

We are interested in designing a linear program that will result in incidence (binary) vectors such that the constraints in (10) and (11) are satisfied. We therefore need to bound the solution we obtain in to be at most 1; that is, Let  (10), (11)} be the polyhedron associated with the -metric problem. Let   (11)} be the polyhedron of the cutset constraints. The polyhedron resembles the subtour elimination polytope (SEP), associated with the symmetric traveling salesman problem [12]. The difference is that for the -metric problem the degrees are not fixed to be 2 but are equal to the original graph.

Example 4. Consider a graph with three nodes and two edges, with and ; see Figure 4(a). Here, is the incidence vector. The cutset constraints (11) and the degree constraints (10) are in this example: This is a description of in three dimensions. If we consider the degree constraints only, then we see that the only extreme point is . This is because the face has dimension , since the three degree constraints are supported and its associated matrix has rank 3 (see Figure 4(b)). Note that this is not true for other points like . It is also seen that the polytope is not integral, since the point is an extreme point. This point is in the center of the triangle in Figure 4(c).

From this example it is clear that in general we need to consider points in such that we only obtain integral solutions. Our problem is different from the traveling salesman problem approached by Held and Karp [13] as a 1-tree problem, because the degree sequence we seek for the solution is in our case fixed to the one of the original graph. It follows that any simple graph with the number of edges ≥n will not lead to a 1-tree. A general solution to the -metric problem cannot therefore be linked to a 1-tree. We can establish a weaker result than integrality of , though, which allows us to use a linear program effectively but is not guaranteed to lead to an integral result. When considering only the cutset constraints in , we find that the constraints of unity for each imply that considering the convex hull of the integral solutions will result in binary solutions.

Theorem 5. Let be the convex hull over the integer points in   (11), (16)}. An LP can be used to find the optimal solution such that

Proof. We can rewrite the polyhedron such that it is associated with a set-covering problem. For such a set-covering problem we use Proposition 6.3 of Nemhauser and Wolsey [11] which, together with the constraint from cutset (11), then proves the claim.
In a set-covering problem the edges cover all nodes and can be described by a minimization over a polyhedron with constraints of the form , where is a characteristic binary vector representing a graph indexed by . Let a set of subsets of nodes such that (intersection) for all and (minimality) if then for some [11]. The set is called a blocking clutter and is called a clutter. Then is a subset of the nodes which represents the edges that connect a partition into and its complement . For any path from to the vector if it connects one node from to another node from and 0 otherwise. Let if the edge is on a path for some node to and 0 otherwise. Then the characteristic vectors with and with are a blocking clutter and a clutter, respectively. Since a path from to for some coincides with an edge that connects to for some (intersection property), we have that for some . This means that the -metric problem is a set-covering problem , where .
If we show that the extreme points of are exactly the paths from a node to a node , represented by the vectors with , then we are done. By the intersection property we find that if , then there is an such that for all . This follows because a path from to coincides with exactly one edge for an . This shows that the incidence vectors are the extreme points of . Since all characteristic vectors are incidence vectors and so in , the claim of the theorem follows.

This result, together with the fact that  (10), (11)} is not integral, tells us that we may consider a relaxation of the -metric problem by dropping the degree constraints (10) and considering optimizing only over  (11)}. One way of doing this is to incorporate the degree constraints (10) in the objective function; this is a Lagrangian relaxation of the degree constraints. This is similar to the approach of Held and Karp [13].

4. Relaxation of the Integer Problem

The linear relaxation of the -metric problem with the cutset formulation means dropping constraint (12) that is 0/1 [17]. The LP problem is then . Linear relaxation, however, does not guarantee an integral solution, and in fact we know that is not integral (see Example 4). As in the traveling salesman problem, the combinations of the degree (equality) constraints and the cutset constraints make optimization difficult (see, e.g., [12, 13, 18, 19]). Here we consider Lagrangian relaxation of the degree constraints. We use the subgradient method to find the optimal solution with the step size for the subgradient as suggested in Held and Karp [13] (see also Fisher [18]).

4.1. Lagrangian Relaxation

We consider Lagrangian relaxation where the degree constraints (10) are considered hard and so are entered as a penalty in the function to optimize. For fixed (positive or negative) we have the Lagrangian relaxation: Since we are dealing with equality constraints of degree we have that a solution for the Lagrange multiplier is also a solution to the original IP, because for this solution. It follows that . To obtain the bound closest to the original problem, the greatest lower bound is of interest, which is the Lagrangian dual . Combining this gives the Lagrangian dual [11]: This means that we can use an LP to find the Lagrangian dual. We know from Theorem 5 that this results in a binary solution, which is required; we cannot drop the integrality constraint in general since is not integral. One way to obtain a solution to the Lagrangian dual is by subgradient optimization.

4.2. Subgradient Optimization

For differentiable functions, minimization over convex functions is relatively straightforward [20]. If is differentiable and convex, then for all , and is the gradient of at . If is a local minimum then the gradient is 0 and it follows from convexity that is also a global minimum. For nonsmooth and/or nondifferentiable functions the gradient cannot be defined everywhere [18]. In the subgradient algorithm the gradient vector is replaced by a subgradient. Let the vector be a subgradient at if for all . Since the function is piecewise linear and convex, we can define a subgradient by the degree constraints [11, 21].

The essential step in this algorithm is to determine how to change the subgradient correctly. Like in the gradient method the subgradient is adjusted at each iteration in the direction most favorable to the constraints. A sequence of subgradients is generated by We then have that when , the set of all subgradients (subdifferential), we have obtained the global minimum. The subdifferential contains 0 if the step size [22]. The most often used way to determine the step size is by the so-called Held-Karp method (see, e.g., [18, 21]): where , , and denotes the Euclidean norm. The sequence is halved whenever remains unchanged for some number of iterations [18].

The subgradient algorithm for the Lagrangian dual is presented in Algorithm 1.

(1) , , and
(2) while    do
(3) solve
     
   and is the optimal solution
(4) 
(5) , where
           
   and
(6) 
(7) end while
(8) the optimal solution is
(9) end

4.3. Computational Results

Computations were done with lpSolve (version 5.5) in [23]. The lpSolve software is a mixed integer linear programming solver that uses (revised) simplex methods for linear programming and branch and bound methods for integer programming [24].

We generated 100 connected random graphs (Erdös-Renyi) of nodes with size . Edges between each pair of nodes were determined by a probability of around 0.4 (requiring that the graph be connected), resulting in graphs with approximately 4470.

For the subgradient algorithm we used and , which was halved if the objective value did not improve [18]. The Lagrange multiplier starting value was , the maximum of degrees for all nodes.

Similar to Fisher [18] we report the percentage of problems for which the IP solution is exactly the same as the LD solution, the ratio of the average of the LD solutions and the average of the IP solutions, to indicate the sharpness of the bound, and the maximum of the subgradient, which should be (close to) 0. For the 100 simulations the percentage of exact solutions is 81.48 and the ratio is 99.96. This suggests that in many cases the result is exact and that if it is not exact then the bound using the Lagrangian dual is sharp. The subgradient was in all cases 0 or close to 0; the maximum subgradient over all simulations was , indicating that the degree constraints were satisfied in all cases.

5. Application to Psychopathology and the DSM IV

The diagnostic statistical manual (DSM) IV contains criteria to diagnose people as having certain disorders like general anxiety (GA) or major depression (MD) disorder. These criteria are a set of symptoms which need to be ascertained for a candidate patient. Many of the symptoms are part of different disorders and so it is “easy” to have multiple disorders. For instance, both GA and MD have a set of nine symptoms of which any five must be valid for a person to be suffering from that disorder. But GA and MD have four symptoms in common, and hence, many patients suffering from GA also suffer from MD (see [25] for an elaborate discussion on this).

A network can be created from the DSM IV by connecting symptoms that belong to the same disorder [6]. This network contains nodes and edges. In this network approximately of the nodes is connected, giving rise to a giant component. This giant component has nodes and edges. The network is shown in Figure 5. The range of the degree sequence is between and with median , and its distribution seems to fit an exponential distribution [6]. The degree correlation of the giant component is , while the normalized -metric is , suggesting that the graph is assortative. Again the degree correlation and normalized -metric obtain different numbers for the same graph, due to the comparison in either the general class of graphs for the degree correlation or in the restricted class of graphs for the normalized -metric.

The DSM IV graph constructed by connecting all symptoms that belong to the same disorder. The white nodes belong the giant component and the remaining gray nodes consist of components.

6. Discussion

Assortativity is for certain classes of graphs best calculated by the normalized -metric [8]. The existing algorithms by Li et al. [7] and van Mieghem et al. [2] to determine the normalized -metric are not optimal in the sense that the first one does not always obtain the desired degree sequence and the second does not necessarily result in a connected graph. Here we used a linear program to calculate the minimal and maximal value graphs with respect to the -metric. This is a binary integer program which we showed can be solved by a linear program. Any solution satisfies the constraints, and hence, the obtained minimal or maximal graph with respect to the -metric is simple and connected with specified degree.

In this paper we considered the class of simple and connected graphs with specified degree sequence. Although the ideas used here can be used for other types of graphs, generalization is not immediate for all variations. For instance, if multiple edges were allowed between any pairs of nodes, then showing that a linear program can be used is less straightforward, indicating that some solutions are difficult to find. Also, generalizations to other metrics, like shortest path betweenness, are not straightforward because to compute the shortest path length is not linear in the adjacency matrix.

Since there exists a class of graphs for which both the degree correlation and the -metric are approximately zero [8], it may be more appropriate to consider local assortativity as introduced by Piraveenan et al. [14]. In Piraveenan et al. [3] it is shown that many networks that are disassortative have many hubs that are assortative, so revealing interesting structure at a local scale.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.