Optimizing Wiener and Randić Indices of Graphs

Wiener and Randić indices have long been studied in chemical graph theory as connection strength measures of graphs. Later, these indices were used in different fields such as network analysis. We consider two optimization problems related to these indices, with potential applications to network theory, in particular to epidemiological networks. Given a connected graph and a fixed total edge weight, we investigate how individual weights must be assigned to edges, minimizing the connection strength of the graph. In order to measure the connection strength, we use the weightedWiener index and a modified version of the ordinary Randić index. Wiener index optimization is linear, while Randić index optimization turns out to be both nonlinear and nonconvex. Hence, we adopt the technique of separable programming to generate solutions. We present our experimental results by applying relevant algorithms to several graphs.


Introduction
Topological indices of graphs have served as numerical invariants of chemical structures, characterizing the topology of the chemical structure graph theoretically. In most cases, these indices were used to measure the connection strength of chemical compounds. e firstever such topological index found in the literature was the Wiener index, of which the intention was exploring thermodynamic and physiochemical properties of alkanes in terms of molecular shapes [1].Consequently, variants of the Wiener index and different other indices appeared for similar purposes, introducing a new field, chemical graph theory, into theoretical chemistry [2][3][4]. ough different indices intended for different characterizations of chemical compounds, they shared in common the notion of connection strength or compactness of the relevant graph structure. ough these indices were originally confined to the chemical graph theory, their scope has later been extended as to include other subject areas as well. e applicability of topological indices to networks beyond chemical structures was initiated with the pioneering work by Gutman and Mohar in 1996, in which it was proven that a variant of the Wiener index coincides with the Kirchhoff index of electrical networks [5]. In 2002, Otte and Rousseau further extended the scope of topological indices by using them to analyze social networks [6]. In a recent work, Imran et al. analyzed interconnection networks using topological indices [7]. All these works used topological indices to characterize existing networks with fixed vertex and edge weights in order to derive information about the network. In contrast to this, Ghosh et al. investigated how the edge weights can be assigned subject to a fixed total weight, in order to optimize a topological index, together with an application into electrical circuits [8].
is application was interpreted as assigning resistors to the edges of an electric network, subject to a total fixed sum of resistance, aimed at minimizing the total effective resistance or, analogously, maximizing the connection strength. e topological measure for the total effective resistance has been taken as the algebraic connectivity (smallest nontrivial Laplacian eigenvalue) of the relevant graph, which is proven to be closely associated with the Wiener index [5]. Interestingly, the relevant optimization problem turns out to be convex, guaranteeing efficient solvability.
Optimizing topological indices subject to different constraints in different contexts has been the subject of interest in several previous works. Most of these optimization problems were related to the chemical graph theory, in particular to the design of chemical compounds. In [9], Raman and Maranas developed an integer programming model to optimize a combination of topological indices including Wiener and Randić indices and Kier's shape index [10]. Optimizing the molecular interconnectivity index for the design of polymers had been discussed in [11], with a solution scheme for the resulting nonconvex mixed-integer linear programming formulation. A computational scheme for designing new molecules in medicinal chemistry was described in [12] by Siddhaye et al., where the first-order molecular connectivity index was optimized through an integer programming reformulation and the branch-andbound approach. An optimization problem of a different flavour in the context of chemical graph theory was considered in [13], where the simplex algorithm was used to derive optimal versions of several topological indices.
A few works on optimizing topological indices appear outside the realm of chemical graph theory as well. A concept paper by Preuß et al. [14] had proposed the optimization of Wiener and Randić indices to solve the maximum terrain coverage problem. A recent work [15] explored the possibility of optimizing the Wiener index for solving the critical node detection problem, where Benders algorithm [16] was adopted as the solution technique. An application of algebraic connectivity maximization to communication networks was discussed in [17]. e specific optimization problem considered by Ghosh et al. [8] is of particular interest and can be contrasted with the other optimization models with topological indices as the optimization is done subject to a constant edge weight sum. It is natural to seek what the nature of the problem would be if algebraic connectivity is replaced by a different topological index. Would that be an efficiently solvable optimization problem? Also, what if the objective was changed to minimizing the connection strength contrary to the electric network context? ese are not merely questions of theoretical interest; there is a useful application to epidemiological networks. Consider the transmission of a vector-borne disease throughout a geographical region. is region can be considered as a network, of which the vertices represent cities or suburbs, while the edges represent their interconnections such as roads and channels, along which the vector-borne disease transmits [18]. e weight of an edge in this network could be regarded as a measure of favorable conditions for breeding sites of vectors. It has been claimed that the rapid transmission of such a disease is largely influenced by the compactness of the network [19,20]. us, the health planners might be interested in minimizing the compactness of this network by eliminating the favorable conditions for vectors along the roads or water channels. However, this procedure is not without budgetary constraints. e total amount of budget available in the control process for eliminating vector breeding sites must be optimally utilized along the roads and channels. us, the total edge weight must be bounded by a constant. Whenever the aim is the minimization of the compactness of the epidemiological network, it is equivalent to optimizing an appropriate topological index subject to a fixed total edge weight. is is the main problem of interest in this work.
We first consider the Wiener index, which is the simplest topological index for characterizing the compactness of the network. However, in the context of epidemiological networks, a distance-based measure as Wiener index is less significant than a degree-based measure as a region with many interconnections is likely to contribute significantly to the spread of the disease. We find the degree-based topological index introduced by Randić in 1975 [21] ideal for our purpose. ough this was originally intended for measuring the extent of branching of the carbon atom in hydrocarbons, similar to the Wiener index, later developments of the Randić index have proven its applicability in different contexts [22][23][24].
Accordingly, we consider both Wiener index and Randić index to measure the compactness of the network in our optimization problem. e problem of optimizing the Wiener index turns out to be linear, thus trivially solvable. On the contrary, optimizing the Randić index is a challenging task as it turns out to be both nonlinear and nonconvex. In order to overcome the computational hardness, we adopt the technique of separable programming [25,26] and replace respective nonlinear functions by their piecewise linear approximations, eventually ending up with an approximate solution to the problem. e remainder of the paper is organized as follows. In Section 2, we reformulate the problem of minimizing the Wiener index of a graph subject to a fixed total edge weight as a linear program. In Section 3, we consider the same optimization problem by replacing the Wiener index with the Randić index, which turns out to be nonconvex. Our reformulation using separable programming techniques can be found in the same section. Section 4 contains our computational results, from which the discussion in Section 5 is motivated.

