Manuscript Offprint
arXiv:2610.17958Mining Correlated Motifs with Wildcards in PPI Networks: Exact and Optimal
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Lucas P. Oliveira
Ben Bals
Aalt D. J. van Dijk
Solon P. Pissis
Abstract. A protein–protein interaction (PPI) network is a graph whose nodes are protein sequences and whose edges represent physical interactions between proteins. Correlated Motif Mining (CMM) seeks pairs of sequence motifs whose co-occurrence in interacting proteins reveals binding sites and interaction mechanisms. Formally, in the -CMM problem, we are given a graph , with for an alphabet , and integers , and we seek a pair of motifs, each of length and containing wildcards, that maximizes a support measure ; e.g., the count of edges such that matches a substring of and matches a substring of , or vice versa. Although existing approaches have produced biologically meaningful results, they are either inefficient or heuristic-based, as the underlying optimization problem is NP-hard. Here, we revisit -CMM. For , we give an exact -time and -space algorithm, where is the total length of the node strings, and prove that this time is conditionally optimal under the Strong Exponential-Time Hypothesis. For any , we give an exact -time and -space algorithm, and observe that the problem is W[1]-hard parameterized by . The latter algorithm improves the state of the art by exponentially large factors in both time and space. We further demonstrate experimentally that our algorithms are practical on real-world PPI networks and find significantly higher-scoring motif pairs than the state of the art. Moreover, we show that our algorithms find many top-scoring motif pairs that the state of the art misses entirely. Taken together, our results suggest that exact CMM with wildcards is more tractable in practice than previously assumed.
1 Introduction. Large-scale biological networks capturing protein–protein interactions (PPIs) are now available for a wide range of organisms [20–22]. While such data reveal how proteins function within a PPI network, they offer no direct insight into how those interactions are encoded at the sequence level—in particular, which regions of protein sequences correspond to physical interaction sites. Popular tools such as AlphaFold [11] have revolutionized protein structure prediction, but experimental validation of interaction interfaces at scale remains a major bottleneck: the human proteome alone contains tens of thousands of binary interactions [20], and determining their structural basis experimentally is infeasible at this scale. Moreover, even large-scale structural characterization of interacting proteins would not directly answer the question of how interaction specificity is encoded in protein sequence or structure. In other words: which specific residues determine which partners a protein can bind?
To answer this question, a variety of bioinformatics approaches have been developed [8,10,23]. In particular, several algorithmic approaches have been proposed for locating binding sites by mining overrepresented pairs of sequence patterns, called motif pairs, from sequences of interacting proteins [1, 15–18, 25]. One such approach, known as Correlated Motif Mining (CMM), identifies binding sites by searching for a consensus pattern in one group of proteins that interacts with nearly all proteins containing a second consensus pattern. When such a pair is found, both patterns are likely to represent complementary surface regions that enable physical binding. Figure 1.1 illustrates this idea: and are two correlated motif pairs, where an undirected edge connects two protein sequences if the first contains motif and the second contains motif , and analogously for . Although it remains unclear what fraction of protein interfaces can be described by correlated motifs of this kind, existing approaches consistently show that such motifs do contain meaningful information about interaction interfaces.
Existing computational approaches fall into two broad categories: (i) interaction-driven approaches [16–18]; and (ii) motif-driven approaches [1, 15, 25]. Interaction-driven approaches search for (quasi-)bicliques—that is, subsets of nodes in a PPI network, in which nearly every node on one side is connected to nearly all nodes on the other. These subgraphs capture an all-versus-all, or most-versus-most, interaction
*CWI, Amsterdam, The Netherlands and University of Campinas, Campinas, Brazil (lucas.peres@students.ic.unicamp.br).
CWI, Amsterdam, The Netherlands and Vrije Universiteit Amsterdam, Amsterdam, The Netherlands (bjjb@cwi.nl).
University of Amsterdam, Amsterdam, The Netherlands (a.d.j.vandijk@uva.nl).
§The Cyprus Institute, Nicosia, Cyprus (s.pissis@cyi.ac.cy).
pattern, from which a representative motif pair is then derived from the sequences labeling the nodes. Motif-driven approaches, by contrast, begin with candidate motif pairs and evaluate their support directly in the PPI network. While both paradigms have been shown to yield biologically meaningful results, the motif-driven approach has several conceptual advantages over its interaction-driven counterpart. First, motif pairs are identified directly rather than derived in post-processing. Second, all proteins containing a given motif are taken into account, rather than an arbitrarily selected subset. Third, when the interactions between two groups of proteins arise from multiple compatible binding sites—e.g., and in Figure 1.1—interaction-driven methods are forced to merge them into one motif pair, thereby losing this structural distinction.

