Manuscript Offprint
arXiv:2611.06782Target PageRank: Matching Prescribed PageRank Scores via Budgeted Edge Additions
ABSTRACT
PageRank is widely used to quantify the importance of nodes in directed networks. In applications such as recommendation systems, it is increasingly important that the PageRank distribution provides a fair representation of node exposure. This motivates the problem of making minimal changes to a graph so that the PageRank values of a given set of target nodes match a desired vector . In this paper, we study this problem under an edge-addition budget , where exactly edges may be added to the graph. We show that deciding whether a multiset of exactly added edges can make the target nodes attain their desired absolute PageRank scores is NP-complete. After this, we define the TARGET PAGERANK problem in which we seek to minimize the distance between the target vector and resultant vector. We show that this optimization problem admits no polynomial-time multiplicative constant-factor approximation unless . Motivated by these hardness results, we propose two greedy heuristics for approaching the target PageRank vector. We additionally propose a Random Walk Hungarian (RWH) heuristic that addresses the addition of edges between dissimilar nodes by incorporating a penalty for such edges. Finally, we evaluate the proposed heuristics on several real-world and synthetic datasets and compare their performance in terms of PageRank accuracy, computational efficiency, and the relevance of the added edges.
1 INTRODUCTION
PageRank is a widely used measure of node importance in directed networks, originally introduced for ranking Web pages based on the structure of hyperlinks [1, 2]. The PageRank of a node depends not only on the number of incoming links but also on the importance of the nodes from which those links originate. This makes PageRank useful beyond Web search, including applications such as recommendation systems. In many such applications, however, the observed PageRank distribution of a network may not correspond to a desired distribution of importance or exposure. This motivates the problem of engineering the link structure of a network to achieve a prescribed PageRank score vector [3].
Consider a directed network , a subset of target nodes , and a vector of desired absolute PageRank scores on . We ask whether there exists a multiset of exactly edge additions that makes the resulting PageRank scores on equal to . We call this the TARGET PAGERANK problem. Unlike the traditional PageRank manipulation setting, our formulation considers a desired score vector over multiple target nodes and allows the desired PageRank values to be specified explicitly.
We first investigate the computational complexity of this problem. We show that TARGET PAGERANK is NP-complete by a reduction from a generalized balanced partition problem. Furthermore, we consider the optimization version, in which the objective is to minimize the distance between the resulting and desired PageRank score vectors on . We show that this optimization problem admits no polynomial-time multiplicative constant-factor approximation unless . This worst-case multiplicative hardness does not rule out additive guarantees or effective heuristics on particular instances.
Motivated by these hardness results, we develop three scalable heuristics. The first, GREEDY 1 (G1), exploits the exposure bias of target nodes and preferentially adds edges from over-exposed nodes to under-exposed nodes, while also considering high- and low-PageRank nodes outside the target set. The second, GREEDY 2 (G2), explicitly estimates the contribution of candidate edges to the reduction in error and greedily selects the most useful edges. Finally, RANDOM WALK HUNGARIAN (RWH) exploits the local structure of the network by identifying clusters of over- and under-exposed nodes using random walks and then uses a minimum-cost matching procedure to select edges while accounting for domain-specific similarity.
We evaluate the proposed heuristics on large real-world recommendation-induced networks constructed from Amazon product-review data, as well as synthetic power-law graphs. Our evaluation considers both the reduction in distance to the target score vector and the relevance of the newly added edges. Across our experiments, RWH generally achieves a better trade-off between PageRank error and edge similarity, while G1 is the least computationally expensive heuristic and G2 can provide improved PageRank optimization at a higher computational cost.
Our contributions can be summarized as follows:
- We formulate the TARGET PAGERANK problem, which asks whether exactly edge additions can make a specified set of nodes attain a desired absolute PageRank score vector.
- We prove that TARGET PAGERANK is NP-complete and that, unless , its -optimization variant is constant-factor inapproximable under a multiplicative guarantee.
- We propose three scalable heuristics—G1, G2, and RWH—for approximately solving the optimization problem.
- We experimentally evaluate these approaches on large real-world and synthetic networks and study their accuracy, scalability, and the relevance of the edges they introduce.
Parth Gupta , Abhinav Jain , Avishek Mukhopadhyay , Amitabha Bagchi , Sayan Ranu and Abhijnan Chakraborty
More closely related to our setting is the work of Tsioutsiouliklis et al. [6], which studies the effect of edge additions on PageRank fairness. They derive analytical expressions characterizing how adding an edge affects PageRank fairness and use these results to design efficient link-recommendation algorithms for improving fairness. Their objective is to make the allocation of PageRank weight across nodes or groups more equitable, rather than to match a prescribed PageRank score for a specified collection of target nodes. Their algorithms can identify edges whose addition improves a fairness objective and can operate in linear time in the network size [6].
Our TARGET PAGERANK problem considers a different objective: given a set of target nodes and an explicitly specified vector of desired absolute PageRank scores, we seek edge additions that make the resulting PageRank vector on those nodes match the prescribed vector. Thus, rather than optimizing a fairness measure or the PageRank of an individual node, our formulation imposes simultaneous constraints on the PageRank values of multiple target nodes. This distinction also leads to a different computational structure: we study the exact feasibility problem and the optimization problem induced by the prescribed target vector.
3 PROBLEM FORMULATION
In this section, we introduce the mathematical background for the PageRank algorithm, then define the problem statement and analyze its computability.
DEFINITION 1. (Weighted Directed Graph): A weighted directed graph is a tuple of a set of vertices and a multiset of edges , where each element is an element of .
Let and let denote the multiplicity of the edge , with for absent edges and . The input lists the vertices explicitly and stores one binary-encoded count for each ordered pair with nonzero multiplicity; zero counts are implicit. The out-degree counts outgoing edge copies.
We now define PageRank for a fixed rational damping factor , independent of the input. The experiments use . At each step, a random surfer follows a uniformly chosen outgoing edge copy with probability and teleports to a uniformly chosen vertex with probability . At a dangling node (a node of out-degree zero), the next vertex is chosen uniformly from all of V, including the current vertex. This redistribution is a transition rule and creates no graph edges. Transitions are recomputed after every edge addition: once a dangling node gains an outgoing edge, its uniform sink redistribution disappears and edge-following transitions use its actual outgoing edge multiplicities.
DEFINITION 2. (PageRank): Given a graph , its PageRank vector satisfies, for every ,
We study a network design problem in which edge additions are used to approach a target score vector on a subset . Its entries are desired absolute PageRank scores, not probabilities conditioned on membership in . Each is an exact fraction, with binary-encoded integers and . We do not require and do not renormalize scores on .
Let denote the multiset of added edges. We write for addition of multiplicities: if occurs times in and times in , it occurs times in . Thus repeated additions, including copies of existing edges, each consume one unit of budget. The budget is encoded in binary. Proposed additions are represented by binary-encoded integer counts satisfying
We use to denote the PageRank vector of , with out-degrees and dangling-node transitions recomputed on . In the algorithms below, denotes the original edge multiset and accumulates additions. These encoding conventions apply to both problems below.
PROBLEM 1. TARGET PAGERANK problem: Given a weighted directed graph , a target set of nodes , a target score vector and a budget , does there exist an addition multiset with such that for all , and for every ?
THEOREM 1. TARGET PAGERANK problem is NP-Complete.
Since Problem 1 is NP-Complete, we formulate another problem in which the objective is to minimize the distance between the target score vector and the resulting PageRank scores on T. To measure this distance we will use distance function which denotes the norm between vectors and . The subscript T denotes restriction of a vector to the target vertices.
PROBLEM 2. TARGET PAGERANK problem: Given a weighted directed graph , a target set of nodes , a target score vector and a budget , find a multiset of edges with such that for all and is minimized.
For the optimization problem, feasibility concerns only the addition constraints: an admissible addition multiset of size exists exactly when or , since repeated edges are allowed but self-loops are forbidden. For a feasible instance , write
The minimum ranges over admissible addition multisets of exactly edges. For , a multiplicative -approximation must return a feasible satisfying on every feasible instance, including those with .
THEOREM 2. Unless , the TARGET PAGE RANK problem admits no deterministic polynomial-time approximation algorithm with any fixed finite multiplicative factor .
The same result holds for every -norm with . We prove Theorem 1 and Theorem 2 in Section 9 and Section 10.
4 OPTIMAL SOLUTION USING MILP
We formulate the TARGET PAGE RANK problem as an exact mixed-integer linear program (MILP). Let denote the multiset of added edges and let be the set of permitted ordered pairs. The input multiplicities count actual edges only. For a budget , define
Throughout this section, denotes the PageRank vector after additions. The formulation uses the following variables:
• for and for are continuous PageRank and absolute-error variables.
• , for and , encode the number of added copies of in binary.
indicates whether i is dangling after additions.
is the continuous PageRank mass carried by one outgoing edge copy before damping; it is zero for dangling nodes. The continuous variable represents mass redistributed by a dangling node.
• The continuous variables linearize .
The quantities , the updated degrees , and the flows below are linear expressions in these variables. Vertex sums range over V.
The addition counts and exact budget satisfy
(3)
These constraints imply and integer multiplicities. Only off-diagonal pairs are indexed, so self-loops cannot be added.
For each , dangling status and the auxiliary bounds are enforced by
(4)
Since is a nonnegative integer, these constraints give exactly when . The unit bounds are valid because PageRank is at most one and every positive degree is at least one.
For every and , impose
(5)
When , these inequalities force ; when , they force . Thus the product is represented exactly by linear constraints. Define the flow along actual edge copies by
Outgoing mass conservation, incoming PageRank balance, and normalization are
The dangling term in (8) contributes to every vertex, including the dangling vertex itself, without introducing graph edges.
Finally, the objective and error constraints are
The minimization is subject to all the constraints and variable domains above. At an optimum, for each .
To verify equivalence, first suppose . Then , and imply . Consequently, . If , then , all outgoing flows vanish, and . Substituting these two cases into (8) gives Definition 2 on . Conversely, any admissible addition multiset and its PageRank vector satisfy the formulation by choosing the corresponding binary digits and auxiliary variables. Hence the MILP has exactly the intended feasible additions and objective values.
The formulation has variables and constraints and handles by forcing all addition bits to zero. It provides an exact optimization model without discretizing PageRank. The number of candidate pairs and the integer search can make solving large instances expensive; we therefore develop heuristics for larger graphs.
5 GREEDY 1 (G1)
First we define exposure-bias of a node and then classify them as over/under-exposed:
DEFINITION 3. (Exposure-Bias:) Given a weighted directed graph with PageRank vector , a target set of nodes and a target PageRank vector , the exposure-bias of a node is defined as
Parth Gupta , Abhinav Jain , Avishek Mukhopadhyay , Amitabha Bagchi , Sayan Ranu and Abhijnan Chakraborty
DEFINITION 4. (Over-Exposed Node): A node is over-exposed if .
DEFINITION 5. (Under-Exposed Node): A node is under-exposed if .
This algorithm aims to redirect pagerank traffic to nodes with pagerank below the target i.e under-exposed nodes. Adding an edge from a source node to target node reduces the outgoing transition probability of the existing edges and allocates a part of it to the newly added edge. Since we want to increase the PageRank of under-exposed nodes and decrease the PageRank of over-exposed nodes, selecting over-exposed nodes as candidate sources and under-exposed nodes as candidate destinations can be useful in redirecting pagerank traffic from overexposed nodes to underexposed nodes, and for prioritizing endpoints we use exposure bias as a simple criterion. We also consider high-PageRank sources and low-PageRank destinations outside the target set, allowing changes involving non-target nodes to affect target scores through the network. These choices provide an inexpensive heuristic for selecting edges without evaluating the full PageRank effect of every candidate. In our heuristics, we have a parameter k, which defines the number of edges added in each iteration. We now extend the definition of over-exposed, under-exposed, high-pagerank and low-pagerank nodes with k as a parameter.
DEFINITION 6. (OVER): Let OVER denote the set of top over-exposed nodes. Then, a node if there are fewer than nodes satisfying .
DEFINITION 7. (UNDER): Let UNDER denote the set of top underexposed nodes. Then, a node if there are fewer than nodes satisfying .
DEFINITION 8. (HIGH): Let HIGH denote the set of top high-PageRank nodes. A node if and there are fewer than nodes such that .
DEFINITION 9. (LOW): Let LOW denote the set of top low-PageRank nodes. A node if and there are fewer than nodes such that .
G1 also has a parameter which controls the fraction of edges added in each iteration from over-exposed nodes to under-exposed nodes. Similarly, it has a parameter which controls the fraction of edges added in each iteration with at least one endpoint not in target set. In each iteration, we compute , , and and add k edges between them as described in the following pseudo-code.
5.1 Time Complexity
In each iteration, we compute the list which takes time. We can compute each of the lists over, under, high and low using priority queue which takes time since there are insertions/deletions obtained in a priority queue of size almost k. Hence the time complexity of a single iteration is . Moreover, recomputing the PageRank of the graph after inserting k edges takes time, where denotes the time taken for PageRank updation after adding a single
Algorithm 1: Greedy 1 (G1)
input :Graph , PageRank vector , target set , target PageRank vector , budget
output: Edge multiset
;
for do
eb Compute the list of exposure-bias of target nodes; Compute the sets using and ;
over Reverse sorted list of ;
under Sorted list of ;
high Reverse sorted list of ;
low Sorted list of ;
head Append high to over;
tail Append low to under;
for do
;
;
;
end
;
Recompute for updated graph
end
return
edge. Since there are iterations, the final time complexity is .
6 GREEDY 2 (G2)
In this algorithm we greedily pick edges based on their individual contribution in decreasing the -norm between the target PageRank vector and the PageRank vector of graph. In order to evaluate the individual contribution of an edge , we first compute the approximate new PageRank vector of the graph by adding to the graph using algorithm for incremental PageRank update given in [7] and then calculate the resulting -norm. The decrease in -norm by adding the edge is the contribution of this edge, denoted by .
Similar to Greedy 1, in each iteration of Greedy 2 we first compute the sets , , and . We then sample edges from to and greedily choose the best edges among them, based on their individual contribution in decreasing the -norm. Here is a parameter which controls the number of edges to be sampled.
6.1 Time Complexity
In each iteration, we compute the list which takes time. We can compute each of the lists over, under, high and low using priority queue which takes time since there are insertions/deletions obtained in a priority queue of size almost . Let evaluation of contribution of an edge take
Algorithm 2: Greedy 2 (G2)
input :Graph , PageRank vector , target set , target PageRank vector , budget
output:Edge multiset
;
Empty Min-Priority Queue ;
for do
eb ← Compute the list of exposure-bias of nodes; Compute the sets using eb and ; over ← list of nodes; under ← list of nodes; high ← list of nodes; low ← list of nodes; head ← Append high to over; tail ← Append low to under; for do
Randomly sample a node from head; Randomly sample a node from tail; contrib ← ; PQ.insert({contrib, (u, v)}); if then | ; end
end
for do
; ;
end
;
Recompute for updated graph
end
return
time. Hence the time complexity of a single iteration is . Moreover, updating the PageRank of graph after inserting edges takes time. Since there are iterations, the final time complexity is .
7 RWH (RANDOM WALK HUNGARIAN)
In this algorithm we consider the local structure surrounding candidate endpoints to identify opportunities for redistributing pagerank traffic among target nodes. A destination from which random walks frequently visit under-exposed nodes may direct additional traffic toward several nodes with PageRank deficits. Similarly, a source from which random walks frequently visit over-exposed nodes is a candidate for diverting traffic away from regions with excess exposure. An edge from to may therefore help redistribute exposure in desirable way across these regions. This motivates selecting source and destination cluster centers according to random-walk visits to over-exposed and under-exposed nodes, respectively. We now define centrality score of a node, which will help identify these cluster centers.
DEFINITION 10. (Centrality Score:) For a node and a given set of nodes , simulate random walks starting from . Each of these random walks is continued until its first reset. Then is defined as the total number of visits to nodes in among the total visits in walks.
Algorithm 3 describes the procedure for computing the Centrality Score.
Algorithm 3: Centrality Score
input :Graph , start node , teleportation probability , target nodes , number of walks , max walk length
output:Centrality Score of w.r.t nodes
Function CentralityScore():
score ← 0 ; for do
cur, curlen ← , 1; if then | score ← score + 1 ; while curlen < maxlen do
Generate random number in ; if then | break ; if then | cur ← Uniformly sample a vertex from ; else | cur ← Destination of a uniformly sampled outgoing edge copy of cur ; end
if then | score ← score + 1 ; curlen ← curlen + 1; end
end
end
return score;
DEFINITION 11. (Top Over-Exposed/High-Pagerank Cluster Centers:) Let denote the set of top over-exposed / high-pagerank cluster centers. Then, an over-exposed / high-pagerank node if there are fewer than over-exposed / high-pagerank nodes satisfying w.r.t. the set of nodes .
DEFINITION 12. (Top Under-Exposed / Low-Pagerank Cluster Centers:) Let denote the set of top under-exposed / low-pagerank cluster centers. Then, an under-exposed / low-pagerank node if there are fewer than under-exposed / low-pagerank nodes satisfying w.r.t. the set of nodes .
In practice we need to keep in mind certain constraints, like we need to add edges between similar items and so on. In order to take into account domain-specific factors we now construct a complete directed weighted bipartite graph with edges from to
Parth Gupta , Abhinav Jain , Avishek Mukhopadhyay , Amitabha Bagchi , Sayan Ranu and Abhijnan Chakraborty
with cost of an edge as the domain specific factor (which is negative of item similarity in our case) and use Hungarian algorithm [8] to find the min-cost perfect matching for the above bipartite graph. The edges in the matching are then added to . Algorithm 4 describes the pseudo code for RWH heuristic.
Algorithm 4: RWH
input :Graph , PageRank vector , target set of nodes , target PageRank vector , budget ,
output:Edge multiset
;
for do
eb ← Compute the list of exposure-bias of nodes; Compute the sets using and ;
over ← Reverse Sorted list of ;
under ← Sorted list of ;
high ← Reverse Sorted list of ;
low ← Sorted list of ;
oh ← Append high to over;
ul ← Append low to under;
cs, cs ← , ;
for do
;
end
for do
;
end
head ← Top cluster centers in ();
tail ← Top cluster centers in ();
;
for do
do
;
end
end
and edge weights ;
matching ← Compute min-cost max matching for ;
for do
;
end
;
Recompute for updated graph ;
end
return
7.1 Time Complexity
In each iteration, the computation of takes time. The lists , , , can be computed in time using priority queue. The computation of centrality score in one iteration takes on an average
| Name | |V| | |E| | -norm | %Over-Exp |
|---|---|---|---|---|
| Electronics | 63001 | 630010 | 1.3669 | 8.2 |
| Books | 367982 | 3679820 | 1.0834 | 18.1 |
| Sports | 957764 | 9577640 | 1.0475 | 22.4 |
| Clothing | 2681297 | 26812970 | 1.6991 | 0.05 |
Table 1: Dataset Description and Statistics
provided there is a pre-computed hashmap for the set of nodes . The computation of head and tail can be done in using priority queue. We assume that the evaluation of domain-oriented factor of an edge takes time. Then we can construct the bipartite graph in time. Finally, a min cost max matching can be computed in time for the constructed graph. Further, recomputing the PageRank of the graph after inserting edges takes time, where denotes the time taken for PageRank updation after adding a single edge. So, the time complexity of a single iteration is . Since there are iterations, the total time complexity is .
8 EXPERIMENTAL EVALUATION
All algorithms have been implemented in C++17 using GCC 7.5.0 compiler on a system running Ubuntu 18.04.5 with a 2.1 GHz Intel(R) Xeon(R) Platinum 8160 processor and 256 GB RAM.
8.1 Datasets
For the real-world datasets, we use the Amazon product review dataset released by [9]. It comprises customer reviews and ratings for different Amazon products. For the purpose of this paper we use dataset of four different products. We apply the rating-SVD algorithm as described in [3] on these datasets to find the embedding and the top-10 RIRs for each item, and then create RIN. The details of RIN for each of the four datasets has been summarised in Table 1. We later use these embeddings to determine similarity score between items.
We observed that the generated RIN's are scale-free networks i.e node in-degrees follow a power law distribution. Figure 1 shows the plot of log of frequency vs log of in-degree. From the figure we can observe that Clothing RIN has relatively large number of hubs as compared to Electronics. We further observed that Books and Sports RIN have similar plot as Electronics.
8.2 Target Score Vector
To compute the target score vector for a RIN we assume the average user-rating of an item as the quantification of its merit/quality and use the method in [3] to estimate the desired exposure of an item. Let the average user-rating of item be and its desired absolute PageRank score be . Then we compute where is the number of nodes in RIN, C is the normalization over all vertices and is a parameter that controls the extent of importance that we attach to the merit/quality of an item. For a chosen target set , we use without renormalizing the

