Dense Subgraph Discovery Meets Strong Triadic Closure Chamalee Wickrama Arachchi, Iiro Kumpulainen, Nikolaj Tatti Abstract . Finding dense subgraphs is a core problem with numerous graph mining applications such as community detection in social networks and anomaly detection. However, in many real-world networks connections are not equal. One way to label edges as either strong or weak is to use strong triadic closure (STC). Here, if one node connects strongly with two other nodes, then those two nodes should be connected at least with a weak edge. STC-labelings are not unique and finding the maximum number of strong edges is NP -hard. In this paper, we apply STC to dense subgraph discovery. More formally, our score for a given subgraph is the ratio between the sum of the number of strong edges and weak edges, weighted by a user parameter λ \lambda , and the number of nodes of the subgraph. Our goal is to find a subgraph and an STC-labeling maximizing the score. We show that for λ = 1 \lambda=1 , our problem is equivalent to finding the densest subgraph, while for λ = 0 \lambda=0 , our problem is equivalent to finding the largest clique, making our problem NP -hard. We propose an exact algorithm based on integer linear programming and four practical polynomial-time heuristics. We present an extensive experimental study that shows that our algorithms can find the ground truth in synthetic datasets and run efficiently in real-world datasets. Conference: Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining; August 25–29, 2024; Barcelona, Spain Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’24), August 25–29, 2024, Barcelona, Spain DOI: 10.1145/3637528.3671697 ISBN: 979-8-4007-0490-1/24/08 CCS: Theory of computation Graph algorithms analysis 1. Introduction Many social networks naturally contain both strongly connected and weakly connected interactions among the entities of the network. A question of particular interest is that given a set of pairwise user interactions, how to infer the strength of the social ties within the network? In other words, how to label the edges of an undirected graph as either strong or weak? The problem of inferring the strength of social ties based on strong triadic closure principle (STC) has drawn attention over the past decade within the data mining community ( Sintos and Tsaparas, 2014 ; Rozenshtein et al., 2017 ; Adriaens et al., 2020 ; Oettershagen et al., 2022 ; Konstantinidis et al., 2018 ; Matakos and Gionis, 2022 ) . The STC property assumes that there exist two types of social ties in the network: either strong or weak . Let A,B , and C be three entities in the network. If the entities A and B are strongly connected with the entity C , then there should be at least a weak connection between A and B . In other words, if both A and B are strong friends of C , then some kind of connection between A and B should also exist. Note that these labels are not known and the goal is to infer the labels from the given unlabeled graph. In this paper, we incorporate the STC property into the problem of dense subgraph discovery ( Sintos and Tsaparas, 2014 ; Goldberg, 1984 ) . More formally, given a subgraph and a weight parameter \lambda , we define a score as the ratio between the sum of the number of strong and weak edges weighted by \lambda and the number of nodes within the subgraph. Our objective is to find a subgraph and a labeling that maximize our score while satisfying the STC property within the subgraph. We will see that when \lambda=0 finding an optimal subgraph is equal to finding a maximum clique. On the other hand, for \lambda=1 , finding an optimal subgraph is equal to finding the densest subgraph, that is, a subgraph U maximizing the ratio of edges and nodes, {\left|E(U)\right|}/{\left|U\right|} . Both of these problems are well-studied. Optimizing the score for 0<\lambda<1 , yields a problem that is between these two cases. We expect that for small \lambda s the returned subgraph resembles a clique whereas large \lambda s yield a subgraph similar to the densest subgraph. (a) (b) (c) Figure 1 . Strong (Red) and weak (Blue) edges of the Karate club dataset maximizing the number of strong edges (a), \lambda=0 (b), and \lambda=0.5 (c) using our integer linear program based algorithm ( STC-ILP ). We define our score as the sum of the number of strong and weak edges weighted by a parameter \lambda , divided by the size of the subgraph. The scores are 2.0 and 2.06 for (b) and (c), respectively. We see that (b) is a clique of size 5 . Example: We illustrate the difference between our problem and the original STC problem considered by Sintos and Tsaparas (2014) in Figure 1 . The goal of this paper is to find a subgraph that maximizes our score while satisfying the STC property. In contrast, Sintos and Tsaparas (2014) aims to label all the edges in the graph such that the number of weak edges is minimized. Figure 1 shows the results obtained with the Karate club dataset with our exact algorithm. We should stress that the labeling of the discovered subgraph might be different from the labeling that maximizes strong edges for the whole graph. In Figure 1 (c), we see that 4 weak edges have been turned into strong while the labeling of the remaining edges is unchanged. We show that our problem is NP -hard when \lambda<1 , and even inapproximable when \lambda=0 since our problem then reduces to the Max-Clique problem. However, the \lambda=1 case is solvable in polynomial time. To solve the problem, we first propose an exact algorithm based on integer linear programming which runs in exponential time. We consider four other heuristics that run in polynomial time in the size of the input graph: We propose a linear linear programming based heuristic in Section 5.2 and a greedy algorithm in Section 5.4 . We also propose two straightforward algorithms that combine the existing algorithms for solving the densest subgraph problem and finding STC-compliant labeling in an entire graph. The remainder of the paper is organized as follows. First, we introduce preliminary notation and our problem in Section 2 . Next, we present the related work in Section 3 . Next, we show that our problem is NP -hard in Section 4 and then explain our algorithms in Section 5 . Finally, we present our experimental evaluation in Section 6 and conclude the paper with a discussion in Section 7 . 2. Preliminary notation and problem definition We begin by providing preliminary notation and formally defining our problem. Our input is an unweighted graph G=(V,E) , and we denote the number of nodes and edges by n={\left|V\right|} and m={\left|E\right|} . Given a graph G=(V,E) and a set of nodes U\subseteq V , we define E(U)\subseteq E to be the subset of edges having both endpoints in U . We denote the degree of vertex v as \deg(v) . We denote the set of adjacent edges of vertex v as N(v) . We want to label the set of edges E as either strong or weak . To perform the labeling, we use the strong triadic closure (STC) property ( Sintos and Tsaparas, 2014 ) . We say that the graph is STC satisfied if for any given triplet of vertices, (x,y,z) the following holds: if (x,y) and (y,z) are connected and are labeled as strongly connected, then the edge (x,z) always exists at least as a weak edge. We call a triplet of vertices (x,y,z) a wedge , if (x,y)\in E , (y,z)\in E , and (x,z)\notin E . A wedge graph Z(G) consists of the edges of the graph G that contribute to at least one wedge as its vertices. If the two edges e_{1} and e_{2} of G form a wedge, we add an edge between the two nodes in Z(G) that corresponds to e_{1} and e_{2} , that is, each edge of Z(G) corresponds to a wedge of G . Given a graph G=(V,E) and a labeling L of the edges as strong or weak, we write E_{s}(U,L) and E_{w}(U,L) to be the set of strong and weak edges of the graph induced by a set of vertices U . We also write m_{s}(U,L)={\left|E_{s}(U,L)\right|} and m_{w}(U,L)={\left|E_{w}(U,L)\right|} . Finally, for a vertex u\in U , we define a strong and weak degree, \deg_{s}(u,U,L) and \deg_{w}(u,U,L) to be the number of strong or weak edges in U adjacent to u . We may omit L or U from the notation when it is clear from the context. Given a weight parameter \lambda where \lambda\in[0,\;1] and a label assignment L , we define a score \mathit{q}\mathopen{}\left(U,L;\lambda\right)=\frac{m_{s}(U,L)+\lambda m_{w}(U,L)}{{\left|U\right|}}\quad. We may omit L or \lambda when it is clear from the context. We consider the following optimization problem. Problem 1 (stc-den). Given a graph G=(V,E) and a weight parameter \lambda , find a subset of vertices U\subseteq V and a labeling L of the edges as strong or weak such that the STC property is satisfied in (U,E(U)) and \mathit{q}\mathopen{}\left(U,L;\lambda\right) is maximized. Note that when \lambda=1 then the labeling does not matter, and stc-den reduces to dense subgraph discovery, that is, finding U with the largest ratio {\left|E(U)\right|}/{\left|U\right|} . On the other hand, if \lambda=0 , then we only take into account strong edges; we will show in Section 4 that in this case, stc-den is equal to finding a maximum clique. Note also that the labeling depends on the underlying subgraph U , that is, we need to find U and L simultaneously. 3. Related work The strong triadic closure (STC) property: As an early work in this line of research, Sintos and Tsaparas (2014) considered the problem of minimizing the number of weak edges (analogously maximizing the number of strong edges) while labeling the edges compliant with the STC property. We will refer to this optimization problem as MinSTC . Sintos and Tsaparas (2014) showed that MinSTC is equivalent to solving a minimum vertex cover, which we denote by Min-Vertex-cover , in a wedge graph Z(G) . In Min-Vertex-cover , we search for a minimum number of nodes such that at least one endpoint of each edge is in the set. Sintos and Tsaparas (2014) proposed the following algorithm for MinSTC , which we denote by Apr-MinSTC . Given a graph G they first construct the wedge graph Z(G) and find its vertex cover. Next, they label the set of edges of G that corresponds to the set of vertices in the vertex cover as weak, and the remaining edges as strong. Since Min-Vertex-cover is NP -hard, they approximate it with a maximal matching algorithm ( Clarkson, 1983 ) . The algorithm picks an arbitrary edge and adds both endpoints of the edge to the cover, and the edges incident to both endpoints are deleted. It continues until no edges are left. This algorithm outputs a maximal matching which is known to yield a 2 -approximation since at least one endpoint should be in the cover. The problem of finding a labeling of edges that maximizes the number of strong edges while satisfying the STC property is NP -hard for general graphs ( Sintos and Tsaparas, 2014 ) and split graphs ( Konstantinidis and Papadopoulos, 2020 ) . Nevertheless, it becomes polynomial-time solvable for proper interval graphs ( Konstantinidis and Papadopoulos, 2020 ) , cographs ( Konstantinidis et al., 2018 ) , and trivially perfect graphs ( Konstantinidis and Papadopoulos, 2020 ) . Given communities, Rozenshtein et al. (2017) considered the problem of inferring strengths while minimizing STC violations with additional connectivity constraints. Oettershagen et al. (2022) extended the idea of inferring tie strength for temporal networks. Matakos and Gionis (2022) considered the problem of strengthening edges to maximize STC violations, which they consider as opportunities to build new connections. Adriaens et al. (2020) formulated both minimization and maximization versions of STC problems as linear programs. The dense subgraph discovery: Finding dense subgraphs is a core problem in social network analysis. Given a graph, the densest subgraph problem is defined as finding a subgraph with the highest average degree density (twice the number of edges divided by the number of nodes). Finding the densest subgraph for a single graph has been extensively studied ( Goldberg, 1984 ; Charikar, 2000 ; Khuller and Saha, 2009 ) . Goldberg (1984) proposed an exact, polynomial time algorithm that solves a sequence of min-cut instances. We will refer to this algorithm as Cut . Asahiro et al. (2000) provided a greedy algorithm and Charikar (2000) proved that their greedy algorithm gives a 1/2 -approximation, showed how to implement the algorithm using Fibonacci heaps, and devised a linear-programming formulation of the problem. The idea of the greedy algorithm is that at each iteration, a vertex with the minimum degree is removed, and then the densest subgraph among all the produced subgraphs is returned as the solution. We will refer to this algorithm as Peel . It has also been extended for multiple graph snapshots ( Jethava and Beerenwinkel, 2015 ; Semertzidis et al., 2019 ; Arachchi and Tatti, 2023 ) . The problem has been studied in a streaming setting ( Bhattacharya et al., 2015 ) . To the best of our knowledge, this is the first attempt to consider the notion of density together with the STC property. In addition to degree density (a.k.a average degree), alternative types of density measures have also been considered previously such as triangle density and k -clique density ( Tsourakakis, 2015 ) . Triangle density is defined as the ratio between the number of triangles and the number of vertices of the subgraph. The definition that will be used in this paper is the ratio between the number of induced edges and nodes. Adopting our problem to other density measures is left open as future work. 4. Computational complexity In this section, we analyze the computational complexity of the stc-den problem by showing its NP -hardness when \lambda<1 and its connection to the Max-Clique problem, when \lambda=0 . At the other extreme, when \lambda=1 , stc-den is equivalent to the problem of finding the densest subgraph, which can be solved in polynomial time using the algorithm presented by Goldberg (1984) . Proposition 4.1. For \lambda=0 , stc-den is NP -hard. The proof (given in Appendix A.1 ) also shows that the maximum clique yields precisely the optimal score while satisfying the STC property. As a consequence, combining this with the inapproximability results for Max-Clique ( Zuckerman, 2006 ) gives the next result (see Appendix A.1 for the proof). Proposition 4.2. For \lambda=0 , stc-den does not have any polynomial time approximation algorithm with an approximation ratio better than n^{1-\epsilon} for any constant \epsilon>0 , unless \textbf{P}=\textbf{NP} . Note that when \lambda>0 , we can obtain a \frac{1}{\lambda} -approximation by finding the densest subgraph with nodes U and using a labeling L that labels each edge as weak. Compared to an optimal solution U^{*} with labeling L^{*} , we then obtain the score \begin{split}q(U,L;\lambda)&=\frac{\lambda{\left|E(U)\right|}}{{\left|U\right|}}\geq\frac{\lambda{\left|E(U^{*})\right|}}{{\left|U^{*}\right|}}=\lambda\frac{m_{s}(U^{*},L^{*})+m_{w}(U^{*},L^{*})}{{\left|U^{*}\right|}}\\ &\geq\lambda\frac{m_{s}(U^{*},L^{*})+\lambda m_{w}(U^{*},L^{*})}{{\left|U^{*}\right|}}=\lambda q(U^{*},L^{*};\lambda).\end{split} In summary, stc-den is inapproximable when \lambda=0 but solvable in polynomial time when \lambda=1 . Finally, we state that stc-den is also NP -hard for 0<\lambda<1 . Proposition 4.3. stc-den is NP -hard for 0<\lambda<1 . The proof of Proposition 4.3 is in Appendix A.1 . 5. Algorithms In this section, we present five algorithms to find a good subgraph for our stc-den problem. First, we propose an algorithm based on integer linear programming that finds a near-optimal or exact solution for our problem in Section 5.1 . Next, we state a polynomial time algorithm that solves a linear program in Section 5.2 followed by three heuristics presented in Sections 5.3 and 5.4 . 5.1. Exact solution using integer programming In this section, we present an integer linear programming (ILP) based algorithm that can be used to find an exact solution for stc-den . To solve stc-den we need the following auxiliary problem. The proofs for this section are given in Appendix A.2 . Problem 2 ( \textsc{stc-den}(\alpha) ). Given a graph G=(V,E) , a weight parameter \lambda , and a number \alpha , find a subset of vertices U\subseteq V and a labeling L of the edges such that the STC property is satisfied in (U,E(U)) and m_{s}(U,L)+\lambda m_{w}(U,L)-\alpha{\left|U\right|} is maximized. The following proposition, which is an instance of fractional programming ( Dinkelbach, 1967 ) , shows the relationship between \textsc{stc-den}(\alpha) and stc-den . Proposition 5.1. Let U(\alpha) and L(\alpha) be the subgraph and the corresponding labeling solving \textsc{stc-den}(\alpha) . Similarly, let U^{*} with labeling L^{*} be the solution for stc-den . Write \alpha^{*}=\mathit{q}\mathopen{}\left(U^{*},L^{*}\right) . If \alpha>\alpha^{*} , then U(\alpha)=\emptyset . If \alpha<\alpha^{*} , then U(\alpha)\neq\emptyset and \mathit{q}\mathopen{}\left(U(\alpha),L(\alpha)\right)>\alpha . We can use the proposition to solve stc-den : we find the (almost) largest \alpha for which \textsc{stc-den}(\alpha) yields a nonempty solution. Then \textsc{stc-den}(\alpha) for such \alpha yields an (almost) optimal solution. We can solve \textsc{stc-den}(\alpha) with an integer linear program, (1) maximize \displaystyle\sum x_{ij}+\lambda\sum z_{ij} \displaystyle-\alpha\sum y_{i}\textstyle (2) subject to \displaystyle x_{ij}+z_{ij} \displaystyle\leq y_{i} \displaystyle ij \displaystyle\in E (3) \displaystyle x_{ij}+z_{ij} \displaystyle\leq y_{j} \displaystyle ij \displaystyle\in E (4) \displaystyle x_{ij}+x_{jk} \displaystyle\leq y_{j} \displaystyle(i,j,k) \displaystyle\in Z (5) \displaystyle x_{ij},z_{ij} \displaystyle\in\{0,1\} \displaystyle ij \displaystyle\in E (6) \displaystyle y_{i} \displaystyle\in\{0,1\} \displaystyle i \displaystyle\in V\quad. Here, G=(V,E) is the input graph and Z is the set of all wedges in G . To see why this program solves \textsc{stc-den}(\alpha) , let S\subseteq V and L be a solution to our \textsc{stc-den}(\alpha) . The indicator variable y_{i} denotes whether the node i\in S or not. The indicator variables x_{ij} and z_{ij} denote if the edge (i,j) is strong or not and (i,j) is weak or not, respectively. Constraints 2 - 3 guarantee that each edge within S is labeled either as strong or weak. Constraint 4 ensures that the STC constraint is satisfied. Proposition 5.1 allows us to maximize \alpha with a binary search. Here, we set the initial interval (L,U) to L=0 and U=\frac{n-1}{2} , and keep halving the interval until {\left|U-L\right|}\leq\epsilon L , where \epsilon>0 is an input parameter, and return the solution to \textsc{stc-den}(L) . We refer to this algorithm as STC-ILP . Next, we state that STC-ILP yields an approximation guarantee of 1/(1+\epsilon) . Proposition 5.2. Assume a graph G=(V,E) , \lambda\in[0,\;1] , and \epsilon>0 . Let \alpha be the score of the solution returned by STC-ILP and let \alpha^{*} be the optimal score of stc-den . Then \alpha\geq\alpha^{*}/(1+\epsilon) . Next, we will show that if \epsilon is small enough, we are guaranteed to find the exact solution. Proposition 5.3. Assume a graph G with n nodes. Assume that the weight parameter \lambda is a rational number \lambda=\frac{a}{b} . Then, if we set \epsilon=\frac{2}{bn^{3}} , STC-ILP returns an exact solution for the stc-den problem in \mathit{\mathcal{O}}\mathopen{}\left(\log n+\log b\right) number of iterations. STC-ILP requires \mathit{\mathcal{O}}\mathopen{}\left(\log n-\log\epsilon\right) iterations, solving an integer linear program in each round. Note that solving an ILP is NP -hard ( Schrijver, 1998 ) , and the fastest known algorithm to solve an ILP exactly runs in {\log h}^{\mathit{\mathcal{O}}\mathopen{}\left(h\right)} time where h is the number of variables ( Reis and Rothvoss, 2023 ) . In practice, we can solve \textsc{stc-den}(\alpha) for moderately sized graphs but for larger graphs solving the ILP becomes computationally infeasible. This approach is related to two prior works. First, the algorithm by Goldberg (1984) for finding the densest subgraph problem uses a similar approach, except without the variables z_{ij} . In such a case, the program can be solved exactly with a minimum cut. Secondly, Adriaens et al. (2020) use a linear program with similar wedge constraints to approximate MinSTC . 5.2. Algorithm based on linear programming In this section, we present an algorithm, named STC-LP , based on a linear program obtained by relaxing the integrality requirements of the integer linear program given in the previous section. More specifically, we first find a fractional solution by solving a linear program (LP) and then derive a good subgraph via a rounding algorithm. Note that solving linear programs can be done in polynomial time ( Karmarkar, 1984 ; van den Brand, 2020 ) , and solvers are efficient in practice. The proofs for this section are given in Appendix A.3 . Consider a relaxed version of the ILP, where we replace the constraints in Eqs. 5 – 6 with x_{ij},z_{ij}\in[0,1] and y_{i}\in[0,1] . We will refer to this optimization problem as \textsc{stc-relax}(\alpha) . Note that we used \textsc{stc-den}(\alpha) combined with the binary search to solve stc-den . We can define a relaxed version of stc-den which then can be analogously solved with \textsc{stc-relax}(\alpha) . Problem 3 (stc-relax). Given a graph G=(V,E) , a weight parameter \lambda , find a nonnegative set of variables x_{e} , y_{i} , z_{e} , where e\in E and i\in V maximizing r(x,y,z)=\frac{\sum x_{e}+\lambda\sum z_{e}}{\sum y_{i}}\quad\text{such that}\quad\text{Eqs.\penalty\ \ref{ip_con_1}--\ref{ip_con_3} hold}. stc-relax is a relaxed version of stc-den : if we were to require that the variables in stc-relax are binary numbers, then the problems become equivalent. The next proposition is an analog to Proposition 5.1 . Proposition 5.4. Let (x^{*},y^{*},z^{*}) be a solution to stc-relax . Write \alpha^{*}=r(x^{*},y^{*},z^{*}) . Similarly, let (x(\alpha),y(\alpha),z(\alpha)) be a solution \textsc{stc-relax}(\alpha) . If \alpha>\alpha^{*} , then \sum y_{i}(\alpha)=0 . On the other hand, if \alpha<\alpha^{*} , then \sum y_{i}(\alpha)>0 and r(x(\alpha),y(\alpha),z(\alpha))>\alpha . Proposition 5.4 allows us to solve stc-relax with \textsc{stc-relax}(\alpha) and a binary search, similar to STC-ILP . However, we can solve stc-relax directly with a single linear program, that is, maximize \displaystyle\sum x_{ij} \displaystyle+\lambda\sum z_{ij} subject to \displaystyle x_{ij}+z_{ij} \displaystyle\leq y_{i} \displaystyle ij \displaystyle\in E \displaystyle x_{ij}+z_{ij} \displaystyle\leq y_{j} \displaystyle ij \displaystyle\in E \displaystyle\sum y_{i} \displaystyle=1 \displaystyle x_{ij}+x_{jk} \displaystyle\leq y_{j} \displaystyle(i,j,k) \displaystyle\in Z \displaystyle x_{ij},z_{ij} \displaystyle\geq 0 \displaystyle ij \displaystyle\in E \displaystyle y_{i} \displaystyle\geq 0 \displaystyle i \displaystyle\in V Proposition 5.5. The LP given above solves stc-relax . Our LP is related to the LP proposed by Charikar (2000) , which is used to solve the densest subgraph problem exactly. We extend Charikar’s LP by adding strong edges and additional STC constraints. Another related work is the LP proposed by Adriaens et al. (2020) which provides a 2 -approximation for MinSTC using similar wedge constraints. Rounding phase : Next, we describe the heuristic used to obtain the subgraph and the labeling from the variables. Let ( x^{*} , y^{*} , z^{*} ) be the solution to stc-relax . First we define a collection of sets {\mathcal{S}}=\{S_{1},S_{2},\ldots,S_{n}\} where S_{j}=\{i:y^{*}_{i}\geq y_{j}^{*}\} . Then we enumerate over the collection of subgraphs induced by {\mathcal{S}} . For each S_{j} , we initially set all the edges as weak. Then we enumerate over each edge e\in E(S_{j}) starting from the largest z_{e}^{*} . Each edge e is labeled as strong if the STC property is not violated. This means that we check if there is any edge adjacent to any of the endpoints of e which is already labeled as strong and still creates a wedge with e . We continue the same process for all the edges e\in E(S_{j}) in the descending order of its z_{e}^{*} value. Finally, out of all the subgraphs we pick the subgraph and the labeling that maximizes our score. Constructing a labeling for a single S_{j} amounts to enumerating over the wedges in \mathit{\mathcal{O}}\mathopen{}\left(nm\right) time, leading to a total time of \mathit{\mathcal{O}}\mathopen{}\left(n^{2}m\right) for the rounding. 5.3. Label, find the densest subgraph, and relabel Next, we explain two algorithms that combine the existing methods for finding the densest subgraph and finding the STC-compliant labeling in an entire graph. The approach is as follows. First, we label the edges of the entire graph using Apr-MinSTC (see Section 3 ). Then we construct a weighted version of the graph assigning a weight of 1 for strong edges and a weight of \lambda for weak edges. Next, we search for the densest subgraph using Cut or Peel (see Section 3 ) in the new weighted graph. Finally, we relabel only the subgraph induced by the returned solution. Relabeling is used to improve the score since some of the edges might be marked as weak since they contributed to certain wedges in the original graph, nevertheless, some edges no longer contribute to all of those wedges. The pseudo-code for this method is given in Algorithm 1 . We call the algorithm as STC-Cut or STC-Peel based on the subroutine used in Line 1 of Algorithm 1 . Algorithm 1 \textsc{STC-Cut}(G,\lambda) and \textsc{STC-Peel}(G,\lambda) , both find a subgraph U and a labeling L with good \mathit{q}\mathopen{}\left(U,L;\lambda\right) . L\leftarrow\textsc{Apr-MinSTC}(G) ; 1 H\leftarrow the weighted graph by setting 1 to strong edges and \lambda to weak edges of G ; 2 U\leftarrow\textsc{Cut}(H) ( Goldberg, 1984 ) or \textsc{Peel}(H) ( Charikar, 2000 ) ; 3 L^{\prime}\leftarrow\textsc{Apr-MinSTC}(G(U)) ; 4 return subgraph U and its labeling L^{\prime} ; Next, we present the computational complexities of the STC-Peel and STC-Cut algorithms. Proposition 5.6. Assume a graph G with n nodes and m edges. Assume that the wedge graph Z(G) contains n^{\prime} nodes and m^{\prime} edges. Then the running time of STC-Peel is in \displaystyle\mathit{\mathcal{O}}\mathopen{}\left(\sum_{v\in V}\deg(v)^{2}+(m+n\log n)+(m^{\prime}+n^{\prime})\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(nm\right)\quad. Proof. The number of wedges in G , and hence the number of edges in Z(G) is in \mathit{\mathcal{O}}\mathopen{}\left(\sum_{v\in V}\deg(v)^{2}\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(n\sum_{v\in V}\deg(v)\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(nm\right) . The number of vertices, n^{\prime} , in the wedge graph Z(G) is in \mathit{\mathcal{O}}\mathopen{}\left(m\right) . Apr-MinSTC estimates the minimum vertex cover problem with a maximum matching for Z(G) and the subgraph, which has a running time of \mathit{\mathcal{O}}\mathopen{}\left(n^{\prime}+m^{\prime}\right) when the adjacency list representation is used for the graph ( Cormen et al., 2022 ) . We can execute Peel in \mathit{\mathcal{O}}\mathopen{}\left(m+n\log n\right) time. The claim follows. ∎ Proposition 5.7. Assume a graph G with n nodes and m edges. Assume that the wedge graph Z(G) contains n^{\prime} nodes and m^{\prime} edges. Then the running time of STC-Cut is in \displaystyle\mathit{\mathcal{O}}\mathopen{}\left(mn+n(n+m)\log n+(m^{\prime}+n^{\prime})\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(mn\log n\right)\quad. Proof. The only change compared to Proposition 5.6 is that we are using an exact algorithm instead of an approximation algorithm for finding the densest subgraph. The exact algorithm for an edge-weighted graph takes \mathit{\mathcal{O}}\mathopen{}\left(M(n,n+m)\log n\right) time, and M(n,n+m) is the time taken to solve the min-cut problem for a graph with n number of nodes and (n+m) number of edges. It takes \mathit{\mathcal{O}}\mathopen{}\left(n(n+m)\right) to find the minimum cut ( Orlin, 2013 ) . The claim follows. ∎ 5.4. Peeling with continuous relabeling The STC-Peel algorithm, given in the previous section, first finds a labeling and then uses Peel that constructs a set of subgraphs among which the subgraph with the highest score is selected. During this search, the labeling remains fixed. Our final algorithm modifies this approach by relabeling the graph as we are constructing the subgraphs. Our approach is as follows. We start from the whole graph G and label the edges as either strong or weak using Apr-MinSTC . Given a labeling L and a subgraph U , let the weighted degree for a vertex \mathit{\deg_{\lambda}}\mathopen{}\left(v,U,L,\lambda\right) be defined as the sum of strong edges and weak edges in U incident to v weighted by \lambda , i.e., \mathit{\deg_{\lambda}}\mathopen{}\left(v,U,L\right)=\deg_{s}(v,U,L)+\lambda\deg_{w}(v,U,L) We drop L , U or \lambda when it is clear from the context. At each iteration, we delete the node that has the minimum weighted degree \mathit{\deg_{\lambda}}\mathopen{}\left(v\right) . After removing each vertex we relabel the remaining set of edges. Finally, we choose the subgraph U which corresponds to the maximum score \mathit{q}\mathopen{}\left(U,\lambda\right) out of all the iterations. The naive version for this method is given in Algorithm 2 . Algorithm 2 \textsc{Grd-Naive}(G,\lambda) , finds a subgraph U and a labeling L with good \mathit{q}\mathopen{}\left(U,L;\lambda\right) U\leftarrow V ; 1 while there are nodes do 2 L\leftarrow\textsc{Apr-MinSTC}(G(U)) ; 3 u\leftarrow\displaystyle\arg\min_{v\in U}\mathit{\deg_{\lambda}}\mathopen{}\left(v,U,L,\lambda\right) ; 4 U\leftarrow U\setminus\left\{u\right\} ; 5 return best tested U and its labeling L ; Next, we explain several tricks to speed up the naive implementation of Algorithm 2 . We focus on updating the wedge graph, modifying the minimum vertex cover, and updating individual scores of each vertex without computing them from scratch. Maintain wedge graph : Note that on Line 2 of Algorithm 2 , we need to repeatedly construct a wedge graph to solve MinSTC . We can avoid this by maintaining the existing wedge graph as vertices are deleted. When a node is deleted we need to consider only deleting respective edges in the wedge graph since new wedges cannot be introduced. Note that an edge in the original graph G corresponds to a node in the wedge graph Z(G) and edges in Z(G) represent wedges in G . Next, we state how to maintain Z(G) when a vertex is deleted in Proposition 5.8 . Proposition 5.8. Let G=(V,E) be a graph. Let v be a vertex in G . Define G^{\prime}=G(V\setminus\left\{v\right\},E\setminus N(v)) , where N(v) is the set of adjacent edges of vertex v in G . Then, a new wedge graph Z(G^{\prime}) is formed by deleting the vertices in Z(G) corresponding to N(v) . We omit the straightforward proof. Dynamic vertex cover using maximal matching : Next, we consider updating the vertex cover after a vertex deletion. Recall that we use maximum matching to approximate the vertex cover in Apr-MinSTC . Given a maximal matching of the current graph, Ivković and Lloyd (1993) presented a simple algorithm to maintain the cover when an edge is deleted or inserted. Here we modify their algorithm slightly to adapt to a node deletion from G . Let us consider the case where the vertex v is deleted from the original graph G . Note that N(v) is a set of edges in G which corresponds to a subset of nodes in Z(G) . According to Proposition 5.8 , the set of nodes corresponding to N(v) should be deleted from the wedge graph Z(G) to compensate for the deleted vertex. We assume that a maximal matching M of Z(G) is given. The algorithm is as follows. We iterate over the elements in N(v) and pick a node a\in N(v) in Z(G) . We then test whether there is an edge (a,b) in M for some b . There can be only one, and if there is, we delete it. Upon such deletion, M may no longer be maximal since b may have a single adjacent edge that can be added. We search for such an edge and add it if one is found. The pseudocode is given in Algorithm 3 . Algorithm 3 still produces a maximal matching; thus a 2 -approximation for Min-Vertex-cover is guaranteed. Algorithm 3 \textsc{Dynamic-Vertex-cover}(M,v) , maintains a vertex cover (a maximal matching M ) when a node v is deleted foreach a\in N(v) do 1 if there is b such that (a,b)\in M then 2 delete (a,b) from M ; 3 if b\notin N(v) and there is t\notin N(v) such that t is not an endpoint of any edge in M and (b,t)\in E(Z(G)) then 4 add (b,t) to M ; 5 return M ; Speeding the vertex selection : We can speed up finding the next vertex by maintaining \mathit{\deg_{\lambda}}\mathopen{}\left(v,\lambda\right) in a priority queue. Once a vertex is deleted, we need to update the degree of its neighboring nodes. Also, we may need to update the weighted degree of the affected vertices if the vertex cover of Z(G) changes. However, the number of changed edges in the vertex cover is constant. The final version of the algorithm is presented in Algorithm 4 . Algorithm 4 \textsc{Greedy}(G,\lambda) , finds a subgraph U and a labeling L with good \mathit{q}\mathopen{}\left(U,L;\lambda\right) L\leftarrow\textsc{Apr-MinSTC}(G) ; 1 P\leftarrow priority queue where each node is ranked by \mathit{\deg_{\lambda}}\mathopen{}\left(v,L\right) ; 2 U\leftarrow V ; 3 while there are nodes do 4 u\leftarrow\displaystyle\arg\min_{v\in U}\mathit{\deg_{\lambda}}\mathopen{}\left(v,U,L\right) ; 5 U\leftarrow U\setminus\left\{u\right\} ; 6 Update the wedge graph Z((U,E(U))) ; 7 Update labeling L using Algorithm 3 ; 8 Update P ; 9 return best tested U and its labeling L ; Next, we state the computational complexity of Greedy . Proposition 5.9. Assume a graph G with n nodes and m edges. Assume that the wedge graph Z(G) contains n^{\prime} nodes and m^{\prime} edges. Then the running time of Greedy is in \mathit{\mathcal{O}}\mathopen{}\left(mn+(n^{\prime}+m^{\prime})+m\log n+nm\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(nm\right)\quad. Proof. Let G_{i} be the graph at i th iteration. Consider deleting vertex u from G_{i} . Upon deletion, we need to update the priorities of the affected nodes in the queue. When u is deleted from G_{i} , we need to delete the set of nodes in Z(G) which corresponds to the adjacent edges of u . For each deleted vertex in Z(G) , there can be at most one adjacent edge that belongs to the existing matching set. Therefore, to compensate for the edge that is removed from the maximal matching set, we need to add at most one edge to the matching. The two endpoints of the newly added edge correspond to two edges in G_{i+1} . Therefore, the total number of vertices that require updating priorities is at most 4 . Moreover, deleting one edge from the existing matching set will affect the priorities of at most 2 vertices. In summary, \mathit{\mathcal{O}}\mathopen{}\left(\deg u\right) nodes need to be updated when we delete u . Consequently, the total update time of P is in \mathit{\mathcal{O}}\mathopen{}\left(m\log n\right) . Moreover, the total update time for Z(G) is in \mathit{\mathcal{O}}\mathopen{}\left(n^{\prime}+m^{\prime}\right) . Updating M requires finding a new edge which may cost \mathit{\mathcal{O}}\mathopen{}\left(n\right) time, consequently, updating M requires \mathit{\mathcal{O}}\mathopen{}\left(nm\right) total time. Finally, the update time for (U,E(U)) is in \mathit{\mathcal{O}}\mathopen{}\left(m\right) . Initially, constructing Z(G) requires \mathit{\mathcal{O}}\mathopen{}\left(\sum_{v\in V}\deg(v)^{2}\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(nm\right) time and VC-Mat requires \mathit{\mathcal{O}}\mathopen{}\left(n^{\prime}+m^{\prime}\right)\subseteq\mathit{\mathcal{O}}\mathopen{}\left(nm\right) time. Combining these times proves the claim. ∎ 6. Experimental evaluation Table 1 . Results of the experiments for synthetic and real datasets. Here, \lambda is the weight parameter, columns CT , PL , GR , LP , and IP represent STC-Cut , STC-Peel , Greedy , STC-LP , and STC-ILP , respectively, columns in \mathit{q} are the discovered scores, columns in {\left|E_{s}\right|}\% give the percentages of strong edges in discovered subgraph, and columns in time give the computational time. \mathit{q} {\left|E_{s}\right|}\% time Dataset \lambda CT PL GR LP IP CT PL GR LP IP CT PL GR LP IP Synthetic 0.8 21.28 21.28 21.27 21.68 9.45 15.96 9.43 17.2 11.72 s 6.69 s 6.94 s 29.58 s 0.6 16.57 16.57 18.5 17.37 9.45 15.86 100 17.07 11.29 s 6.4 s 7.11 s 36.9 s 0.4 18.5 18.5 18.5 18.5 100 100 100 100 9 s 4.73 s 7.85 s 16.97 s 0.2 18.5 18.5 18.5 18.5 18.5 100 100 100 100 100 7.02 s 7.02 s 7.98 s 12.92 s 9m5s Cora 0.8 2.58 2.33 2.3 2.65 2.69 32.51 10.03 5.16 22.16 28.57 18.14 s 1.1 s 1m1s 2.41 s 43.26 s 0.6 1.99 1.84 2.01 2.14 2.29 74.15 7.35 81.82 21.57 37.5 17.51 s 0.92 s 1m1s 2.8 s 11m1s 0.4 2 1.78 2 1.62 2.09 100 100 100 39.13 69.57 14.68 s 0.94 s 46.73 s 2.98 s 4m23s 0.2 2 1.78 2 1.32 2.02 100 100 100 66.67 95.24 15.48 s 0.88 s 42.34 s 2.79 s 4m17s Citeseer 0.8 4 3.99 3.87 4.12 4.2 6.54 17.95 8.89 19.44 27.78 13.17 s 0.51 s 1m25s 1.27 s 18.32 s 0.6 3.11 3.08 2.99 3.35 3.5 6.93 18.64 5.45 20.37 28.16 15.44 s 0.52 s 1m18s 1.28 s 17.54 s 0.4 2.22 2.16 2.5 2.65 2.82 16.07 24.49 100 23.3 32.94 14.55 s 0.56 s 56.86 s 1.3 s 38.62 s 0.2 1.5 1.5 2.5 1.89 2.5 100 100 100 35.29 100 15.05 s 0.68 s 50.06 s 1.29 s 1m6s PGP 0.8 15.96 15.59 15.4 16.48 16.86 18.41 15.24 15.68 32.05 42.19 1m33s 5.95 s 31m49s 22.39 s 6m55s 0.6 12.51 12.07 12 13.97 14.66 17.75 24.68 100 33.22 42.19 1m38s 6.67 s 31m52s 20.52 s 8m40s 0.4 10.5 10.5 11 11.44 12.56 100 100 100 34.94 48.19 1m38s 6.42 s 31m4s 20.33 s 9m24s 0.2 10.5 10.5 11 10.46 12 100 100 100 67.29 100 1m40s 6.28 s 24m20s 27.82 s 9m3s Email-EU 0.8 22.17 22.17 22.12 22.44 2.14 2.17 1.22 7.09 52.5 s 22.21 s 2m29s 3m37s 0.6 16.78 16.76 16.68 17.3 2.14 2.09 1.26 6.88 54.26 s 21.13 s 2m33s 4m26s 0.4 11.4 11.38 11.24 12.2 2.35 2.28 1.44 7.12 55 s 21.76 s 2m25s 5m16s 0.2 6.02 5.97 8 7.16 3.06 2.88 100 7.52 57.63 s 23.54 s 2m21s 4m57s Facebook 0.8 62.26 63.33 62.02 61.48 5.71 6.19 4.16 12.68 1m22s 37.31 s 5m29s 7m27s 0.6 47.79 47.94 47.31 49.84 5.71 6.19 4.16 12.49 1m23s 36.05 s 5m39s 6m34s 0.4 33.54 33.38 33.5 36.3 6.26 5.92 100 12.75 1m21s 35.21 s 5m32s 9m30s 0.2 19.27 19.36 33 23.18 6.76 6.92 100 13.46 1m22s 34.21 s 5m22s 9m27s LastFM 0.8 11.97 12 11.94 12.28 4.72 5.58 3.77 15.19 1m33s 11.99 s 24m54s 1m1s 0.6 9.16 9.19 8.98 9.67 4.72 5.34 5.29 13.53 1m33s 12.09 s 24m45s 58.42 s 0.4 6.47 6.43 6.5 7.09 6.21 5.76 100 14.3 1m32s 11.38 s 23m10s 1m3s 0.2 3.46 3.52 6.5 4.71 4.38 4.83 100 15.98 1m32s 11.8 s 17m28s 1m1s Table 2 . Characteristics of real-world datasets. Here, {\left|V\right|} and {\left|E\right|} give the number of vertices and edges, {\left|V(Z)\right|} and {\left|E(Z)\right|} are the number of vertices and edges in the wedge graph, d={\left|E(U)\right|}/{\left|U\right|} gives the density of the densest subgraph, and d_{c} is the density induced by Max-Clique . Dataset {\left|V\right|} {\left|E\right|} {\left|V(Z)\right|} {\left|E(Z))\right|} d d_{c} Cora 2\,708 5\,278 5\,151 47\,411 3.14 2 Citeseer 3\,264 4\,536 4\,192 23\,380 4.91 2.5 PGP 10\,680 24\,316 23\,568 270\,433 19.07 12 Email-EU 986 16\,064 16\,063 866\,833 27.57 8.5 Facebook 747 30\,025 30\,022 1\,177\,951 76.73 33.5 LastFM 7\,624 27\,806 27\,775 557\,781 14.79 7 Next, we evaluate our algorithms experimentally. We first generate a synthetic dataset with a dense subgraph component and test how well our algorithms perform. Next, we study the performance of the algorithms on real-world networks. We implemented the algorithms in Python 1 1 1 The source code is available at https://version.helsinki.fi/dacs/ . and performed the experiments using a 2.4GHz Intel Core i5 processor and 16GB RAM. In our experimental evaluation, we used Gurobi solver in Python to solve the ILPs and LPs associated with STC-ILP and STC-LP respectively. Synthetic dataset : We will now explain how the synthetic dataset was generated. Given a vertex set V of size 230, we split V into dense and sparse components D and S . Here, we randomly selected D to have 38 nodes and S to have 192 nodes. We sampled the edges using a stochastic block model, with the edge probabilities being p_{d}=1 , p_{s}=0.3 , and p_{c}=0.05 for dense component, sparse component, and cross edges, respectively. The resulting graph had 5\,197 edges, and the wedge graph had 5\,197 nodes and 179\,100 edges. The density of D was {\left|E(D)\right|}/{\left|D\right|}=18.5 . Results using synthetic dataset : We report our results in Table 1 . First, we see that all our algorithms find the ground truth by achieving a score of 18.5 which is the density of our planted clique of size 38 for example when \lambda=0.4 and \lambda=0.2 . Note that STC-ILP produced the results within an hour only for the \lambda=0.2 case. Since STC-ILP solves an ILP in each round, it was inefficient to run for the other \lambda values and we stopped the execution after one hour. As \lambda increases, our algorithms tend to find a score greater than 18.5 by deviating away from the planted clique. We also see that STC-LP which solves a linear program runs significantly slower than Greedy , STC-Peel , and STC-Cut algorithms. Next, we study how the scores and the percentage of weak edges vary as a function of \lambda as shown in Figure 2 . We can observe that both STC-Cut and STC-Peel produce equal scores whereas STC-Peel and STC-LP slightly underperform at \lambda=0.6 and \lambda=0.5 respectively as shown in Fig. 2 . Moreover, the STC-LP slightly outperforms other algorithms when \lambda\geq 0.7 . In terms of percentages of weak edges, all three algorithms produced the same decreasing trends according to Fig. 2 . There are no weak edges in the subgraphs produced by any of the algorithms when \lambda\leq 0.4 since scores are only contributed by the planted clique. Recall the connection to the maximum clique problem for \lambda=0 from Proposition 4.1 . Finally, we study the running time as a function of the number of edges {\left|E\right|} and the number of wedges {\left|V(Z)\right|} in Figure 3 . We randomly generated 6 datasets each with 5\,000 nodes. The number of edges of the datasets uniformly ranges from 1\times 10^{4} to 1.1\times 10^{5} . We see that STC-Cut and STC-Peel are the fastest while STC-LP is the slowest. {subcaptiongroup} 0 0.2 0.4 0.6 0.8 1 20 30 40 \lambda \mathit{q}\mathopen{}\left(\cdot;\lambda\right) Greedy STC-Cut STC-Peel STC-LP (a) 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80 100 \lambda {\left|E_{s}\right|}\% (b) Figure 2 . Scores and percentages of strong edges as a function of \lambda for Synthetic dataset. {subcaptiongroup} 0.2 0.4 0.6 0.8 1 \cdot 10^{5} 0 1\,000 2\,000 3\,000 4\,000 {\left|E\right|} time Greedy STC-Cut STC-Peel STC-LP (a) 2 4 \cdot 10^{6} 0 1\,000 2\,000 3\,000 4\,000 {\left|V(Z)\right|} time (b) Figure 3 . Time in seconds as a function of the number of edges {\left|E\right|} and the number of wedges {\left|V(Z)\right|} . Real-world datasets : We test our algorithms in publicly available, real-world datasets: Cora ( Rossi and Ahmed, 2015 ) 2 2 2 https://networkrepository.com and Cite-seer ( Rossi and Ahmed, 2015 ) 2 datasets are citation networks. Email-EU is a collaboration network between researchers.​ 3 3 3 https://toreopsahl.com/datasets/ Facebook is extracted from a friendship circle of Facebook.​ 4 4 4 http://snap.stanford.edu LastFM is a social network of LastFM users.​ 4 PGP is an interaction network of the users of the Pretty Good Privacy (PGP) algorithm.​ 5 5 5 http://konect.cc/networks/arenas-pgp/ The details of the datasets are shown in Table 2 . Results using real-world datasets : We present the results obtained using our algorithms in Table 1 . We compare our algorithms in terms of scores, running time, and the percentage of the strong edges within subgraphs they returned for a set of \lambda values. Since STC-ILP invokes a sequence of integer programs, the algorithm does not scale for large datasets. We stopped the experiments that took over one hour. We always set \epsilon=0.01 when testing each dataset with STC-ILP . First, let us compare the scores across the algorithms. Our first observation is that STC-ILP always yields the highest score with the tested datasets while all other algorithms perform similarly in terms of scores: in most cases, they produce approximately equal scores. When STC-ILP is not usable, STC-LP has produced the maximum score except for 3 outlier cases where Greedy and STC-Peel algorithms obtained the maximum score 2 times and 1 time respectively. Nevertheless, for high \lambda s all of them produce less deviated scores when compared to lower \lambda s. As expected, \mathit{q} increases as \lambda increases for all 4 algorithms. Next, let us look at column {\left|E_{s}\right|}\% which gives the percentages of strong edges in the returned subgraph. Generally speaking, {\left|E_{s}\right|}\% monotonically decreases as \lambda increases except for a few outlier cases. This is because when we assign a higher weight \lambda , it becomes more beneficial to include more weak edges. Computation times are given in the time columns of Table 1 . Greedy , STC-LP , and STC-Cut run significantly slower than STC-Peel . If we compare Greedy and STC-Cut , for all the tested cases STC-Cut runs faster despite having to solve a sequence of minimum cuts. This is due to the implementation differences as STC-Cut uses a fast native library to compute the minimum cuts. Despite STC-ILP not being scalable for larger datasets, it runs faster than Greedy except for four cases with the tested datasets. For Cora , Citeseer , PGP , and LastFM datasets, STC-LP runs faster than all other algorithms except STC-Peel . However, for the two other remaining datasets, STC-LP is the slowest in comparison to the other three algorithms. We see that the running times are still reasonable in practice for the tested datasets; for example, we were able to compute the subgraph for the Facebook dataset, with over 30\,000 edges and 1\,000\,000 wedges, in under ten minutes. Table 3 . Co-authorship case-study for DBLP dataset with weighted variant of STC-ILP . We set \lambda=0.8 and \epsilon=0.01 . For each subgraph, we state the scores within brackets. S1 P. S.Yu, C. C.Aggarwal, J.Han, W.Fan, J.Gao, X.Kong (6.00) S2 C. H. Q.Ding, F.Nie, H.Huang, D.Luo (4.78) S3 S.Yan, J.Yan, N.Liu, Z.Chen, H.Xiong, Q.Yang, Y.Fu, Y.Ge, H.Zhu, E.Chen, C.Liu, Q.Liu, B.Zhang (4.70) S4 S.Lin, H.Hsieh, C.Li (4.23) S5 C.Faloutsos, J.Sun, S.Papadimitriou, H.Tong, L.Akoglu, T.Eliassi-Rad, B.Gallagher (4.09) S6 Y.Liu, M.Zhang, S.Ma, L.Ru (3.84) S7 H.Liu, J.Tang, X.Hu, H.Gao (3.80) S8 D.Phung, S.Venkatesh, S. KumarGupta, S.Rana, S.Tsumoto, S.Hirano (3.76) S9 C.Böhm, I. S.Dhillon, C.Plant, C.Hsieh, P.Ravikumar (3.54) S10 S.Günnemann, H.Kremer, T.Seidl, I.Assent, E.Müller, R.Krieger (3.46) Case study : Next, we conducted a case study for DBLP ( Tang et al., 2008 ) 6 6 6 https://www.aminer.org/citation which contains co-authorship connections from top venues in data mining and machine learning (SDM, NIPS, ICDM, KDD, ECMLPKDD, and WWW). Each node represents an author and each edge corresponds to a collaboration between two authors. We removed the author pairs who have less than 3 collaborations. The size of the dataset after prepossessing is n=4\,592 , m=5\,566 , and {\left|Z(G)\right|}=26\,073 . To compute a marginal weight that corresponds to an author pair, we assign a weight for each paper as one divided by the number of authors. We then weigh each edge (author-pair) by summing up the weights of all respective collaborations. Then we ran a weighted version of STC-ILP whose objective is to maximize the edge-weighted score, \frac{\sum_{\text{strong }e\in E(U)}w(e)+\lambda\sum_{\text{weak }e\in E(U)}w(e)}{{\left|U\right|}}\quad. We found top-10 non-overlapping subgraphs iteratively by deleting the returned subgraph in each iteration and then considering the remaining graph to find the next subgraph. We set \lambda=0.8 and \epsilon=0.01 . The list of author subgraphs is shown in Table 3 . We see that the variant of STC-ILP discovered subgraphs of prolific authors. 7. Concluding remarks We introduced a novel dense subgraph discovery problem that takes into account the strength of ties within the subgraph. Here we label each edge either as strong or weak based on the strong triadic closure principle (STC). The STC property requires that if one node strongly connects with two other nodes, then those two nodes should at least have a weak connection between them. Our goal was to maximize a density-like measure defined as the sum of the number of strong edges and the number of weak edges weighted by a weight parameter, divided by the number of nodes within the subgraph. We showed that our optimization problem is NP -hard, and connects the two well-known problems of finding dense subgraphs and maximum cliques. To solve the problem, we presented an exact algorithm based on integer linear programming. In addition, we presented a polynomial-time algorithm based on linear programming, a greedy heuristic algorithm, and two other straightforward algorithms based on the algorithms for the densest subgraph discovery. The experiments with synthetic data showed that our approach recovers the latent dense components. The experiments on real-world networks confirmed that our proposed algorithms discovered the subgraphs reasonably fast in practice. Finally, we presented a case study where our algorithm produced interpretable results suggesting the practical usefulness of our problem setting and algorithms. The idea of combining the dense subgraph problem with the STC property opens up several lines of work. For example, instead of using the ratio between the number of edges and the number of nodes as the density measure, we can incorporate other density measures. Acknowledgements. This research is supported by the Sponsor Academy of Finland project MALSOME (Grant #343045). Appendix A Appendix A.1. Computational complexity proofs Proof of Proposition 4.1 . We will show the NP -hardness of stc-den by a reduction from the NP -hard Max-Clique problem. As \lambda=0 , we simply write the score as q(U,L) instead of q(U,L;\lambda)=q(U,L;0) for brevity. Assume that the set U with the labeling L is an optimal solution to the stc-den problem with \lambda=0 , maximizing the score q(U,L) while satisfying the STC property. The density of the strong edges in U is then (7) q(U,L)=\frac{\sum_{v\in U}\deg_{s}(v,U,L)}{2{\left|U\right|}}. Consider a vertex w in U with the highest number \deg_{s}(w,U,L) of strong edges connected to it. As the maximum number of strong edges, \deg_{s}(w,U,L) has to be at least the average, (8) \deg_{s}(w,U,L)\geq\frac{\sum_{v\in U}\deg_{s}(u,U,L)}{{\left|U\right|}}. Then for any two vertices v and u that have strong edges (v,w) and (u,w) connecting them to w , there must be an edge between v and u to satisfy the STC property. Thus, the vertex w and its strong neighbors form a clique C with \deg_{s}(w,U,L)+1 vertices. Consider only having these vertices in C and having a labeling L^{\prime} that labels each edge in the clique as strong. This would satisfy the STC property and would give a score of q(C,L^{\prime})=\frac{{\left|C\right|}({\left|C\right|}-1)}{2{\left|C\right|}}=\frac{{\left|C\right|}-1}{2}=\frac{\deg_{s}(w,U,L)}{2}. From Equations 7 and 8 , we get (9) q(C,L^{\prime})=\frac{\deg_{s}(w,U,L)}{2}\geq\frac{\sum_{v\in U}\deg_{s}(v,U,L)}{2{\left|U\right|}}=q(U,L). Thus, the clique C has at least the same score as U , which has the maximum score of all subgraphs, so q(C,L^{\prime})=q(U,L) . This means that C must be a maximum size clique in the input graph G , as larger cliques would give a higher score than U . Therefore, by finding an optimal set of vertices U and labeling L we can find a maximum clique C . Thus, stc-den is NP -hard. ∎ Proof of Proposition 4.2 . Assume that we can find a set U with labeling L that is an \alpha -approximation to stc-den , while the optimal solution has value q(C^{*},L^{*}) with a maximum clique C^{*} and labeling L^{*} . Consider then the vertex w with the highest number of strong edges and construct the clique C consisting of w and its strong neighbors. Define the labeling L^{\prime} such that each edge in the clique C is labeled as strong. Using Equation 9 and that q(U,L) is an \alpha -approximation, we get q(C,L^{\prime})\geq q(U,L)\geq\alpha q(C^{*},L^{*}). But as the score of a clique C with only strong edges is q(C,L^{\prime})=\frac{{\left|C\right|}-1}{2} , we have \frac{{\left|C\right|}-1}{2}\geq\alpha\frac{{\left|C^{*}\right|}-1}{2}. By solving for {\left|C\right|} and using \alpha\leq 1 , we get {\left|C\right|}\geq\alpha\left({\left|C^{*}\right|}-1\right)+1\geq\alpha{\left|C^{*}\right|}. This means that we have an \alpha -approximation for Max-Clique . Therefore, any inapproximability results for Max-Clique also apply for the \lambda=0 case of stc-den . Using the result by Zuckerman (2006) then finishes the proof. ∎ To prove Proposition 4.3 we need the following lemma. Lemma A.1. Assume graph G . Let X\subsetneq Y be two subgraphs, and let L be a labeling defined on Y . Define \Delta(X,Y)=\frac{m_{s}(Y)+\lambda m_{w}(Y)-m_{s}(X)-\lambda m_{w}(X)}{{\left|Y\right|}-{\left|X\right|}}\quad. If \Delta(X,Y)<\mathit{q}\mathopen{}\left(Y,L\right) , then \mathit{q}\mathopen{}\left(Y,L\right)<\mathit{q}\mathopen{}\left(X,L\right) , if \Delta(X,Y)>\mathit{q}\mathopen{}\left(Y,L\right) , then \mathit{q}\mathopen{}\left(Y,L\right)>\mathit{q}\mathopen{}\left(X,L\right) , and if \Delta(X,Y)=\mathit{q}\mathopen{}\left(Y,L\right) , then \mathit{q}\mathopen{}\left(Y,L\right)=\mathit{q}\mathopen{}\left(X,L\right) . Proof. Assume \Delta(X,Y)<\mathit{q}\mathopen{}\left(Y,L\right) . Multiply by ({\left|Y\right|}-{\left|X\right|}){\left|Y\right|} and subtract {\left|Y\right|}(m_{s}(Y)+\lambda m_{w}(Y)) from both sides. Dividing by -{\left|X\right|}{\left|Y\right|} then gives \mathit{q}\mathopen{}\left(X,L\right)>\mathit{q}\mathopen{}\left(Y,L\right) , proving the first claim. The proofs for other claims are identical. ∎ Proof of Proposition 4.3 . We will prove the hardness by reducing an NP -hard problem MinSTC to our problem. In MinSTC , we are asked to label the full graph and minimize the number of weak edges ( Sintos and Tsaparas, 2014 ) . Assume a graph G with nodes V=v_{1},\ldots v_{n} . We assume that n\geq 5 . We define a new graph H that consists of G and k=\left\lceil 1/\lambda\right\rceil(n+1)/2 cliques C_{i} of size n . Let \left\{c_{ij}\right\} be the nodes in C_{i} . For each j and i , we connect v_{j} with c_{ij} . Let U be the optimal subgraph of H for stc-den and L be its labeling. Let L^{\prime} be the labeling where every E(C_{i}) is strong and the remaining edges are weak. Note that \mathit{q}\mathopen{}\left(U\right)\geq\mathit{q}\mathopen{}\left(C_{i},L^{\prime}\right)=(n-1)/2\geq 2 for any C_{i} . We claim that U contains every node in H . To prove the claim, let us define W_{i}=U\cap C_{i} . If {\left|W_{i}\right|}=1,2 , then \Delta(U\setminus W_{i},U)\leq 3/2<\mathit{q}\mathopen{}\left(U\right) and Lemma A.1 states that we can delete W_{i} from U and obtain a better score. Assume 3\leq{\left|W_{i}\right|}\mathit{q}\mathopen{}\left(U\right) , Lemma A.1 implies that we improve the solution by adding C_{j} , which is a contradiction. Hence, \Delta(U\setminus C_{i},U)\leq\mathit{q}\mathopen{}\left(U\right) . Lemma A.1 implies that we can safely delete C_{i} . Applying this iteratively we arrive to an optimal solution with nodes only in V . This cannot happen since then \mathit{q}\mathopen{}\left(U\right)\leq(n-1)/2 , but then \mathit{q}\mathopen{}\left(C_{i}\cup V,L^{\prime}\right)=(n-1)/2+\lambda/2>q(U) . Therefore, W_{i}=C_{i} for every i . Finally, assume v_{j}\notin U . Then \Delta(U,U\cup\left\{v_{j}\right\})\geq\lambda k\geq(n+1)/2>(n-1)/2+\lambda\geq\Delta(U\setminus C_{i},U) . Lemma A.1 states that either deleting any C_{i} or adding v_{j} improves the solution. This contradicts the optimality of U , so every v_{j}\in U . Consequently, V\subseteq U . The optimal labeling must have every edge in C_{i} as strong, the cross-edges between C_{i} and G as weak, and the labels for edges in G solve MinSTC . ∎ A.2. Proofs for Section 5.1 Proof of Proposition 5.1 . Let us write f(U,L)=m_{s}(U,L)+\lambda m_{w}(U,L) . Note that (10) f(U(\alpha),L(\alpha))-\alpha{\left|U(\alpha)\right|}\geq 0. Assume \alpha>\alpha^{*} . If U(\alpha)\neq\emptyset , then Eq. 10 implies that \mathit{q}\mathopen{}\left(U(\alpha),L(\alpha)\right)\geq\alpha>\alpha^{*}, which contradicts the optimality of \alpha^{*} . Thus, U(\alpha)=\emptyset . Assume \alpha<\alpha^{*} . Then \begin{split}f(U(\alpha),L(\alpha))-\alpha{\left|U(\alpha)\right|}&\geq f(U^{*},L^{*})-\alpha{\left|U^{*}\right|}\\ &>f(U^{*},L^{*})-\alpha^{*}{\left|U^{*}\right|}=0.\end{split} That is, f(U(\alpha),L(\alpha))>\alpha{\left|U(\alpha)\right|} , implying in turn that U(\alpha)\neq\emptyset and \mathit{q}\mathopen{}\left(U(\alpha),L(\alpha)\right)>\alpha . ∎ Proof of Proposition 5.2 . Let L and U be the values of the interval when binary search is terminated. Note that \alpha\geq L due to Proposition 5.1 . We know that U-L\leq\epsilon L and L\leq\alpha^{*}\leq U . Thus, \alpha^{*}-L\leq U-L\leq\epsilon L , or \alpha^{*}\leq(1+\epsilon)L\leq(1+\epsilon)\alpha . ∎ Proof of Proposition 5.3 . Let \alpha be the score of the solution X , L returned by STC-ILP , and let \alpha^{*} be the score of the optimal solution X^{*} , L^{*} for stc-den . We will show that if \alpha<\alpha^{*} , then \alpha^{*}-\alpha\geq 1/(bn^{2}) , which contradicts with the fact that \alpha^{*}-\alpha\leq\epsilon\alpha<\epsilon n/2=1/(bn^{2}) . To prove the claim, let \Delta=\alpha^{*}-\alpha . Then \begin{split}\Delta&=\frac{m_{s}(X^{*})+\frac{a}{b}m_{w}(X^{*})}{{\left|X^{*}\right|}}-\frac{m_{s}(X)+\frac{a}{b}m_{w}(X)}{{\left|X\right|}}\\ &=\frac{{\left|X\right|}(bm_{s}(X^{*})+am_{w}(X^{*}))-{\left|X^{*}\right|}(bm_{s}(X)+am_{w}(X))}{b{\left|X\right|}{\left|X^{*}\right|}}.\end{split} Note that the numerator and the denominator are both integers. Consequently, if \Delta>0 , then \Delta\geq 1/(bn^{2}) . It follows that if we set \epsilon=\frac{2}{bn^{3}} , then STC-ILP finds the optimal solution in \mathit{\mathcal{O}}\mathopen{}\left(\log n+\log b\right) number of rounds. ∎ A.3. Proofs for Section 5.2 Proof of Proposition 5.4 . Scaling (x^{*},y^{*},z^{*}) by any constant c>0 does not change the value of r(\cdot,\cdot,\cdot) nor does it change the validity of the constraints in Eqs. 2 – 4 . Therefore, we can safely assume that x_{e}^{*},z_{e}^{*}\leq 1 and y_{i}^{*}\leq 1 and i\in V , for any e\in E and i\in V . The claim now follows by repeating the steps of the proof of Proposition 5.1 . ∎ Proof of Proposition 5.5 . Scaling (x^{*},y^{*},z^{*}) by any constant c>0 does not change the value of r(\cdot,\cdot,\cdot) nor does it change the validity of the constraints in Eqs. 2 – 4 . Therefore, we can safely require that \sum y_{i}=1 , which immediately proves the claim. ∎