Figure 1.1: Motif pairs and as correlated motifs. The colored edges show their correlation.
1.1 The problem and the state of the art. In this paper, we focus on the motif-driven approach to CMM. The vanilla version of the problem is defined as follows.
CORRELATED MOTIF MINING (CMM)
Input: A graph , with for an alphabet , and an integer .
Output: A pair , with , that maximizes a support measure .
We next define the CMM problem with wildcards; wildcards are placeholder symbols, denoted by ◇, that can match any character from the underlying alphabet.
CMM WITH WILDCARDS ((ℓ, d)-CMM)
Input: A graph , with for an alphabet , and integers and .
Output: A pair , with , each containing exactly wildcards, that maximizes a support measure .
While we formalize the problems in a general form, the motivating application leads us to use the following widely-used support measures [1,15,25]: the count of edges such that matches a substring of and matches a substring of , or vice versa; and the -score of with respect to [25].
To the best of our knowledge, three techniques have so far been proposed. Unfortunately, these techniques differ not only in their mining method, but also in the matching relation and the support measure used.
The first work by Tan et al. [25] introduced D-MOTIF, an exact algorithm for finding correlated motif pairs under the Hamming distance. D-MOTIF considers to quantify support. The basic idea of the algorithm is to enumerate all possible motif pairs from every pair , using the Hamming distance neighborhood notion, and then check if they have enough support. The authors also suggested a heuristic counterpart called D-STAR. Unfortunately, neither D-MOTIF nor D-STAR scales to networks with more than 250 proteins.
The second work by Leung et al. [15] introduced FindMotif, an exact algorithm for -CMM. FindMotif uses a different support measure that considers the probability that the observed number of interactions is generated under a null hypothesis. The algorithm builds a table of entries, one per possible motif pair over alphabet , and computes the support for each using a voting technique. The authors also suggested a heuristic counterpart called MotifHeuristics, which was able to handle larger networks than D-STAR.
The third work by Boyen et al. [1] proved that -CMM is NP-hard for so-called compliant biclique-maximal measures, which include and . They also introduced SLIDER, a generic metaheuristic that incorporates two steepest-ascent procedures. The central component of these procedures is a neighborhood function defined by viewing a motif as a window that slides along the protein sequence of one of the proteins. Unlike more conventional neighborhood functions, this has a clear biological interpretation: if a motif partially overlaps a binding site in a sequence, a few mutations should suffice to convert it into a binding site. In this sense, both neighborhood functions are designed to identify nearby motifs that may correspond to regions close to one another on actual proteins. The difference is that one neighborhood function considers as neighbors all motifs that could, in principle, lie near the given motif on any protein, whereas the other restricts attention to motifs that are actually nearby on a single selected protein. Although SLIDER can be paired with an arbitrary support measure, the authors used , providing compelling evidence that it is biologically the most relevant, and showing that SLIDER outperforms MotifHeuristics.
1.2 Our contributions. Since the motif-driven approach to CMM is computationally hard, in general [1], it is widely believed that exact optimization is imprac-tical for realistically sized PPI networks. Consequently, the main aim of the existing works [1, 15, 25] has been to design efficient and effective heuristics that identify high-quality motif pairs in reasonable time. This need is particularly acute for modern real-world datasets, which are large, noisy, and in need of methods that scale while still capturing biologically meaningful patterns.
Here, however, we present an exact method that remains efficient in practice on modern datasets, thereby showing that the problem can be solved far more effectively than is commonly believed. Our results thus refute the prevailing view that only heuristic approaches are viable for this task. Our crucial observation is that the hardness proof in [1] proceeds under the assumption that both and d are unbounded, which is not realistic in the motivating application. Intuitively, we confine the computational hardness to parameter . Indeed, the values considered for and d are typically small [1,15,25].
We make the following theoretical contributions:
(1) We give an exact -time algorithm for CMM (the vanilla version), where . The space usage is . See Section 3.
(2) We show that this algorithm is essentially optimal: no algorithm can solve CMM in time , for any , unless the popular Strong Exponential-Time Hypothesis (SETH) [9] is false. See Section 3.
(3) We build on the CMM algorithm to give an exact -time algorithm for -CMM (the wildcards version). The space usage is ; and the algorithm is embarrassingly parallelizable. This improves dramatically on the state of the art from time to and from space to . See Section 4.
(4) Finally, we observe that -CMM is W[1]-hard parameterized by d. See Section 4.
We make the following practical contributions:
(1) We show that the parallelized version of our algorithm for -CMM processes real-world datasets in a reasonable amount of time.
(2) We show that the runtime and space usage predicted by our theoretical results are accurately reflected in practice.
(3) We show that our exact algorithm finds motif pairs with significantly higher support than the state of the art, which highlights its usefulness.
(4) We show that our exact algorithm finds many top-scoring motif pairs that the state of the art misses.
For the above practical contributions, see Section 5. We begin with some preliminaries in Section 2.
2 Preliminaries. We assume throughout that arrays and strings start at position 1.
2.1 Strings. A string is a finite sequence of characters over an alphabet . In this work, we consider strings over a totally ordered alphabet. We denote the length of a string by . For any index , we denote the -th character of by . A string of the form , where , is called a fragment of . If is known, we can encode in space as the pair . A fragment of the form is called a prefix of , and a fragment of the form is called a suffix of . A string is a substring of if , for some . In this case, we say that occurs in . A wildcard is a special symbol matching any .
Given a string of length , the suffix array of , denoted by , stores a permutation of the indices such that is the -th lexicographically smallest suffix of . Let denote the length of the longest common prefix (LCP) of the strings and . The array of , denoted by , is defined as follows: , and for every , .
2.2 Graphs and motifs. Let be an undirected graph, where , for an alphabet . Let denote the total length of all . An -motif is a string containing exactly wildcard symbols . When , the motif is simply a string over of length . An -motif pair is an unordered pair of -motifs. We may omit and when they are clear from the context and then simply speak of motifs and motif pairs.
2.3 Motif-induced subgraphs. For a motif X, let be the set of nodes where X occurs. If a node v contains multiple occurrences of X, then v is included only once in .
For a motif pair , the set of edges whose endpoints contain X and Y, respectively, is
We set . The subgraph selected by is then . If is nonempty, we may have an edge between distinct nodes provided that at least one of them is in . On the other hand, if , they cannot be adjacent by definition of .
A motif pair is called a -motif pair for if satisfies , , and
The notation suppresses polynomial factors.
. It is called complete if every node of is adjacent to every node of . A complete bipartite graph is called a biclique.
2.4 Support measures. A support measure f on G is a function that maps an -motif pair to a nonnegative real number . Different types of support functions have been considered in the literature [1, 15, 25]. We restrict our attention to and , which we define below. The former is simple and illustrative and will serve to make our theoretical analysis lucid. The second works well in practice [1] and we use it in our experimental evaluation (we also show that our theoretical results extend to it).
2.5 The support measure. The -based support measure of a graph G with respect to an -motif pair , denoted by , is defined as
where is the expected number of edges between and under a uniform random-graph model. Concretely,
where is the edge density of , and
is the maximum possible number of edges in the subgraph selected by any -motif pair. The parameters , , and are as defined above; and are trivially obtained from the input. Intuitively, this measure captures how much above the average density a subgraph selected by a motif pair is, taking into account its size.
3 An exact algorithm for CMM. To simplify our presentation, we focus on the support measure for now, but the same algorithmic ideas also apply to the support measure. Recall that counts the edges such that matches a substring of and matches a substring of , or vice versa.
THEOREM 3.1. There is an algorithm for CMM with running in time , where . The space used is .
Proof. The algorithm (see Algorithm 3.1) iterates over all motif pairs , such that X and Y are substrings of at least one of the labels, and then counts the corresponding number of edges. That is, it computes the value explicitly. Therefore, taking the maximum will clearly produce the desired output.
The more interesting part is how to implement some of the operations efficiently enough. The short version is that the suffix array (SA) will give us all the necessary tools. First, observe that we can construct the SA of the concatenation of the node strings (with some separation character) in time [12] after sorting all characters occurring in all strings in time. The SA (together with the LCP array) gives us a constant-size unique name for each length- substring of any label that can be computed (after preprocessing) in constant time given a location in a node string. Call this the rank of a substring. Note that the ranks are the same for all occurrences of the same substring. In addition, these are integers bounded by N. One may think of this as a perfect hash function that we can use to (1) compare substrings in constant time, and (2) implement the dictionary C defined in Line 1 using space. Using (1) and (2), we implement the loop in Line 3 so that it runs in time. In particular, after a single linear pass over the node strings, we use these names to build a simple inverse index to access the nodes that contain a given rank, as required in Line 4. As we access the nodes for each label exactly once and this inverse index has total size , that is also the total time to access the nodes. Similarly, observe that in a linear pass, we can build a list of the unique ranks that occur in each node, making the loop in Line 6 take time in total for each X. The operations in the innermost loop require constant time. In particular, the operation can be any total order on the length- substrings. To get a constant-time comparator, we choose the rank order.
Thus, we are finally left to argue why the loop in Line 5 does not blow up the running time. Observe that each edge is only considered for a motif pair if occurs in and occurs in . (Each edge is visited exactly once in Line 5, oriented so that ; the second loop adds the 's that occur only in .) This can happen at most times. Then
yields the desired bound. The space used is as SA and C are implemented in space.
Remark 3.2 (Sparse graphs). It is easy to see that the running time of Algorithm 3.1 can also be bounded by . Thus, we expect the algorithm to perform better on sparse graphs where the
Algorithm 3.1 Basic algorithm for CMM with . Some operations require care to implement efficiently; see the proof of Theorem 3.1.
Input: Graph with , integer
Output: Motif pair from maximizing
1: Let be indexed using SA ranks
2:
3: for each distinct length- substring in
4: is a substring of
5: for each with
6: for each distinct length- substring of
7: if
8:
9: for each with
10: for each distinct length- substring of
11: if and is not a substring of
12:
13: Update if
14: Reset (the touched entries of)
15: return
labels are relatively short. The latter is natural because in many practical instances, the labels have roughly the same length (thus, relatively short compared to N).
Remark 3.3 (Enumeration). Instead of simply optimizing in Algorithm 3.1, we can build a complete sorted list of all motif pairs and their support value (storing them using ranks). Since the values of the support measure are bounded by , we can do this while maintaining the running time using an algorithm like radix sort. Unfortunately, this increases the space complexity to in the worst case. In practice, we are only interested in the top-k motif pairs. These we can maintain with an multiplicative overhead by keeping a heap with the top-k pairs.
We defer the changes required for and the SETH lower bounds for both and to Appendix A.
4 An exact algorithm for -CMM. Algorithm 3.1 for CMM (Theorem 3.1) will serve as a basis for our exact algorithm for -CMM.
The basic premise is simple: iterate over all possible combinations of wildcard positions in the two motifs and then run a modified version of Algorithm 3.1 that ignores the characters at these positions. While this seems easy, achieving it without losing efficiency is somewhat tricky, especially when targeting space. Recall that in Algorithm 3.1, we heavily relied on the rank of every length- substring in the suffix array (SA) of the concatenated node strings. In particular, we relied on the fact that this rank is a compact representation of the substrings. Thus, we were able to compare any two substrings for equality by simply comparing their ranks. With the wildcards, we need to treat substrings that are actually different as the same, that is, we have a relaxed notion of equality that ignores the wildcarded positions. Defining the right notion of rank and implementing access to it efficiently requires a substantial amount of care. We show the following core lemma.
LEMMA 4.1. Given a set of strings of total length over , an integer , and a set with , we can construct an -size data structure in time and working space answering the following queries in time: given , with and , return a rank (a unique identifier) of string of length , such that, for all :
In particular, the output rank is an integer from .
Proof. Consider Algorithm 4.1. We show that this algorithm solves exactly the claimed task.
Let . Further let be the concatenation of the input strings with appropriate separators and let . (We will ignore suffixes of starting with separators.) In time, we construct the suffix array [12] and the LCP array [13].
Consider the list of the suffixes of . The characters that occur at the positions of every suffix are replaced by wildcards to obtain suffixes each split into fragments. The above replacements are implicit; we never apply them. Moreover, we are interested only in the length- prefix of each suffix. Some care is needed: if a suffix is shorter than , we ignore it from any further computation; and if a suffix contains a separator in its length- prefix, we also ignore it. Using and starting with the first substrings (prefixes of suffixes) of length exactly , a new rank is assigned to each of them according to the lexicographical ordering of these substrings; this can be easily derived from a single scan of in time. We then proceed to analogously, and so on. To maintain space, for every consecutively considered pair of wildcard positions, we use radix sort over the pairs of ranks (corresponding to the suffixes) to obtain a new integer ranking over , and the process continues. In the end, we have a new lexicographical ordering of the length- prefixes of suffixes of that disregards the characters at the -th, ..., -th positions. Moreover, for every two successive length- prefixes in this order, we know whether they have an LCP of length at least , which suffices for our purposes. The whole process thus takes time. Since this list is sorted, identical length- prefixes (here identical means with wildcards) are grouped and so each group member gets the same rank from .
Two length- substrings are identical under H if and only if their constituent fragments between the indices of H are identical. By treating each substring as a tuple of ranks corresponding to these fragments—specifically —and applying radix sort, we obtain a lexicographical ordering (of the suffixes) based strictly on the subsequence of non-wildcard characters. This correctly groups all occurrences of a specific motif M into a contiguous range in the sorted list.
The ranks (unique identifiers) are stored in the array R returned by Algorithm 4.1, indexed by the starting position of each suffix in . Given and an offset i, the length- prefix of the corresponding suffix is exactly the length- substring ; hence, a single lookup in R returns its identifier in time, which is invariant under replacing the positions in H by , as claimed. The d radix-sort rounds and the LCP array scans each cost time. In total, the algorithm costs time and uses working space.
Remark 4.2. The technique in Lemma 4.1 is inspired by the construction of the gapped suffix array [4]. A notable difference is the following: since is fixed, we avoid the use of LCE queries (cf. [14]), and compute the relevant LCP values by comparing integers in time (Lines 8–17). While this makes no difference in theory, it is crucial in practice, as LCE data structures are typically either costly to construct or costly to query.
THEOREM 4.3. There is an algorithm for -CMM with running in time
where . The space used is .
Proof. We solve -CMM by a slight adaptation of the algorithm from Section 3. Fix a pair of wildcard combinations, one for and one for . In a pre-processing step, we sort the characters occurring in all strings , thus mapping them onto the range . This is done once in time. We now apply Lemma 4.1 that takes time using space, and obtain, for every length- substring (resp. ) of a node, an identifier rank (resp. rank) under (resp. under ) such that: any two length- substrings receive the same identifier if and only if they agree on all non-wildcard positions.
Algorithm 4.1 Rank assignment to -motifs. See the proof of Lemma 4.1.
Input: Wildcard positions ; string ; suffix array ; LCP array
Output: Array R such that is the rank of suffix by its length- prefix, in lexicographic order ignoring the positions in
1: Let be the positions such that is defined and contains no separator
2: for each
3: Add and to Handle intervals before first and after last wildcard
4: for to
5: Non- interval
6: if is empty then continue
7: ▶ Step 1: Compute ranks for
8: rank ;
9: for to
10: if then rank rank + 1
11: rank
12: ▶ Step 2: Refine by (current rank, rank for )
13: Stably sort by key
14: rank ;
15: for to
16: if key then rank rank + 1
17: rank
18:
19: return
Namely, we view as the equivalent of the rank from Algorithm 3.1.
These identifiers satisfy the two properties that the proof of Theorem 3.1 requires of the rank: they let us (1) test equality of two (wildcarded) length- substrings in time and (2) index the dictionary in space. Hence, we run Algorithm 3.1 verbatim on the fixed pair , substituting the wildcard-aware ranks for the plain ranks. By Theorem 3.1, this computes the maximum over all motif pairs whose wildcards sit at positions in time and space.
Since the problem requires maximizing an objective function over unknown (non-fixed) wildcard positions, the algorithm iterates through all possible pairs of d-size subsets . This exhaustive search guarantees completeness: if an optimal motif pair exists with a specific wildcard configuration, the algorithm will inevitably process it during the iteration. Running the above for each of the choices of and choices of and taking the overall maximum therefore solves
-CMM in time using space.
This algorithm can be extended to the support measure by adapting the version of Algorithm 3.1 (see Corollary A.1). We defer the W[1]-hardness for -CMM, parameterized by , to Appendix B.
4.1 Parallelization. The algorithm of Theorem 4.3 is easy to parallelize since the computation can be carried out independently for each wildcard combination. As motif pairs are unordered, roughly half of the combinations need to be considered, giving independent jobs, each running in time. For , the motifs and are always distinct, so the tie-breaking test of Algorithm 3.1 is applied only in the jobs with . Since each thread processes a disjoint subset of the motif pairs, the global optimum is the maximum of the per-job optima, so aggregation is trivial. We will later see that this is both easy to implement and efficient in practice. Moreover, by using Theorem 4.3, space is used per thread.
5 Experimental results. In this section, we compare our exact algorithm against SEQ-SLIDER and M-SLIDER, two variants of SLIDER [1], the state-of-the-art (heuristic) method. Each employs a different neighborhood function when sliding over neighboring motifs during steepest ascent. We also empirically evaluate the time and space complexities of our exact algorithm to confirm our theoretical findings. These goals were split into the following research questions:
RQ1: How do the scores of SLIDER's solution set compare to the ones of the optimal solution set?
RQ2: What is the recall of SLIDER's solution set relative to the optimal solution set?
RQ3: How does our algorithm scale as (and thus ) grows?
RQ4: How does our algorithm scale as grows?
RQ5: How does our algorithm scale as the number of threads used increases?
Remark 5.1. We excluded D-MOTIF [25] and FindMotif [15], as their complexities are prohibitive for our datasets and parameters, and for the same scalability reasons, we excluded their heuristic counterparts, D-STAR and MotifHeuristics. FindMotif and MotifHeuristics also lack publicly available implementations and rely on a different, probabilistic support measure. MotifHeuristics was re-implemented and evaluated in [1], where it was shown to be outperformed by SLIDER.
5.1 Datasets. We selected 5 networks of different species and with varying sizes among the 10 most queried networks from the STRING database [24, 26] (version 12). In order to replicate the setup of [1] for RQ1 and RQ2 (which concern the accuracy of SLIDER), we also included the two networks used in [1]. The characteristics of the networks are summarized in Table 5.1. These networks were preprocessed as described in Subsection C.1. All networks in Table 5.1 were used to address RQ1 and RQ2. For RQ3, RQ4, and RQ5, we also generated smaller artificial networks as described in Subsection C.1 to thoroughly investigate different input parameters.
Table 5.1: Top: Parameters of datasets from the STRING database after preprocessing. Bottom: Parameters of datasets from [1] after preprocessing.
| Dataset | |V| | |E| | N |
|---|---|---|---|
| E. coli | 4006 | 32,244 | 1,277,734 |
| S. cerevisiae I | 5791 | 104,188 | 2,744,228 |
| D. melanogaster | 10,522 | 118,698 | 6,043,033 |
| A. thaliana | 20,239 | 331,525 | 8,903,236 |
| H. sapiens I | 16,201 | 236,930 | 9,605,435 |
| S. cerevisiae II | 1620 | 9060 | 862,281 |
| H. sapiens II | 10,380 | 69,515 | 5,607,838 |
5.2 Implementations. We implemented our exact algorithm (Theorem 4.3) in C++, which we make available at https://github.com/lucper/cmm. We used libsais64 (version 2.4.10) to construct the SA and the LCP array [6] and implemented the parallel version of Theorem 4.3 (as described in Subsection 4.1) using OpenMP [5]. For SLIDER, we used the Java implementation provided by the authors [1], which is also available in our repository. Since we do not compare the efficiency of the two implementations, using the latter suffices for our purposes.
5.3 Setup. All experiments were conducted on two 32-core Intel Xeon Gold 6530 CPUs (2 threads per core, totaling threads across the two CPUs), operating at a base clock frequency of 2.1 GHz (up to 4.0 GHz), and 512 GB RAM. We compiled our implementations with g++ version 15.2.1 at the -03 optimization level. Wall-clock times were measured with std::chrono::steady_clock. Peak RAM usage was measured as the maximum resident set size using the getrusage function.
5.4 Metrics for RQ1 and RQ2.
Similarity index. In order to compare solution sets, we introduce a notion of similarity between -motif pairs. We count the edges in which two -motif pairs, and , co-occur such that the -motifs in each endpoint of the edge match substrings that are at most letters apart, where is a non-negative integer. (Note that for , we count the edges in which there exists a substring in each endpoint that both -motifs for that endpoint match.)
Let denote the set of occurrences of an -motif in string , namely . Let be the set of edges such that there exists:
(1) and with ; and
(2) and with .
Further let . Then, we define the similarity index between -motif pairs and as
In particular, we note that corresponds to the similarity index used by [1] in their experimental evaluation of SLIDER. In our evaluation, we used the more lenient version for a motif length ; that is, we afforded SLIDER's solution set more slack when it was compared to our exact algorithm's solution set.
Reduced solution set. Let be a solution set ranked from the highest-scoring motif pair to the lowest-scoring one, . We construct a reduced solution set with the following property: for any distinct motif pairs and in , we require that . Note that our similarity relation is not transitive, so there may exist multiple subsets of with this property. Following the approach of [1], our set is constructed with the following greedy strategy: for each , we remove every with satisfying .
Coverage of one solution set by another. Given two reduced solution sets and , we define the coverage of by , parameterized by and , as
This resembles the notion of recall: we are effectively measuring the fraction of motif pairs from retrieved by (under similarity at a threshold ).
Setup. In order to compare M-SLIDER and SEQ-SLIDER's solution quality with that of our exact algorithm, we used complementary metrics: first, we compared the score distribution of M-SLIDER and SEQ-SLIDER's reduced solution sets with our exact algorithm's (RQ1); second, we used the similarity index introduced above to measure how similar the reduced solution sets are (RQ2).
We ran M-SLIDER and SEQ-SLIDER over 10 trials, each with a maximum convergence time of 10 minutes (totaling 100 minutes of running time for each dataset), and requested at most 10,000 highest scoring ( , d)-motif pairs per trial. Then, we concatenated them, removed identical ( , d)-motif pairs (i.e., the same pair rediscovered across independent trials), sorted by the score descending, retained at most 10,000 top-scoring distinct ( , d)-motif pairs, and applied the “deduplication” procedure described above. The resulting reduced solution sets of M-SLIDER and SEQ-SLIDER are denoted by and , respectively. We ran our exact algorithm once, retrieved the top 10,000 highest scoring ( , d)-motif pairs, and applied the “de-duplication” procedure; the resulting reduced solution set is denoted by . For RQ1 and RQ2, we ran this setup for parameter pairs ( , ) and ( , ), following the setup of [1].
5.5 Results for RQ1. We compared the scores of and with as follows. Since any solution set is ranked from highest to lowest score and the highest scoring -motif pair of has the best possible score, we normalized the score of each -motif pair from all (reduced) solution sets by dividing each by . Since we are comparing the top-scoring -motif pairs across , , and , the resulting solution sets , , and after normalization were truncated to have size . Figure 5.1 shows the resulting (normalized) score distributions of and compared to for the parameter pair ; for the parameter pair , see Figure 5.2. Firstly, we note that SEQ-SLIDER consistently outperforms M-SLIDER in all datasets, which confirms the evaluation in [1]. Secondly, the score of is comparable to only for the E. coli, S. cerevisiae (I and II), and D. melanogaster datasets across parameter pairs and . For the (larger) remaining datasets, A. thaliana and H. sapiens (I and II), the score of is far from . For instance, for the parameter pair , has average score 14,963, 7313, and 1094 for the A. thaliana, H. sapiens I, and H. sapiens II datasets, respectively, whereas has average score 26,777, 10,439, and 1514, respectively. We note that these gaps are larger for the parameter pair (see Figure 5.2).
These results establish that our exact algorithm mines motif pairs whose scores are at least as high as SEQ-SLIDER's on all datasets and substantially higher on larger ones. Two possible explanations are: (1) our algorithm captures the same interactions with more precise motif pairs, raising the score; or (2)
M-SLIDER --
SEQ-SLIDER --
Exact —

(a) E. coli
M-SLIDER --
SEQ-SLIDER --
Exact —

(b) S. cerevisiae I

(a) E. coli

(b) S. cerevisiae I

(c) D. melanogaster

(d) A. thaliana

(c) D. melanogaster

(d) A. thaliana

(e) H. sapiens I

(f) S. cerevisiae II

(e) H. sapiens I

(f) S. cerevisiae II

(g) H. sapiens II
Figure 5.1: Distribution of (normalized) scores of and compared to across datasets of Table 5.1 for parameter pair .

(g) H. sapiens II
Figure 5.2: Distribution of (normalized) scores of and compared to across datasets of Table 5.1 for parameter pair .
our algorithm finds interactions that SLIDER misses altogether. Subsection 5.6 is designed to show that case (2) is a significant contributor to the observed difference in scores.
5.6 Results for RQ2. We measured the fraction (coverage) of -motif pairs in that have similarity to at least one -motif pair in and . Here, we summarize the results for SEQ-SLIDER only since it outperformed M-SLIDER in all but one instance (H. sapiens I with ); refer to Table C.2 in the appendix. The coverage of by ranges from 8% to 52% across both parameter pairs for the A. thaliana and H. sapiens (I and II) datasets, meaning that SEQ-SLIDER misses at least roughly half of the top-scoring motif pairs, and up to 92% of them (M-SLIDER fares similarly). For the remaining datasets — E. coli, S.
M-SLIDER — SEQ-SLIDER —
M-SLIDER — SEQ-SLIDER —

(a) E. coli

(b) S. cerevisiae I

(a) E. coli

(b) A. thaliana

(c) D. melanogaster

(d) A. thaliana

(c) H. sapiens I

(d) S. cerevisiae II

(e) H. sapiens I

(f) S. cerevisiae II

(g) H. sapiens II
Figure 5.3: For every , we show the highest such that (resp. ) for parameter pair .
cerevisiae (I and II) and D. melanogaster — the coverage of by ranges from 45% to 100%. In particular, it was 100% only for S. cerevisiae I and D. melanogaster with parameter pair . Note that we used the more lenient version of the similarity index to derive these results.
Moreover, for each -motif pair , we also computed the highest similarity , where (resp. ). Figure 5.3

(e) H. sapiens II
Figure 5.4: For every , we show the highest such that (resp. ) for parameter pair . We omitted the results for S. cerevisiae I and D. melanogaster because was fully covered by .
shows the distribution of -motif pairs from for the parameter pair as a density plot. We observe that has a substantial amount of -motif pairs with similarity below 50% to their closest counterparts in and for the D. melanogaster, A. thaliana, and H. sapiens (I and II) datasets. On the other hand, for the E. coli and S. cerevisiae (I and II) datasets, most -motif pairs in have similarity above 70% to their closest counterparts in and .
We arrive at the same conclusion for the parameter pair , although SEQ-SLIDER had a better overall performance compared to ; see Figure 5.4. In particular, we note that every motif pair in has similarity with some motif pair in or on the S. cerevisiae I and


Figure 5.5: Wall-clock time and peak RAM usage per thread of exact algorithm for , , , and varying (and ). We use log-log axes with the dashed lines indicating a polynomial of degree 2 (resp. degree 1) fitting the data for time (resp. peak RAM). Top: with dashed line on . Bottom: with dashed line on , and lines for and labeled with .
Figure 5.6: Wall-clock time and peak RAM usage per thread of exact algorithm for , , , and varying (and ). We use log-log axes with the dashed lines indicating a polynomial of degree 2 (resp. degree 1) fitting the data for time (resp. peak RAM). Top: with dashed line on . Bottom: with dashed line on , and lines for and labeled with .
D. melanogaster datasets.
Together, these results establish that our exact algorithm mines a substantial amount of -motif pairs that are missed by SEQ-SLIDER and M-SLIDER for the largest datasets from the STRING database (A. thaliana and H. sapiens I) and from [1] (H. sapiens II).
5.7 Results for RQ3. We fixed the edge density for all instances to 5%, and varied and . We used threads, where by we denote the number of threads available in our system. For , we varied from 0 to 7; the results are shown in Figure 5.5. We also performed this experiment for with varying from 0 to 4. The results are shown in Figure 5.6; they yield the same conclusion, but with smaller running times and peak RAM usage. We observe a quadratic behavior in for the running times shown in Figure 5.5 (turned into straight lines with log-log axes for readability), for fixed values of and . The running times further highlight their dependence on the maximum number of distinct -motifs in across all combinations of wildcard positions. For fixed and , observe that decreases as grows, since more wildcard positions yield fewer distinct -motifs in . Indeed, in practice, is significantly smaller than for larger . (We label exemplary lines in Figure 5.5 with .) This reflects in faster running times for a fixed wildcard combination. However, when considering all wildcard combinations, the running times are non-decreasing for and non-increasing for because the term behaves the same way on these intervals. The peak RAM usage shown in Figure 5.5 also confirms the linear behavior in per thread.
We also report the running time and peak RAM usage per thread of our exact algorithm on the datasets of Table 5.1; see Table C.3 in the appendix. We remark that for the dataset with the largest N, H. sapiens I, the exact algorithm took roughly 50h with peak RAM 1.29GB per thread for parameter pair and only 2h with peak RAM 1.28GB per thread for parameter pair . We used threads for both.
5.8 Results for RQ4. We fixed and varied the edge density . The rest of the setup is analogous to RQ3: for , we varied from 0 to 7 (Figure 5.7); for , we varied from 0 to 4 (Figure 5.8); and we used threads. Here, our theoretical prediction for the time bound is , which is confirmed by the running times shown in Figure 5.7. Indeed, by


Figure 5.7: Wall-clock time and peak RAM usage per thread of exact algorithm for , , , and varying ed(G). Top: . Bottom: and lines for and labeled with .
varying ed(G) and fixing the remaining parameters, the running time grows linearly with input size as ed(G) grows. Moreover, the peak RAM usage for each thread remains constant in this regime, which is particularly appealing for sparse graphs.


Figure 5.8: Wall-clock time and peak RAM usage per thread of exact algorithm for , , , and varying ed(G). Top: and line for labeled with . Bottom: , and lines for and labeled with .

Figure 5.9: Wall-clock time and total peak RAM usage of exact algorithm for , , , and with varying number of threads. We use log-log axes and label the line with the speed-up obtained with the number of threads specified on the -axis.
5.9 Results for RQ5. We fixed , , , , and varied the number of threads from 1 to , the number available in our system, in order to assess the effectiveness of our parallelization. Figure 5.9 shows near-linear speed-up up to 32 threads ( ), after which returns diminish: the speed-up peaks at with 64 threads and does not improve further. We conjecture that these diminishing returns are due to load imbalance: some wildcard combinations are more costly than others, and at 128 threads, an expensive combination dominates the wall-clock time. Moreover, since the algorithm parallelizes over wildcard combinations, at most that many threads can be productively used; since we test at most 128, this limit is never reached. Finally, the space complexity becomes because each thread requires working space, and we have parallel threads.
Reproducibility and source code. The source code and datasets utilized in this study are currently available via https://github.com/lucper/cmm. All experimental results presented in this paper are fully reproducible using these provided resources.
AI use disclosure. All theoretical concepts and core proofs originated entirely from the authors' own work. The authors employed AI tools to polish language and style, support verification of proofs, produce LaTeX code for Figure 1.1, Figure A.1, and Figure A.2, and produce code for plotting data. Every AI-generated output was carefully reviewed, verified, and revised by the authors, who assume full responsibility for the paper's content.
Acknowledgments. Lucas P. Oliveira is funded by grant #2025/08034-9, São Paulo Research Foundation (FAPESP).
[2] L. CHEN, On the hardness of approximate and exact (bichromatic) maximum inner product, in 33rd Computational Complexity Conference, CCC 2018, San Diego, CA, USA, June 22-24, 2018, R. A. Servedio, ed., vol. 102 of LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018, pp. 14:1–14:45, https://doi.org/10.4230/LIPICS.CCC.2018.14.
[3] S. R. COLLINS, P. KEMMEREN, X.-C. ZHAO, J. F. GREENBLATT, F. SPENCER, F. C. P. HOLSTEGE, J. S. WEISSMAN, AND N. J. KROGAN, Toward a Comprehensive Atlas of the Physical Interactome of Saccharomyces cerevisiae, Mol. Cell. Proteom., 6 (2007), pp. 439–450, https://doi.org/10.1074/mcp.M600381-MCP200.
[4] M. CROCHEMORE AND G. TISCHLER, The gapped suffix array: A new index structure for fast approximate matching, in String Processing and Information Retrieval - 17th International Symposium, SPIRE 2010, Los Cabos, Mexico, October 11-13, 2010. Proceedings, E. Chávez and S. Lonardi, eds., vol. 6393 of Lecture Notes in Computer Science, Springer, 2010, pp. 359–364, https://doi.org/10.1007/978-3-642-16321-0_37.
[5] L. DAGUM AND R. MENON, OpenMP: An Industry-Standard API for Shared-Memory Programming, IEEE Comput. Sci. Eng., 5 (1998), pp. 46–55, https://doi.org/10.1109/99.660313.
[6] I. GREBNOV, libsais: Linear-time suffix array, lcp array, and burrows-wheeler transform construction. https://github.com/IlyaGrebnov/libsais, 2026. GitHub repository, accessed 2026-07-17.
[7] E. L. HUTTLIN, R. J. BRUCKNER, J. NAVARRETE-PEREA, J. R. CANNON, K. BALTIER, F. GEBREAB, M. P. GYGI, A. THORNOCK, G. ZARRAGA, S. TAM, J. SZPYT, B. M. GASSAWAY, A. PANOV, H. PARZEN, S. FU, A. GOLBAZI, E. MAENPAA, K. STRICKER, S. GUHA THAKURTA, T. ZHANG, R. RAD, J. PAN, D. P. NUSINOW, J. A. PAULO, D. K. SCHWEPPE, L. P. VAITES, J. W. HARPER, AND S. P. GYGI, Dual proteome-scale networks
reveal cell-specific remodeling of the human interactome, Cell, 184 (2021), pp. 3022–3040.e28, https://doi.org/10.1016/j.cell.2021.04.011.
[8] S. IDREES, K. R. PAUDEL, T. SADAF, AND P. M. HANSBRO, Uncovering domain motif interactions using high-throughput protein-protein interaction detection methods, FEBS Lett., 598 (2024), pp. 725–742, https://doi.org/10.1002/1873-3468.14841.
[9] R. IMPAGLIAZZO, R. PATURI, AND F. ZANE, Which problems have strongly exponential complexity?, J. Comput. Syst. Sci., 63 (2001), pp. 512–530, https://doi.org/10.1006/JCSS.2001.1774.
[10] P. JIA, F. ZHANG, C. WU, AND M. LI, A comprehensive review of protein-centric predictors for biomolecular interactions: from proteins to nucleic acids and beyond, Briefings Bioinform., 25 (2024), https://doi.org/10.1093/BIB/BBAE162.
[11] J. JUMPER, R. EVANS, A. PRITZEL, T. GREEN, M. FIGURNOV, O. RONNEBERGER, K. TUNYASUVUNAKOOL, R. BATES, A. ZÍDEK, A. POTAPENKO, A. BRIDGLAND, C. MEYER, S. A. A. KOHL, A. J. BALLARD, A. COWIE, B. ROMERA-PAREDES, S. NIKOLOV, R. JAIN, J. ADLER, T. BACK, S. PETERSEN, D. REIMAN, E. CLANCY, M. ZIELINSKI, M. STEINEGGER, M. PACHOLSKA, T. BERGHAMMER, S. BODENSTEIN, D. SILVER, O. VINYALS, A. W. SENIOR, K. KAVUKCUOGLU, P. KOHLI, AND D. HASSABIS, Highly accurate protein structure prediction with AlphaFold, Nature, 596 (2021), pp. 583–589, https://doi.org/10.1038/s41586-021-03819-2.
[12] J. KÄRKKÄINEN, P. SANDERS, AND S. BURKHARDT, Linear work suffix array construction, J. ACM, 53 (2006), pp. 918–936, https://doi.org/10.1145/1217856.1217858.
[13] T. KASAI, G. LEE, H. ARIMURA, S. ARIKAWA, AND K. PARK, Linear-time longest-common-prefix computation in suffix arrays and its applications, in Combinatorial Pattern Matching, 12th Annual Symposium, CPM 2001 Jerusalem, Israel, July 1-4, 2001 Proceedings, A. Amir and G. M. Landau, eds., vol. 2089 of Lecture Notes in Computer Science, Springer, 2001, pp. 181–192, https://doi.org/10.1007/3-540-48194-X_17.
[14] G. M. LANDAU AND U. VISHKIN, Efficient string matching with k mismatches, Theor. Comput. Sci., 43 (1986), pp. 239–249, https://doi.org/10.1016/0304-3975(86)90178-7.
[15] H. C. M. LEUNG, M. H. SIU, S. M. YIU, F. Y. L. CHIN, AND K. W. K. SUNG, Finding linear motif pairs from protein interaction networks: a probabilistic approach, in Proceedings of the 6th Annual International Conference on Computational Systems Bioinformatics (CSB 2007), Imperial College Press, 2007, pp. 111–119.
[16] H. LI, J. LI, AND L. WONG, Discovering motif pairs at interaction sites from protein sequences on a proteome-wide scale, Bioinform., 22 (2006), pp. 989–996, https://doi.org/10.1093/BIOINFORMATICS/BTL020.
[17] J. LI, G. LIU, H. LI, AND L. WONG, Maximal biclique subgraphs and closed pattern pairs of the adjacency matrix: A one-to-one correspondence and mining algorithms, IEEE Trans. Knowl. Data Eng., 19 (2007), pp. 1625–1637, https://doi.org/10.1109/TKDE.2007.190660.
[18] J. LI, K. SIM, G. LIU, AND L. WONG, Maximal quasi-bicliques with balanced noise tolerance: Concepts and co-clustering applications, in Proceedings of the SIAM International Conference on Data Mining, SDM 2008, April 24-26, 2008, Atlanta, Georgia, USA, SIAM, 2008, pp. 72–83, https://doi.org/10.1137/1.9781611972788.7.
[19] B. LIN, The parameterized complexity of k-biclique, in Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, P. Indyk, ed., SIAM, 2015, pp. 605–615, https://doi.org/10.1137/1.9781611973730.41.
[20] K. LUCK, D.-K. KIM, L. LAMBOURNE, K. SPIROHN, B. E. BEGG, W. BIAN, R. BRIGNALL, T. CAFARELLI, F. J. CAMPOS-LABORIE, B. CHARLOTEAUX, D. CHOI, A. G. COTE, M. DALEY, S. DEIMLING, A. DESBULEUX, A. DRICOT, M. GEBBIA, M. F. HARDY, N. KISHORE, J. J. KNAPP, I. A. KOVACS, I. LEMMENS, M. W. MEE, J. C. MELLOR, C. POLLIS, C. PONS, A. D. RICHARDSON, S. SCHLABACH, B. TEEKING, A. YADAV, M. BABOR, D. BALCHA, O. BASHA, C. BOWMAN-COLIN, S.-F. CHIN, S. G. CHOI, C. COLABELLA, G. COPPIN, C. D'AMATA, D. DE RIDDER, S. DE ROUCK, M. DURAN-FRIGOLA, H. ENNAJDAOUI, F. GOEBELS, L. GOEHRING, A. GOPAL, G. HADDAD, E. HATCHI, M. HELMY, Y. JACOB, Y. KASSA, S. LANDINI, R. LI, N. VAN LIESHOUT, A. MACWILLIAMS, D. MARKEY, J. N.
PAULSON, S. RANGARAJAN, J. RASLA, A. RAYHAN, T. ROLLAND, A. SAN-MIGUEL, Y. SHEN, D. SHEYKHKARIMLI, G. M. SHEYNKMAN, E. SIMONOVSKY, M. TASAN, A. TEJEDA-ARRONA, P. TOMEZSKO, J.-C. TWIZERE, J. VLASBLOM, S. WANAMAKER, J. WANG, K. WHITE, J. WOODSMITH, Y. XIA, X. YANG, E. YEGER-LOTEM, Q. ZHONG, P. ALOY, G. D. BADER, J. DE LAS RIVAS, S. GAUDET, T. HAO, J. RAK, J. TAVERNIER, D. E. HILL, M. VIDAL, F. P. ROTH, AND M. A. CALDERWOOD, A reference map of the human binary protein interactome, Nature, 580 (2020), pp. 402–408, https://doi.org/10.1038/s41586-020-2188-x.
[21] R. OUGHTRED, J. RUST, C. CHANG, B.-J. BREITKREUTZ, C. STARK, A. WILLEMS, L. BOUCHER, G. LEUNG, N. KOLAS, F. ZHANG, S. DOLMA, J. COULOMBE-HUNTINGTON, A. CHATR-ARYAMONTRI, K. DOLINSKI, AND M. TYERS, The BioGRID database: A comprehensive biomedical resource of curated protein, genetic, and chemical interactions, Protein Sci., 30 (2021), pp. 187–200, https://doi.org/10.1002/pro.3978.
[22] K. PANNEERSELVAM, P. PORRAS, N. DEL-TORO, L. PERFETTO, A. SHRIVASTAVA, E. RAGUENEAU, J. J. M. REYES, S. ORCHARD, H. HERMJAKOB, AND IMEX CONSORTIUM CURATORS, IntAct database for accessing IMEx's contextual metadata of molecular interactions, Curr. Protoc., 4 (2024), p. e70018, https://doi.org/10.1002/cpz1.70018.
[23] F. SOLEYMANI, E. PAQUET, H. VIKTOR, W. MICHALOWSKI, AND D. SPINELLO, Protein-protein interaction prediction with deep learning: A comprehensive review, Comput. Struct. Biotechnol. J., 20 (2022), pp. 5316–5341, https://doi.org/10.1016/j.csbj.2022.08.070.
[24] D. SZKLARCZYK, R. KIRSCH, M. KOUTROULI, K. C. NASTOU, F. MEHRYARY, R. HACHILIF, A. L. GABLE, T. FANG, N. T. DONCHEVA, S. PYYSALO, P. BORK, L. J. JENSEN, AND C. VON MERING, The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest, Nucleic Acids Res., 51 (2023), pp. D638–D646, https://doi.org/10.1093/NAR/GKAC1000.
[25] S. TAN, H. WILLY, W. SUNG, AND S. NG, A correlated motif approach for finding short linear motifs from protein interaction networks, BMC Bioinform., 7 (2006), p. 502, https://doi.org/10.1186/1471-2105-7-502.
[26] C. VON MERING, M. A. HUYNEN, D. JAEGGI, S. SCHMIDT, P. BORK, AND B. SNEL, STRING: a database of predicted functional associations between proteins, Nucleic Acids Res., 31 (2003), pp. 258–261, https://doi.org/10.1093/NAR/GKG034.
[27] R. WILLIAMS, A new algorithm for optimal 2-constraint satisfaction and its implications, Theor. Comput. Sci., 348 (2005), pp. 357–365, https://doi.org/10.1016/J.TCS.2005.09.023.
A Materials omitted from Section 3
A.1 The support measure. While the function lends itself well to our theoretical analysis, it is not ideal for the biological domain. In particular, in a PPI network, maximizing the function finds a motif pair that potentially explains many interactions (i.e., there are many edges where X appears on one side and Y on the other). To make it more likely we find an actual interaction, we also want the property that there are few non-edges where X appears on one side and Y on the other. In other words, we want the presence of X and Y to make an interaction likely. This is not captured by . In graph-theoretic terms, we want to ensure that the subgraph selected by is dense. Here, this means denser than the average over the whole interaction network. This is exactly what the support function is designed to capture. Boyen et al. “experimentally establish the superiority of the Chi-square-based support measure over other support measures” [1].
Fortunately, the hard part in computing turns out to be computing . In the following corollary, we show that the additional information needed to derive from is easy to compute, lifting Algorithm 3.1 to support .
COROLLARY A.1 (to Theorem 3.1). There is an algorithm for CMM with running in time , where . The space used is .
Proof. We sketch how to adapt Algorithm 3.1. Given a graph , where , and a positive integer , our goal is to find a pair of motifs maximizing . Computing this quantity reduces to computing the following parameters: the number (resp. ) of nodes in which (resp. ) occurs, the number of nodes in which both and occur, and the number of edges in which occurs in an endpoint and occurs in the other.
The number of edges can be easily obtained in time using Theorem 3.1. For (resp. ), iterate over the nodes and, for each distinct length- substring of the current node, increment a counter indexed by . By handling duplicates locally at each node, this counting can be done in time. This is a simplification of Algorithm 3.1. Finally, for , construct a graph from as follows. Let and . Applying Algorithm 3.1 to yields the desired number for every pair of length- substrings . (Algorithm 3.1 and its analysis apply to graphs with self-loops).
A.2 Why we cannot do better. In this section, we use tools from fine-grained complexity to establish

Figure A.1: The construction in the proof of Theorem A.2 for , , , , , , and . Here, , and , , . The motif pair , which encodes and , occurs in the endpoints of the two highlighted edges, so .
conditional hardness. SETH [9] is a standard assumption about the complexity of deciding the satisfiability of conjunctive normal form formulas. We show that a polynomially faster algorithm for CMM (in N) yields a faster algorithm for the following problem, which in turn is known to refute SETH [2,27].
MAXIMUM INNER PRODUCT (MAXIP)
Input: Two sets of vectors each.
Output: The value .
Recall that denotes the inner product. The hardness conjecture for the MaxIP problem states that for every constant , there exists a constant such that MaxIP with dimension cannot be solved in time . Refuting this conjecture refutes SETH. With these tools, we are ready to prove our conditional hardness result.
THEOREM A.2. There is no algorithm solving CMM with in time , for any , unless SETH fails.
Proof. We reduce the decision version of MaxIP to the decision version of CMM; since the decision version is no harder than CMM itself, the lower bound carries over. Let and be sets of -dimensional binary vectors, where and are positive integers. Let denote the usual binary encoding of any positive integer and (resp. ) the -th coordinate of vector (resp. ). Our goal is to determine whether there are vectors and such that , where is a non-negative integer.
We construct an instance of CMM with as follows. Let and be sets of strings over the alphabet , and . If some or is the empty string, we omit that node together with the edge ; such a coordinate contributes to no inner product, so this does not affect the argument below. For each , let
where denotes string concatenation. That is, the node corresponding to each index is labeled by an encoding of the vectors that have that index set to 1. Figure A.1 illustrates the construction. Notice that our encoding requires exactly bits (after padding with zeros); hence, we set .
By construction, if there are vectors and such that , then the strings and are substrings of endpoints of at least edges of . In particular, notice that, for any , we can choose a pair of length- binary strings such that and are substrings of nodes and , respectively, and none of them contain the separator symbol (unless the -th bit is unset in all vectors in at least one of and , in which case we can simply ignore it); hence, they encode vectors whose inner product equals at least 1.
Conversely, suppose that strings X and Y are length- substrings of endpoints of at least p edges in an instance of CMM obtained by our construction. If either string contains a separator symbol , then it occurs only in and , so is the only edge whose endpoints can contain both strings, and the support value of is at most 1; in that case we may replace by a pair as described in the previous paragraph. Thus, we assume that X and Y are length- binary strings. Since all edges connect one node from U with one from W and by the choice of the labels, we may also assume that X starts with a 0 (and thus occurs only in U) and Y starts with a 1 (and thus occurs only in W). Since , the strings X and Y without their leading bit are the binary encodings of integers ; let and be the corresponding vectors. By construction, X occurs in if and only if , and Y occurs in if and only if . Hence, the edges whose endpoints contain X and Y are exactly the edges with , and therefore .
It is easy to calculate that for this instance, , , and , thus giving the claimed lower bound under SETH.
As for the lower bound with , some care is needed to carry the result over from , since compares with the expected number of edges, which depends on , , and . Call a length- string plain if it is a string over , and special otherwise. In the construction of Theorem A.2, the plain motifs are the encodings and of the vectors, whereas every special motif contains a separator symbol. This construction has two shortcomings with respect to . First, occurs in as many nodes as has ones (and analogously for and ), so the expected number of edges varies between pairs of plain motifs, and does not rank them by their inner product alone. Second, favors motif pairs that occur in very few nodes, since their expected number of edges is tiny and a single edge already yields a large score; special motifs are of this kind. We neutralize both effects by adding isolated nodes to the construction in the proof of Theorem A.2.
Both shortcomings, as well as our remedy, concern how relates to the number of edges and to the expected number of edges; by definition, depends only on these two quantities, so it is convenient to view it as a function of them. We need two of its properties: if the expected number of edges is fixed and below 1, then more edges yield a higher score, which lets pairs of plain motifs be ranked by their inner product; and if there is a single edge, then a larger expected number of edges yields a lower score, which lets pairs of plain motifs beat pairs containing a special motif. Formally, for an integer and a real number , let
so that whenever . The two properties are then as follows.
OBSERVATION A.3. Let . Then
(a) , and is strictly increasing in t for integers ;
(b) for every real number .
Proof. For (a), we have as , and for , which is strictly increasing in . For (b), if , then because ; otherwise, we have for , where . Since , we have , and thus .
With Theorem A.3 at hand, we are ready to prove the lower bound with .
COROLLARY A.4. There is no algorithm solving CMM with in time , for any , unless SETH fails.

Figure A.2: The construction in the proof of Corollary A.4 for the vectors of Figure A.1. The complement nodes and the padding nodes on each side are isolated. Each of 011 and 101 now occurs in exactly nodes, and each padding node (resp. ) contains every special length-3 substring of (resp. ), such as (resp. ).
Proof. We reduce MaxIP to CMM with . Let , , , , , , and the strings , ( ) be as in the proof of Theorem A.2. If all vectors in or all vectors in are zero, the maximum inner product is 0, so we assume that both sets contain a non-zero vector.
Every block of has length , so consecutive occurrences of in are positions apart. Hence, a length- substring of contains at most one occurrence of , and if it contains none, it is the first symbols of a block, that is, for some with . The same holds for with and .
We construct as follows; all nodes other than the and are isolated. For each , we add the complement nodes
where are fresh symbols; thus (resp. ) contains the encoding of if and only if (resp. ) does not. Let (resp. ) be the set of all special length- substrings of (resp. ); by our assumption, both are non-empty. For each , we add the padding nodes
where the and are fresh, pairwise distinct symbols. Since each block has length , the argument above shows that every length- substring of contains or belongs to ; in particular, contains no plain substring. The same holds for . Finally, if some , , , or is the empty string, we omit that node, together with the edge if or is omitted. Thus consists of the edges with both endpoints non-empty, so . For each , at least one of , and at least one of , is non-empty, and all padding nodes are non-empty; hence . Figure A.2 illustrates the construction.
Recall that, for a motif pair , (resp. ) is the set of nodes in which (resp. ) occurs, , , , and , where is the number of unordered pairs of distinct nodes with and . Every motif pair with has score 0, so it remains to consider pairs with . To compare their scores, let ; we show that whenever and are plain motifs occurring in such that starts with 0 and starts with 1, and whenever or is special. Since and , note that
where as (otherwise, no pair remains to be considered). We first consider pairs of two plain motifs and then pairs in which at least one motif is special.
Every plain substring of a node is the first symbols of a block, hence of the form or with . The motif occurs in if , in if , and in no other node, as the padding nodes contain no plain substring; analogously for with , , and . We call a motif pair a plain pair if and are plain motifs occurring in such that starts with 0 and starts with 1. By the above, and for some (possibly ). For a plain pair, we have and , so . Moreover, consists of the edges with , so . Consequently, , which, by Theorem A.3(a), is 0 if and strictly increasing in otherwise. Every other pair of plain motifs has : either and occur in no node, or both start with the same symbol, say 0, and thus occur only among the and their complement nodes, so the endpoint of each edge contains neither motif; the case for symbol 1 is symmetric.
Now let , possibly with , be a motif pair with such that or is special. Since every edge has the form , we may assume by symmetry that occurs in and occurs in for some edge . A special substring of (resp. ) contains , so it occurs in (resp. ) and in every padding node (resp. ), and in no node other than , , and the padding nodes. Thus, if is special, then is the only edge with an endpoint in , and likewise for ; hence . Moreover, and contain disjoint subsets of sizes at least and , or vice versa: if is special, if is special, and, by the case of plain motifs, consists of nodes among the and their complement nodes if is plain, and consists of nodes among the and their complement nodes if is plain. Hence, and thus . Therefore, by Theorem A.3(b), , which is the score of a plain pair with inner product 1.
We now combine both cases. Let , and suppose first that . A plain pair with scores , whereas, by Theorem A.3(a), every plain pair with a smaller inner product scores less, every pair containing a special motif scores less than , and every remaining pair scores 0. Hence, every motif pair maximizing is a plain pair whose vectors have inner product . To solve MaxIP, we compute a maximizing pair and output if it is a plain pair , and 0 otherwise. If , the output is by the above. If , the output is 0 either way: if the returned pair is a plain pair, its vectors have inner product 0, and otherwise we output 0 by definition.
Each of has length at most , so and each padding node has length at most . Hence, we have , , and . The instance can be built in time, e.g., by computing and through sorting the length- substrings of the and . Together with the construction, the -time check for zero vectors, and the -time decoding, an -time algorithm for CMM with would thus solve MaxIP with in time, contradicting the hardness conjecture for MaxIP and hence SETH.
B Materials omitted from Section 4
B.1 Why we cannot hope for a running time polynomial in . The result of Section 4 can be couched in parameterized complexity terms to say that -CMM is fixed-parameter tractable (in FPT) by (since ). Since is a larger parameter than (except in trivial instances), it is natural to ask if -CMM is in FPT by , too. That is, whether there is an algorithm with a running time of the form , where is any computable function. Note that we do not need to allow a separate polynomial dependence on as for all non-trivial instances .
OBSERVATION B.1. -CMM is -hard by for both and .
Proof. The result follows by checking that the reduction from [1] is a parameterized reduction from balanced biclique, parameterized by solution size, to -CMM parameterized by .
An outline of the reduction strategy is as follows. The reduction takes a graph as input and produces a node-labeled graph such that a motif consisting of 0s and d wildcards selects exactly the d nodes at its wildcard positions, so every set of d nodes can be selected (a motif containing a 1 selects at most one node). A motif pair selecting two disjoint sets of d nodes each maximizes the support function if and only if the selected subgraph is a biclique. Thus finding a motif pair with d wildcards and the best possible support value is equivalent to finding a biclique , a problem that is known to be W[1]-hard by solution size [19].
In fact, the authors of [1] show NP-hardness for an even larger class of support functions (which they call compliant biclique-maximal support functions). We omit that discussion, because it is quite technical, and refer the interested reader to [1].
C Materials omitted from Section 5
C.1 Datasets
Real networks. We selected the datasets from the experimental evaluation of SLIDER [1] (S. cerevisiae II and H. sapiens II) and from the STRING database [24,26] (E. coli, S. cerevisiae I, D. melanogaster, A. thaliana, and H. sapiens I). The datasets from [1] represent physical protein–protein interactions obtained using affinity purification and mass spectrometry [3,7]. The datasets from the STRING database are obtained by aggregating different databases, so they include other types of interaction in addition to the physical ones [26]. For this reason, the edges are weighted with a confidence score ranging from 15% to 99.9%. Following their general guideline, we chose a conservative threshold and kept only the edges with a high confidence score, namely
70% or above (STRING's high confidence threshold). Table C.1 shows the input parameters for the selected datasets before edge filtering.
Table C.1: Top: Parameters of datasets from STRING database. Bottom: Parameters of datasets from [1].
| Dataset | |V| | |E| | N |
|---|---|---|---|
| E. coli | 4140 | 492,380 | 1,312,010 |
| S. cerevisiae I | 6538 | 1,412,421 | 2,906,015 |
| D. melanogaster | 13,577 | 2,516,980 | 7,423,206 |
| A. thaliana | 25,739 | 6,278,747 | 10,843,854 |
| H. sapiens I | 19,622 | 6,857,702 | 11,283,623 |
| S. cerevisiae II | 1620 | 9060 | 862,281 |
| H. sapiens II | 10,381 | 69,542 | 5,608,861 |
We selected the datasets from the STRING database because they are publicly available and are relatively big for modern standards in this application domain, making them well suited for our experiments.
For all datasets in Table C.1, we removed nodes containing sequences with non-amino-acid letters (it is customary to denote an unknown amino acid by the capital letter X) along with their incident edges and isolated nodes. The resulting datasets of this procedure are shown in Table 5.1, and these were the datasets used in our experiments. Note that all networks in Table C.1 and Table 5.1 are sparse.
Artificial networks. For RQ3, RQ4, and RQ5, we generated smaller artificial networks by sampling sequences from the H. sapiens I network, which contains the largest sequences on average. We then added edges uniformly at random until an edge-density threshold was satisfied and ensured that the constructed instances had no isolated nodes.
C.2 Results for RQ2. Table C.2 shows the coverage of by and across all datasets. We omitted the density plots for S. cerevisiae I and D. melanogaster in Figure 5.4 because was fully covered by for these datasets (which can be verified in Table C.2).
C.3 Results for RQ3. Table C.3 shows the running time and peak RAM usage per thread of our exact algorithm on the datasets of Table 5.1.
Table C.2: Coverage of by and for and threshold . Values for are omitted as they are (trivially) 100%.
| Dataset | Method | ||||||
|---|---|---|---|---|---|---|---|
| Reduced solution size | Full solution size | Coverage | Reduced solution size | Full solution size | Coverage | ||
| E. coli | Exact | 6200 | 10,000 | — | 8521 | 10,000 | — |
| M-SLIDER | 9916 | 10,000 | 75.01% | 2301 | 2302 | 45.33% | |
| SEQ-SLIDER | 694 | 10,000 | 85.61% | 9959 | 10,000 | 93.70% | |
| S. cerevisiae I | Exact | 231 | 10,000 | — | 10,000 | 10,000 | — |
| M-SLIDER | 9980 | 10,000 | 100.00% | 363 | 363 | 9.79% | |
| SEQ-SLIDER | 1337 | 10,000 | 100.00% | 10,000 | 10,000 | 77.20% | |
| D. melanogaster | Exact | 893 | 10,000 | — | 10,000 | 10,000 | — |
| M-SLIDER | 9890 | 10,000 | 85.55% | 149 | 149 | 3.19% | |
| SEQ-SLIDER | 1311 | 10,000 | 100.00% | 10,000 | 10,000 | 45.17% | |
| A. thaliana | Exact | 3460 | 10,000 | — | 10,000 | 10,000 | — |
| M-SLIDER | 10,000 | 10,000 | 4.65% | 168 | 168 | 5.76% | |
| SEQ-SLIDER | 2384 | 10,000 | 8.12% | 10,000 | 10,000 | 21.38% | |
| H. sapiens I | Exact | 1836 | 10,000 | — | 9992 | 10,000 | — |
| M-SLIDER | 9996 | 10,000 | 58.27% | 187 | 187 | 3.71% | |
| SEQ-SLIDER | 3057 | 10,000 | 52.34% | 10,000 | 10,000 | 11.67% | |
| S. cerevisiae II | Exact | 5989 | 10,000 | — | 9996 | 10,000 | — |
| M-SLIDER | 9909 | 10,000 | 28.63% | 9988 | 10,000 | 38.56% | |
| SEQ-SLIDER | 5792 | 10,000 | 78.56% | 9993 | 10,000 | 91.79% | |
| H. sapiens II | Exact | 6197 | 10,000 | — | 10,000 | 10,000 | — |
| M-SLIDER | 10,000 | 10,000 | 9.95% | 472 | 472 | 4.97% | |
| SEQ-SLIDER | 4558 | 10,000 | 17.50% | 10,000 | 10,000 | 28.97% | |
Table C.3: Wall-clock time and peak RAM usage per thread for parameter pairs and run on threads.
| Dataset | |||||||
|---|---|---|---|---|---|---|---|
| Total time | Peak RAM per thread | Total time | Peak RAM per thread | ||||
| E. coli | 4006 | 32,244 | 1,277,734 | 01h:01m:40s | 183.8MB | 00h:05m:42s | 177.3MB |
| S. cerevisiae I | 5791 | 104,188 | 2,744,228 | 10h:28m:04s | 391.2MB | 00h:29m:11s | 381.3MB |
| D. melanogaster | 10,522 | 118,698 | 6,043,033 | 09h:03m:58s | 782.0MB | 00h:44m:58s | 766.7MB |
| A. thaliana | 20,239 | 331,525 | 8,903,236 | 35h:15m:09s | 1200.0MB | 01h:31m:07s | 1183.4MB |
| H. sapiens I | 16,201 | 236,930 | 9,605,435 | 49h:54m:31s | 1294.5MB | 01h:55m:56s | 1277.3MB |
| S. cerevisiae II | 1620 | 9060 | 862,281 | 00h:32m:17s | 125.7MB | 00h:03m:11s | 120.5MB |
| H. sapiens II | 10,380 | 69,515 | 5,607,838 | 11h:20m:41s | 761.6MB | 00h:27m:42s | 746.9MB |