(a) Amazon Electronics

(b) Amazon Clothing
Figure 1: Node In-degree Distribution
selected scores on . In Table 1, we have used to list the %over-exposed nodes and the initial -norm between the original PageRank vector and the target score vector of the respective RINs. Observe that relative to other RINs, Clothing RIN has very less fraction of over-exposed nodes though their contribution to -norm is significant i.e they have much higher PageRank than desired.
8.3 Performance metric and parameters
8.3.1 Performance Metrics. To quantify the performance of our heuristics, we use the following metrics:
-
norm: For the addition multiset returned by a heuristic, we measure on the target vertices.
-
Average Similarity: To measure the relevance of an edge added by the heuristic, we compute the similarity score for it as the normalised dot product of the item embeddings represented by nodes and . Then we take the average of the similarity score of all edges added by the heuristic.
8.3.2 Input Parameters. The TARGET PAGERANK problem consists of the following input parameters:
-
Budget: We measure the performance of the heuristics for the budget values in the set of .
-
Target Nodes: We use two different target set of nodes:
(1) 2-HOP: First randomly select 10% of the nodes from and add all nodes at a distance of atmost 2 from them in . Adding 2-hop neighbours helps in representing related items.
(2) WHOLE: Take as the target set.
-
Target Score Vector: To generate different target score vectors, we use the following values of : .
-
Default Parameters: To compute the PageRank values and perform random walks we set , giving teleportation probability for all experiments. Unless mentioned, we have used Amazon Books dataset with budget as 1% of , for the target score vector and target set as the whole vertex set.
8.3.3 Hyper Parameters. The heuristics involve the following hyperparameters:
- k: This parameter controls the number of edges added in a single iteration. We have used the following values of for our experiments: of .