Optimizing the Wiener Index
e simplest and the pioneering topological index of graphs is the Wiener index. Consider a simple connected undirected graph G(V, E) with n vertices. en, the Wiener index W(G) of a graph G is defined as where dist(i, j) is the distance between ith and jth vertices of G. One may find several papers on finding Wiener indices of different graphs [27][28][29]. ough it is the unweighted version of the Wiener index which is used often, the vertexweighted graph version was introduced later [30], which has achieved progress in the past few years [31,32]. Furthermore, an edge-weighted version (known as the Gutman index) was introduced as a natural extension of the Wiener index [33]. We follow this as the edge-weighted Wiener index in our optimization problem. Accordingly, for a graph 2

Advances in Operations Research
G together with functions d and w, where d i is the degree of the vertex i and w ij is the weight of the edge (i, j), the weighted Wiener index is expressed as follows: Our objective is minimizing the function Z 1 � W w (G) in equation (2), subject to relevant constraints. In terms of the epidemiological network context, the sole major constraint is the availability of budget for the control process. is constraint enforces that the allocation of resources to roads and channels must be done subject to a fixed total budget. Let the total (maximum possible) budget for resources be denoted by C.
en, the relevant constraint can be expressed as Finally, the nonnegativity of w ij must be specified by It can be seen that the optimization problem given by equations (2)-(4) is linear. erefore, the solution is nontrivially obtained for Wiener index optimization.

Optimizing the Randić Index
e topological index introduced for characterizing the connection strength of chemical compounds by Milan Randić is widely known in chemical graph theory. is has been a subject of interest for graph theorists, and several works can be found on graph-theoretic aspects of the Randić index [34][35][36]. Being an elegant measure for the connection strength, this index has been applied in different contexts as well. Examples include measuring the robustness in cybernetics [22], reliability of communication networks [37], connectivity of mobile networks [38], and information content of a graph [39]. e ordinary Randić index is expressed as follows: Clearly, Randić index is a degree-based topological index, unlike the distance-based Wiener index. us, unlike Wiener index optimization which was more into theoretical interest, Randić index optimization is directly relevant to our epidemiological application mentioned in Section 1. Moreover, a reduction of the Randić index results in the reduction of the Wiener index, a fact which can be seen by comparing equations (1) and (5) [40]. e edge-weighted version of the Randić index was introduced by Araujo and De la Peña as follows [41]: Aimed at minimizing the edge-weighted Randić index, now we express the objective function to be minimized as Z 2 � R w (G), subject to the same budgetary and nonnegativity constraints given by (3) and (4), respectively. us, the problem turns out to be nonlinear. A closer look might reveal its nonconvexity. Recalling the problem of optimizing the topological index taken as algebraic connectivity turned out to be convex, a closed-form solution was obtained [8]. In contrast to this, optimizing the Randić index is a nonconvex optimization problem; thus, it is challenging to find the global optimum. Hence, instead of looking for closed-form exact solutions, we seek an approximate solution by using appropriate optimization and approximation schemes. It is not difficult to see that our objective function in equation (6) can be easily convertible to a form expressible as sums of functions of individual decision variables. is motivates us to make use separable programming technique for approximating the solution.