(a)
Figure 2: Variation With Budget
-
ou: This parameter controls the number of over-exposed and under-exposed nodes used by the heuristics. For G2 and RWH, we use the following values of : of . Whereas for G1 we use the following values of : of .
-
hl: This parameter controls the number of high PageRank and low PageRank nodes used by the heuristics. For G2 and RWH, we use the following values of : . Whereas for G1, we have .
We run a grid search on the above parameters by varying them as specified and obtain the set of parameters that give the best results.
8.4 Comparison of Heuristics
8.4.1 Variation With Input Parameters. We study the performance of heuristics on varying input parameters.
-
Budget: We evaluate the performance of heuristics against varying the budget. Figure 2 displays the results for Amazon Books dataset for the 2-HOP target set with budget values mentioned earlier. We notice that on increasing the budget, all 3 heuristics decrease the -norm. However, we notice a saturation in the decrease, i.e. we see a decrease in the rate of change of -norm on increasing the budget. We also observe that the saturation occurs faster in G1 and G2 heuristics as compared to RWH heuristic. We observe similar results for all datasets.
-
Target Nodes: We analyze the effect of changing target nodes on the performance of heuristics using the 2-HOP and WHOLE target sets on all datasets. The results are displayed in Figure 3 where in the x-axis, is used to represent the initial -norm and G1, G2 and RWH are used to represent the final -norm after running the respective heuristics. We observe that in every dataset except Clothing, RWH performs better than G1 and G2, whereas the performance of G1 is slightly better than G2. This trend is violated only in Clothing dataset when the target set is 2-HOP. This is explainable as in the Clothing dataset there are a very small number of over-exposed nodes and they have extremely high in-degree and PageRank. So, it
Parth Gupta², Abhinav Jain², Avishek Mukhopadhyay³, Amitabha Bagchi¹, Sayan Ranu¹ and Abhijnan Chakraborty³

(a) Target: 2-HOP

(b) Target: WHOLE
Figure 3: Variation with Target Sets
is highly likely that these nodes, along with the ones they are connected to are contained in the 2-HOP target set. So, 2-HOP essentially filters out the clusters in the graph and the over-exposed nodes become the cluster centers. So, RWH has no advantage over other 2 heuristics in terms of computing cluster centers to add edges. Secondly, we observed that the over-exposed nodes have so high PageRank that adding edges from them to under-exposed nodes causes the PageRank of under-exposed nodes to shoot up much beyond their target, thereby increasing the -norm. In this scenario, G2 heuristic performs better as it adds edges greedily to reduce -norm while RWH adds edges based on node similarity. Hence, G2 is expected to perform better.
- Target Score Vector: Figure 4 shows the effect of changing on the heuristics. The figure shows the plot of logarithm of -norm with . We observe that on increasing , the initial -norm first decreases, then increases. From this, we can conclude that there is a significant number of over-exposed (under-exposed) nodes with PageRank less (greater) than in our dataset. We also observe that all heuristics decrease the logarithm of -norm by similar amount in each case implying the percentage change in -norm is similar.
8.4.2 Effect on Average Similarity. We analyse the relevance of edges added by different heuristics. Figure 5 shows the plot of

(a)
Figure 4: Variation with