Separable Programming Formulation.
e method of separable programming was first introduced for constrained optimization of nonlinear convex functions, whenever these functions are expressible as sums of functions of a single variable [25]. Functions with the latter mentioned property were called separable, and later works investigated the possibility of expanding the technique to nonconvex functions as well [42,43]. Since its inception, separable programming has been a very useful optimization technique, with applications to several real problems including agricultural planning [44], linear complementarity problem [45], newsboy problem [46], and demand allocation [47].
Notice that the objective function in equation (6) is nonlinear and nonconvex. Hence, we convert the objective function to a separable form. Let From equation (6), our objective function can be restated as Since can be replaced by y r , where r ∈ 1, 2, . . . , n(n − 1)/2 { }. en, it is possible to transform the objective function to the separable form with the following constraint in the separable form: Now, the objective function can be restated as is is to be minimized subject to y r > 0, ∀r ∈ 1, 2, . . . , n(n − 1) 2 . (11f)

Linearly Approximated Program.
Notice that the constraint given by equation (11c) is nonlinear. In order to approximate by piecewise linear functions, first, we restate equation (11c) as where g r1 y r � log y r , (13a) g r3 x 2 � −log �� a s √ . (13c) Let the domain of g r1 (y r ) be the interval [C 0 , C]. en, we divide the interval into m subdivisions of length d by defining α rk as follows: where Now, a point y r ∈ [C 0 , C] can be uniquely expressed as where λ rk + λ r(k+1) � 1.
en, the piecewise linear approximation to g r1 (y r ) can be expressed as where Let the domain of g rp (x p ) be the interval [C 1 , C]. en, we divide the interval into h subdivisions of length q by defining β pl as follows: where β pl − β p(l+1) � q. (21) en, the piecewise linear approximation to g rp (x p ) can be expressed as where Now, the nonlinear program is approximated by the following problem: and at most two adjacent λ rk 's are positive. It can be seen that the linearly approximated problem given by equations (24) and (25) can be solved efficiently if the adjacency restriction is satisfied. Furthermore, it has been proven theoretically that if each individual function in the objective function is strictly convex and each individual function in constraints is convex for each relevant variable, then the solution of the linearly approximated formulation without the adjacency restriction is feasible to the original problem [26], which, however, is not the case with our problem given by equations (10) and (11). Several numerical techniques are available in the literature to overcome this issue and to find approximate solutions [42,[48][49][50]. We adopted the scheme given by Markowitz and Manne [50] to generate our computational results.

Computational Results
We implemented the algorithms using the mixed-integer programming model in SageMath. e experimentation took place over many graph structures up to 15 vertices. In particular, we tested all connected graphs up to 6 vertices. As for Wiener index optimization, despite the triviality of the formulation, some observations were of particular interest. For instance, the total weight was always assigned to a single edge of the graph. Furthermore, this edge always belonged to the edge dominating set of the graph (Table 1). is is quite natural, as the edges in the dominating set are the most significant in maintaining the connection strength of the graph, as each edge in the graph is either in the edge dominating set or adjacent to at least one edge in the edge dominating set. For instance, when the graph G 1 in Figure 1(a) was considered for Wiener index optimization, of which the results were derived making C in equation (3) equal to one, the optimal solution assigned a total weight of 1 to the edge (1, 4) in G 1 . Interestingly, this edge alone makes an edge dominating set. It is easy to see that the vertex corresponding to (1,4) in L(G 1 ) as illustrated in Figure 2 makes a dominating set. Similarly, (1, 2) in G 2 (Figure 1(c)) and (1,3) in G 3 (Figure 1(c)) were chosen which are the elements in dominating sets of their line graphs.
In contrast to this, in Randić index optimization, different weights were allocated to different edges. erefore, it is natural to ask how Randić index optimization deals with the graph symmetries. In particular, it is important to see if the edge equivalences are considered when assigning weights. erefore, we investigated the edge equivalences of these graphs to examine any possible connection to the optimal weighted assignment. Edge equivalence of graphs is defined under global symmetry relations of graphs, characterized in terms of edge automorphisms. is is defined in analogous to the notion of automorphisms in algebraic graph theory. e automorphism group of a graph G is the group formed by all structure-preserving permutations of its vertices and is denoted by aut(G). Two vertices u and v in G are said to be structurally equivalent if there is an automorphism σ in aut(G) such that σ(u) � v. Edge automorphism group of a graph G is defined as the automorphism group of the line graph L(G) of G defined as the graph obtained by associating a vertex with each edge of G and connecting two vertices with an edge if the corresponding edges of G have a vertex in common. us, the edge set of a graph can be classified into equivalence classes, in the sense of global symmetry. e respective classification of the three graphs in Figure 1 can be seen in Figure 3. Now, the question can thus be restated as follows: if two edges are structurally equivalent, does the optimal Randić index allocation assign equal weights to them? If yes, does it Advances in Operations Research Table 1: Optimal weight assignments for minimizing the Wiener index with edge dominating sets of graphs in Figure 1.