(a)
Figure 5: Average Similarity
Average Similarity against different heuristics for Electronics and Books dataset. We observe that RWH performs much better than the other 2 heuristics. This is because RWH finds a maximum weight matching based on edge similarity score as the weight. On the other hand, the other 2 heuristics don't add edges based on edge similarity.
8.4.3 Comparison on Scalability. Figure 6 shows the plot of logarithm of time taken by each heuristic to run v/s the logarithm of the number of nodes in each RIN. We observe that time taken by all heuristics is almost linear with the graph size. Hence, they all scale well. However, we observe that G2 takes significantly more time than RWH, and RWH takes slightly more time than G1. This is expected because in G2, to choose the edges greedily we need to compute the change in -norm for each of them, whereas in RWH no such computation is required and finding cluster centers and max matching is much cheaper. On the other hand, G1 only requires sorting nodes based on their over/under-exposure and their PageRank values before adding edges, making it least computationally expensive.

(a)
Figure 6: Time Taken
8.5 Effect of Hyper-Parameters
We study the effect of hyper-parameters on the performance of heuristics.
8.5.1 Variation with . In Figure 7(a) we observe that on increasing , the average similarity for RWH heuristic increases. This is because more nodes are present for matching and there is more scope to increase total similarity by finding maximum weight matching. We didn't observe any noticeable change for G1 and G2 since these heuristics don't consider edge similarity while adding edges.
In Figure 7(b) we observe that on increasing , the time taken by the RWH decreases. This is because finding maximum matching plays a significant role in the total time taken by RWH heuristic. There was no significant impact of on the time taken by G1 and G2, because the computationally expensive steps in them are independent of .
On changing within the specified range, there was no noticeable trend in change of -norm in any of the heuristics.
8.5.2 Variation With . Figure 8 displays the performance of G1, G2 and RWH heuristic for various values of on Amazon Books dataset. We observe in each case there is a sweet spot in , i.e. the -norm first decreases, then increases. This can be explained as follows:
-
RWH finds clusters of over and under exposed nodes. When the value of is too small, the heuristic doesn't get sufficient nodes to find good clusters. On the other hand, when the value of is too high, many over/under exposed nodes are given to the heuristic and cluster finding is influenced by nodes that aren't too over/under exposed. This reduces the quality of cluster centers and hence decreases the performance of the heuristic.
-
Since G1 and G2 choose edges from over-exposed to under-exposed nodes greedily, using too few nodes will cause some good nodes to not be used for edge additions. As in the case of RWH, a high value of will cause too many nodes to be picked because of which the quality of the random edges selected will suffer.

(a) Average Similarity

(b) Time Taken
Figure 7: Variation with (No. of Cluster Centers)
8.5.3 Variation With . Figure 9 displays the performance of G2 and RWH heuristic for various values of on Amazon Books and Amazon Sports dataset on 2-HOP target set. We observe that on changing , there is little effect on performance RWH. This signifies that the high/low PageRank nodes aren't as good cluster centers as over/under exposed nodes. This is explainable because in the 2-HOP target set, an over-exposed (under-exposed) node is likely to be surrounded by other over-exposed (under-exposed) nodes increasing its chances to become a cluster center. Hence, the participation of nodes in edge additions is less in RWH. We also see that the effect on G2 is more prominent and the trend is dataset dependent. This is because in some datasets like Clothing adding edges from nodes in target set (over/under-exposed nodes) to nodes out of target set (high/low PageRank nodes) will have more reduction in -norm than adding edges from over-exposed to under-exposed nodes. Hence the participation of nodes in additions is more in G2.
Overall, we found that the effect of over/under-exposed nodes is more dominant than high/low PageRank nodes in each of the heuristics.
8.6 Experiments on Synthetic Datasets
We perform experiments on synthetic datasets to verify the consistency in performance of our heuristics.
Parth Gupta2, Abhinav Jain2, Avishek Mukhopadhyay³, Amitabha Bagchi¹, Sayan Ranu¹ and Abhijnan Chakraborty³

(a) G1

(b) G2 and RWH
Figure 8: Variation With ou

(a)
Figure 9: Variation With hl
8.6.1 Graph Generation. We have used the Barabasi-Albert model [10] to generate directed graphs that follow power law for node indegrees and have constant out-degree. We fix the number of nodes in the graph to be 50000 and the out-degree of each node as 10. The graph is generated as follows:
(1) Start with a network of 10 nodes (no edges).
(2) Add new nodes. For each new node added, add edges as follows:
-
With probability , add an edge from the new node to 10 randomly chosen existing nodes.
-
With probability , the new node connects to existing nodes chosen with probability proportional to their indegrees.
It is shown in [11] that the above process generates a graph following power law with in-degree distribution where , which implies that on increasing power law exponent increases thereby making the graph more uniform.
8.6.2 Target Score Vector Generation. We generate scores on all vertices by adding Gaussian noise to their original PageRank as follows:
(1) Compute the original PageRank distribution of the graph .
(2) Sample i.i.d random variables for each node .
(3) Compute the score vector where , with normalizing over all of and controls the weight of noise added.
For either target set, use without renormalizing on . We now study the effect of varying the power law exponent and target score vector:
- Varying : We use and keeping . The results are shown in Figure 10. We observe that in 2-HOP target, RWH performs worse than G2 for , whereas performance of G1 is mostly similar to G2. Notice that on decreasing the value of , the graph will display a sharper power law exponent. Hence, there will be a small number of nodes with high in-degree and the graph becomes similar to Clothing dataset. So, the reason for the observed behaviour is similar to the one described for Amazon Clothing in Section 8.4.
We also observe that for , both G1 and G2 perform better than RWH. This further verifies the fact that RWH doesn't get an advantage in finding clusters using random walks due to the structure of the graph. Choosing edges based on -norm gives G1 and G2 an advantage over RWH in this case.
- Varying : We use in the set keeping . Figure 11 shows the plot of logarithm of -norm with the heuristic used. On increasing , we observe that the initial -norm increases as we are increasing the weight of noise in computing the target score vector. However, for each heuristic, the decrease in logarithm of -norm is almost the same for each implying the percentage decrease in -norm to be nearly same.
9 CONCLUSION
In this paper, we studied the problem of modifying the PageRank values of a fixed set of target nodes to match a given target PageRank vector, subject to a budget of exactly edge additions. We established that the corresponding decision problem is NP-complete. We

(a) Target: 2-HOP

(b) Target: WHOLE
Figure 10: Variation with p

(a) Target: 2-HOP

(b) Target: WHOLE
Figure 11: Variation with
then showed that minimizing the -distance between the resulting and desired absolute PageRank scores on the target nodes admits no polynomial-time multiplicative constant-factor approximation unless P = NP. We also formulated the problem as a mixed-integer linear program (MILP), while noting the scalability limitations of this approach. Motivated by these computational challenges, we proposed multiple heuristics, including methods that incorporate node similarity when selecting edges to add, and evaluated their performance on multiple Amazon datasets.
In future work, we aim to compare the performance of our heuristics against the optimal MILP solution on smaller graphs. We also plan to apply our heuristics to item recommendation and investigate whether the modified recommendations better reflect user preferences, as measured through user reviews, when the target set of nodes and target PageRank vector are chosen appropriately.
10 PROOF OF THEOREM 1