Graph
Nonzero weight assignment Edge dominating set  which implies that (0, 1) and (0, 4) are structurally equivalent edges, as illustrated in Figure 3(a). However, according to Table 2, they are allocated different weights. On the contrary, same weight has been assigned to (1,2) and (1, 4), despite they belong to a different equivalence class. erefore, it seems Randić index optimization does not reflect the global symmetry of a graph. Having said that, it must be mentioned that, during our experimentation, we encountered many graphs for which the Randić index optimization was perfectly harmonious with edge classification by equivalences. For instance, the three edge equivalence classes of G 2 (Figure 3(b)) are distinguished by the optimal allocation (Table 2), where each class is assigned its own weight unique to that class.

Discussion
Motivated by an epidemiological application and a previous work done by Ghosh et al. [8] related to electrical circuits, we considered the problem of assigning weights to edges of a graph, subject to a total fixed edge weight, with the aim of minimizing the connection strength of a graph, characterized first by the Wiener index and then by the Randić index. ough these two topological indices are closely related to each other, in particular, a change in the Randić index results in a change in the Wiener index, the two optimization problems of our consideration were far different from each other. Wiener index optimization was trivial, as it was a linear formulation, while Randić index optimization was a nonlinear and a nonconvex optimization problem. erefore, we adopted the technique of separable programming to find approximate solutions to Randić index optimization. Finally, we presented our computational experience in the sense of dominating sets and global symmetry relations of a graph.
In a theoretical point of view, interesting comparisons can be made regarding optimizations of different topological indices. Recalling the optimization of the algebraic connectivity (first nontrivial Laplacian eigenvalue) is convex, one can compare Wiener index optimization, of which the solution procedure is much simpler, and Randić index optimization, of which it is harder. is may be extended further by considering optimization of different topological indices such as the Balaban index [51,52], Harary index [53,54], Graovac-Pisanski index [55], and Hosoya index [56]. On the contrary, it is interesting to investigate how these indices are related to the global symmetry of the graph. Although topological indices are studied extensively from graph-theoretic perspectives, their relation to automorphisms has not been paid much attention. It will be an interesting future work to consider if the optimal allocation of weights for other topological indices shows any relation with edge equivalences of graphs. It is noteworthy that a recent work introduced a variant of the Wiener index, moderated in light of global symmetry of graphs as characterized by the automorphism group [57]. It is natural to expect this version to resemble the global symmetry of the graph, of which the verification is left for future research studies. Furthermore, the relation of different topological indices to the edge dominating set could also be investigated.
In a practical point of view, different epidemiological conditions might require optimization of different topological indices. In the context of rapid transmission of a vector-borne disease, as our problem of interest, resources to control the disease must be assigned to edges

Advances in Operations Research
(interconnections). Instead, if it is a slowly propagating disease, resources may be allocated to vertices (regions), which could be restated as optimization of vertex-weighted versions of these indices, instead of the edge-weighted versions we have considered. In spite of the recent trend of intelligent resource allocation when controlling epidemics [58][59][60][61], only limited works are available in the mathematical and computational epidemiology literature on utilizing the resources optimally in order to minimize the transmission rate of the disease. Future research studies in this direction might be helpful for health planners, in particular in epidemic-prone countries where limitation of resources becomes a major obstacle to the control process.

Data Availability
e data used to support the findings of this study are included within the article. Disclosure e results in this manuscript were presented at the 8th International Eurasian Conference on Mathematical Sciences and Applications.

Conflicts of Interest
e authors declare that they have no conflicts of interest.