Figure 12: Gadget used for reduction
We will extend the reduction performed by [4] to TARGET PAGERANK Problem. We first define a general version of partition problem as follows:
PROBLEM 3. -Balanced Partition Problem: We are given a vector of positive integers with and a multiset of positive integers. All integers are encoded in binary, and each occurrence of an item has its own index. Let denote the sum of elements of multiset . Does there exist a partition of such that and for all ?
THEOREM 3. -Balanced Partition Problem is NP-complete, even when and .
PROOF. A certificate assigns each indexed occurrence to a block using bits. Block sums, cardinalities, and the defining cross-products have polynomial bit length and can be computed and checked in polynomial time, proving membership in NP.
For NP-hardness, reduce from the NP-complete BALANCED PARTITION problem [12, p. 404], which requires two blocks of equal cardinality and equal weight sum. Retain every indexed item and its positive integer weight, including repeated values, and set and . Since , this is a valid instance, whose constraints are exactly and . The instances therefore have identical answers. This polynomial-time identity reduction proves NP-hardness for the stated restriction.
We prove Theorem 1 by reducing it from the -Balanced Partition Problem restricted to . The excluded case is trivial: the sole partition block contains every item.
We will use the weighted directed graph shown in Figure 12 as a gadget in our reduction. It has item nodes and center nodes , so . Let be a positive integer. For each , add a batch of copies of , and for each , add a batch of copies of . Add another batch of copies in each of the directions and . These batches are additive: when , they give copies of and copies of . No self-loops are introduced. For every and , include copies of . Write for the total item weight, distinct from the multiset . Each center has out-degree , and every item is initially dangling. All multiplicities are stored as binary counts.
We claim that analogous lemmas will hold for as for the gadget used in [4]. For any vertex subset , write for its total PageRank mass. The notation continues to denote the restricted vector, as in Section 2.
DEFINITION 13. An addition multiset of size is sum-optimal if for every , it contains an edge for some .
Since , a sum-optimal multiset contains exactly one outgoing edge copy from each item to a center and no other additions. Thus its item-to-center groups partition , and no dangling nodes remain after these additions.
Parth Gupta , Abhinav Jain , Avishek Mukhopadhyay , Amitabha Bagchi , Sayan Ranu and Abhijnan Chakraborty
LEMMA 1. Consider an addition multiset that is sum-optimal. Then,
PROOF. Observe that the only nodes that link to a node in are in , and all use a fraction of their links on . Also note that random teleportation contributes a page rank value of to each node. Since the sum of page ranks of nodes in is , the following equation holds:
Rearranging the terms gives the desired result.
LEMMA 2. Let x satisfy the inequality
Let be any sum-optimal addition multiset of size m and let L be any admissible addition multiset of size m which is not sum-optimal. Repeated copies, including copies of existing edges, are allowed in L. Then the following holds:
PROOF. Since is not sum-optimal, some has no outgoing edge to . Teleportation contributes to its PageRank. The existing edges from the centers to also carry positive mass, so . Consider the following cases for :
- u is a sink: In this case, u will spread fraction of its page rank value equally among all nodes in the graph. Hence,
- u is not sink: In this case, u will have outgoing edge(s) to nodes in N only. So, u will spread fraction of its page rank among nodes in N. Hence,
Combining the above inequalities, we have
From Lemma 1 we have the following equality:
Now observe that for to hold, we need . By using (12) and (13) and the fact that , this holds whenever which is true by the condition given in Lemma 2.
LEMMA 3. Let be an arbitrary sum-optimal addition multiset, then define and . Let be positive integers such that and suppose satisfies
Then the following 2 statements are equivalent:
(1) For all such that , , we have and
(2) For all such that , , we have
PROOF. The center PageRank equations are given below. When c = 2, the two neighbor terms in each equation refer to the same center and count the two additive batches; there are no interior-center equations.
For all i such that 1 < i < c, we have:
For all i such that , we have:
1 2: Assume that and for a sum-optimal addition multiset . Then using (17) we get .
2 1: Using (17) and the fact that we get the following equation:
If then we have
Now for equation (18) to hold we must have which implies that and . Hence the Lemma 3 holds.
LEMMA 4. For the network G given in Fig 12 and sum-optimal addition multisets of size m, there exists a bijective function , depending only on G, which maps the group-mass vector to the center PageRank vector .
PROOF. Write and , viewed as column vectors. Since is sum-optimal, it changes no outgoing edges of the centers and leaves no dangling nodes. Define the matrix by
where is the multiplicity in G. Thus column j records the edge-following probabilities from to the centers, before damping. Each column sums to . For c = 2, the additive batches give and .
Let , let be the all-ones vector, and let be the identity matrix. Equations (14)–(16) are exactly
Because R is nonnegative, its induced matrix 1-norm satisfies
If , then , so
The strict bound forces z = 0. Hence the square matrix is invertible, and the center equations have a unique solution for every b.
Since , the affine map and its inverse are
For fixed , their coefficients depend only on , not on . Restricting to the group-mass vectors realized by sum-optimal additions gives the claimed bijection onto the corresponding center PageRank vectors.
We are now ready to prove Theorem 1.
PROOF. Consider an instance of -Balanced Partition with and a nonempty item multiset , so . Let be the binary input length and set . Choose the gadget parameter explicitly as
Then is a positive integer and , so both strict bounds in Lemmas 2 and 3 hold. Since is fixed and rational, and can be computed exactly in polynomial bit time, and
The explicit item and parameter lists give , and also has polynomially many bits. Construct as above with vertices and at most nonzero ordered-pair multiplicities. Store one binary count per such pair, including the count 2x for each center-to-center direction when c = 2; do not enumerate edge copies. Thus , the target set , and the budget have polynomial encoding size and are constructible in polynomial bit time.
To define the targets, let be the right-hand side of (11) and set . The desired group masses have total and satisfy the proportionality conditions in statement 2 of Lemma 3, so they are
Using R and from Lemma 4, define the target score vector by
The numerator defining lies in and its denominator exceeds one, so and . Set . Since and , the convergent series is entrywise nonnegative. Thus entrywise. Moreover, . Writing and summing the target equations gives
where and the definition of gives . Since , we obtain and for every . The targets are therefore valid absolute scores on , without renormalization, even when no balanced partition exists.
The numerators and denominators of , , and all coefficients of this nonsingular system have polynomial bit length in . Multiplying the system by the product of its coefficient and right-hand-side denominators yields an integer augmented system with polynomial-bit entries. In general, for a integer system whose augmented entries have at most bits, every minor has magnitude at most and therefore bits. Cramer's rule expresses each solution entry as a ratio of two such determinants. Each determinant can be computed by fraction-free Gaussian elimination with pivoting using polynomially many integer operations: its stored entries are minors, and its temporary products and exact divisions also involve only polynomial-bit integers. Consequently, the exact rational targets have polynomial encoding length and can be computed in polynomial bit time. This establishes the required construction-size and arithmetic bounds.
Now we will show that there exists a -balanced partition of if and only if there exists a solution to the TARGET PAGERANK instance.
- Suppose form such a balanced partition. Track individual occurrences by partitioning their indices as , where . Define the addition multiset
Each indexed item contributes exactly one edge, so , no self-loops are added, and is sum-optimal. Equal-valued occurrences remain distinct. By Lemmas 3 and 4, for every . Hence is a solution of the TARGET PAGERANK instance.
- Suppose there exists a solution to the TARGET PAGERANK instance. Since , attaining the targets gives . A sum-optimal multiset always exists, for example by adding for every . By Lemmas 1 and 2, every non-sum-optimal addition multiset of size has center mass strictly below . Hence is sum-optimal. Its groups , , therefore partition the item indices . Lemmas 3 and 4 give, for all ,
Define
These are multisets of item occurrences, not their numerical sums. They partition , and and . Thus they form the required balanced partition.
Parth Gupta , Abhinav Jain , Avishek Mukhopadhyay , Amitabha Bagchi , Sayan Ranu and Abhijnan Chakraborty
It remains to establish membership in NP in the binary encoding of Section 2. Let be the input length of an arbitrary instance . Since the vertex list is explicit, . A certificate consists of the counts for the ordered pairs with , in a fixed order induced by the vertex list, with implicit. Every feasible count is at most B, so the certificate uses bits, including when B = 0, and is polynomial in . The verifier checks that the counts are nonnegative integers, that each is at most B, and that their sum is exactly B.
Without expanding edge copies, form and . These integers have bits. Recompute the edge-following transition matrix Q, with destinations indexing rows and sources indexing columns, by
Thus a formerly dangling node uses only its actual outgoing edges once . Every column of sums to one, so . The same kernel argument as in Lemma 4 shows that is invertible. The verifier computes as the exact rational solution of
where the identity and all-ones vector now have dimension n.
For an explicit arithmetic bound, write the fixed damping factor as with positive integers . Multiplying this system by
clears every denominator, including dangling-node and teleportation terms. The empty product is one. The integer has bits, and the resulting integer augmented entries have the same bit bound. Applying the determinant and fraction-free elimination bounds above with bounds every solution numerator and denominator by bits and permits computation in polynomial bit time. Finally, the verifier checks nonnegativity and normalization as in Definition 2, and compares with the input fraction for each by integer cross-multiplication. All comparisons are exact and have polynomial bit cost; no numerical tolerance is used. Every yes instance has a polynomial-size certificate accepted by this verifier, and acceptance guarantees a feasible solution. This proves membership in NP.
COROLLARY 1. The variant of Problem 1 allowing an addition multiset with , with all other conventions unchanged, is NP-complete even when .
PROOF. Use the construction of Theorem 1 with , , and . Let and . The chosen satisfies , while Lemma 1 gives with .
If an addition multiset has , some item remains dangling, since each added edge has only one source. Its PageRank is at least , and its edge-following transition assigns probability to . Summing PageRank over and retaining only teleportation
and this dangling-node contribution yields
Thus , so fewer than additions cannot attain the targets. Exact-budget solutions are still allowed, and every solution with at most additions must use exactly . The same polynomial-time reduction therefore proves NP-hardness.
Membership in NP uses the binary count certificate and exact rational verifier from Theorem 1, replacing only the budget check by . Each count is still at most , so the certificate-size and arithmetic bounds are unchanged.
11 PROOF OF THEOREM 2
PROOF. Fix a finite constant and suppose that a deterministic polynomial-time multiplicative -approximation algorithm exists. Start with an instance of the NP-complete restriction of Balanced Partition with and used in Theorem 1. An empty item multiset is trivially a yes-instance and can be handled directly. Otherwise, apply the polynomial-time construction in Theorem 1 to obtain with items, vertices, and .
The optimization instance is always feasible: adding one edge for each item uses exactly edges and introduces no self-loops, whether or not the source instance has a balanced partition. There are finitely many feasible addition count vectors, so the minimum OPT() defined in Section 2 is attained. The equivalence established in Theorem 1 gives
Run the assumed approximation algorithm on I. Its output is an addition multiset represented by binary-encoded counts satisfying
Feasibility, nonnegativity of the objective, and the multiplicative guarantee, including at zero optimum, imply
Thus if and only if .
This zero test is computable in polynomial bit time. As shown in the NP-membership argument for Theorem 1, the counts use bits. Without expanding edge copies, add the multiplicities and recompute all out-degrees and dangling-node transitions as in Section 2. For the fixed rational damping factor, the same verifier solves the PageRank system exactly with polynomial-bit rational arithmetic and checks for every by integer cross-multiplication. These equalities hold exactly when ; no numerical tolerance is used.
Accept the source instance if and only if this exact zero test succeeds. The construction, approximation algorithm, and verification all run in polynomial bit time, so this decides the NP-complete source problem in polynomial time. It follows that , proving the stated conditional inapproximability result.
REFERENCES
[1] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank citation ranking: Bringing order to the web. Technical Report 1999-66, Stanford Digital Library Technologies Project, 1999.
[2] Sergey Brin and Lawrence Page. The anatomy of a large-scale hypertextual web search engine. Computer Networks and ISDN Systems, 30(1-7):107–117, 1998.
[3] Abhisek Dash, Abhijnan Chakraborty, Saptarshi Ghosh, Animesh Mukherjee, and Krishna P. Gummadi. Fairir: Mitigating exposure bias from related item recommendations in two-sided platforms. IEEE Transactions on Computational Social Systems, 2022.
[4] Martin Olsen. The computational complexity of link building. In Computing and Combinatorics, volume 5092 of Lecture Notes in Computer Science, pages 119–129. Springer, 2008.
[5] Martin Olsen and Anastasios Viglas. On the approximability of the link building problem. Theoretical Computer Science, 518:96–116, 2014.
[6] Stefanos Tsioutsiouliklis, Evaggelia Pitoura, Konstantinos Semertzidis, and Panayiotis Tsaparas. Link recommendations for pagerank fairness. In Proceedings of the ACM Web Conference 2022, pages 3541–3551. Association for
Computing Machinery, 2022.
[7] Bahman Bahmani, Abdur Chowdhury, and Ashish Goel. Fast incremental and personalized Pagerank. Proceedings of the VLDB Endowment, 4(3):173–184, 2010.
[8] Harold W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1–2):83–97, 1955.
[9] Ruining He and Julian McAuley. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In Proceedings of the 25th International Conference on World Wide Web, WWW '16, pages 507–517, 2016.
[10] Albert-László Barabási and Réka Albert. Emergence of scaling in random networks. Science, 286(5439):509–512, 1999.
[11] Ravi Kumar, Prabhakar Raghavan, Sridhar Rajagopalan, D. Sivakumar, Andrew Tomkins, and Eli Upfal. Stochastic models for the web graph. In Proceedings of the 41st Annual Symposium on Foundations of Computer Science, FOCS '00, pages 57–65, 2000.
[12] Gary William Flake, Robert E. Tarjan, and Kostas Tsioutsiouliklis. Graph clustering and minimum cut trees. Internet Mathematics, 1(4):385–408, 2004.