Submodular Maximization over Sliding Windows

Submodular Maximization over Sliding Windows

Jiecao Chen
Indiana University Bloomington
   Huy L. Nguyen
Northeastern University,
   Qin Zhang
Indiana University Bloomington

In this paper we study the extraction of representative elements in the data stream model in the form of submodular maximization. Different from the previous work on streaming submodular maximization, we are interested only in the recent data, and study the maximization problem over sliding windows. We provide a general reduction from the sliding window model to the standard streaming model, and thus our approach works for general constraints as long as there is a corresponding streaming algorithm in the standard streaming model. As a consequence, we obtain the first algorithms in the sliding window model for maximizing a monotone/non-monotone submodular function under cardinality and matroid constraints. We also propose several heuristics and show their efficiency in real-world datasets.

1 Introduction

The last few decades have witnessed an explosion in the amount of data involved in machine learning tasks. In many cases, the data volume exceeds our storage capacity and demands new techniques that can effectively learn while operating within stringent storage and computation limits. Streaming algorithms [15] have emerged as a powerful approach to cope with massive data volume. In this model, the learning algorithm processes the dataset one element at a time by a linear scan and keeps only a small summary of the dataset in the memory; it is then able to compute the objective function on the processed elements using the summary. Various popular techniques in machine learning operate in this model, such as stochastic gradient descent, perceptron, etc. This model is particularly useful when the dataset is too large to fit in the memory or if the data is generated in real time (e.g., in online learning).

A common issue in online learning/streaming data mining is that the underlying distribution that generates the data may change over time. Therefore we had better consider only the most recently data in the stream. Streaming algorithms over sliding windows have already been designed for several problems, including -median clustering [3], kernel least square regression [21], -means and coreset construction [6], etc.

The window size can again be very large and does not fit the main memory. The problem becomes more severe in the case when kernel method is applied to deal with the nonlinear system – the resulting kernel matrix may need memory where is the window size. A natural idea to resolve this issue is to select representative data items from the window for computing the objective function.

Submodular functions, an abstract and broad class of functions, have recently become an attractive candidate for modeling a variety of scenarios in machine learning, from exemplar-based clustering [12], summarization [20] to determinantal point processes [11]. In recent years there have been quite some work on designing streaming algorithm for optimizing submodular functions [12, 13, 4, 8, 9]. However, we are not aware of any previous work dealing with streaming data over sliding windows in the context of submodular optimization.

In this work, we present a general reduction from the sliding window model to the standard streaming model. As a consequence, we immediately obtain algorithms in the sliding window model by combining with previous works in the standard streaming model for cardinality constraints [12, 13, 4], matroid and matching constraints [8], and non-monotone functions [9]. We also propose a few heuristics and compare their performance on real-world datasets.

2 Preliminaries

Let be the finite ground set (possibly multiset). Let be a function mapping subsets of to numbers. We say is submodular if for any , and . We define as the marginal gain of given . If further we have for any , we say is monotone.

In the general form of constrained submodular maximization problem, we consider solving


where is a collection of subsets of which we call the constraint. In particular, when , Expression (1) is known as the cardinality constrained submodular maximization problem. Definitions for other constraints can be found in e.g. [5]. We say constraint hereditary if implies that any subset of is also in .

For a constrained submodular maximization problem, we use to represent the solution of (1). W.l.o.g. we assume for a parameter .

In the streaming model, we consider the ground set as an ordered sequence of items , each consumes one word of space. Each index is called a time step. In the sliding window model, we specify the window size . At any time step, we are only interested in the most recent items which defines the ground set at that moment. Note that when , becomes the set of all received items; we thus also call the standard streaming model the infinite window model. For two streams/sequences and , let be their concatenation, which is followed by .

Let be an algorithm solving the constrained submodular maximization problem. We use to represent the function value of the solution returned by operating on the ground set .

3 Algorithms

3.1 A Reduction to the Infinite Window Case

In this section we design sliding window algorithms by a generic reduction to standard infinite window streaming algorithms. Our reduction can work with any standard streaming algorithms that satisfy some natural properties. Throughout this section, we assume that the constraint in the submodular maximization problem is hereditary (see the preliminaries for definition).

Definition 1

Let be an algorithm operating on a stream of elements, and be the value of the solution found by on the stream . We say is -compliant if it satisfies the following conditions:

  • (Monotonicity) If is a prefix of then .

  • (-Approximation) For any stream , let be the optimal solution. Then .

The following lemma is similar to the smooth histogram technique introduced in [7]. However, smooth histogram only works for problems with good approximations. More precisely, it is assumed that there is an algorithm with approximation where , which does not hold for many submodular problems. Our algorithm (Algorithm LABEL:alg:reduction) also works for streaming algorithms without the monotonicity property, though monotonicity allows us to get a better approximation. Any streaming algorithm can be modified to satisfy the monotonicity property at the cost of increased update time: after every update, the algorithm calculates a solution and it keeps track of the best solution over time.

Lemma 1

Let stream be the concatenation of three (sub)streams . Given a -compliant algorithm , if , then where is the optimal solution for the stream .


Let be the optimal solution for the streams , respectively. We have


We also have


Combining (2) and (3), we obtain

We can also show a similar lemma for algorithms satisfying the -approximation property but not monotonicity.

Lemma 2

Let stream be the concatenation of three (sub)streams . Given an algorithm with -approximation property, if , then where is the optimal solution for the stream .

The proof is similar to that of Lemma 2. The major modification is to use the following inequality, which does not require the monotonicity property, as a replacement of (3),

We have the following theorem.

Theorem 1

There is an algorithm for constrained submodular maximization over sliding windows that achieves a -approximation using space and update time per item, provided that there is a corresponding -compliant streaming algorithm using space and update time per item.


algocf[t]     \end@float

The pseudocode of the algorithm is described in Algorithm LABEL:alg:reduction. We now explain it in words. The algorithm maintains a collection of instances of starting at different times , which we will denote by . Upon receiving a new element , we perform the following operations. We first create a new instance . Next, we drop those instances of that are expired, and update all the remaining instances with the new element . Finally we perform a pruning procedure: We start with . Let be the maximum time step among all the maintained instances of such that . We prune all the instances where (Line LABEL:ln:a-1-LABEL:ln:a-2). We repeat this pruning procedure with (the next unpruned time step) and continue until we reach . Note that the purpose of the pruning step is to make the remaining data stream satisfy , so that Lemma 1 or Lemma 2 applies.

The space usage of the algorithm is again easy to bound. Note that after the pruning (we rename the remaining instances as ), for each , we have . Thus the number of instances of is bounded by at all time steps. When doing the pruning, we only need to calculate the value of each instance once, so the processing time per item is .

We next give the proof of the correctness. Let us consider a window , and let . For this window we will report whatever reports. It is easy to see that if , then the algorithm is obviously correct since is a streaming algorithm starting from time . We next consider the case when . Let be the time step when the last in was pruned, and let be the largest time step before such that is active after the pruning step at time . Note that must exist because pruning always happens between two active instances (at Line 9 of the algorithm, we prune between and exclusively). It is clear that . Let , , and . By the pruning rule, we have . Plugging in Lemma 1, we have


where is the optimal solution for the stream , which includes the window .

In [4] the authors gave a -compliant algorithm in the standard streaming model for monotone submodular maximization subject to cardinality constraint , using space and update time per item. We thus have the following corollary.

Corollary 1

There is an algorithm for monotone submodular maximization with a cardinality constraint over sliding windows that achieves a -approximation using words of space and update time per item, where is the cardinality constraint.

If we drop the requirement of monotonicity, we have the following result. The proof is the same as that for Theorem 1, but uses Lemma 2 instead of Lemma 1 in (4).

Theorem 2

There is an algorithm for constrained submodular maximization over sliding windows that achieves a -approximation using space and update time per item, provided that there is a corresponding -approximation streaming algorithm that uses space and update time per item.

In [8], the authors gave a -approximation algorithm in the standard streaming model for monotone submodular maximization subject to -matroid constraints using space, where is the maximum rank of the -matroids. We thus have:

Corollary 2

There is an algorithm for monotone submodular maximization subject to -matroid constraints over sliding windows that achieves a -approximation using words of space, where is the maximum rank of the -matroids.

A similar result can be obtained by plugging the deterministic approximation algorithm in [9].

3.2 Heuristic Algorithms

In this section, we introduce two heuristic algorithms based on SieveStream proposed by [4]. SieveStream achieves a -approximation for cardinality constrained monotone submodular maximization in the standard streaming model.

We briefly review how SieveStream works. To simplify the description, we assume an upper bound of (denote as ) is given. [4] also shows how one can get rid of this assumption by estimating on the fly. The algorithm works as follows: we guess in parallel the thresholds where . For each fixed we maintain a buffer as the solution over the data stream. Upon receiving a new item , we add it to the buffer if the cardinality constraint has not yet been violated (i.e. ) and the marginal gain . [4] shows that as long as , the corresponding satisfies . So we simply return the best among all buffers.

The first heuristic algorithm SieveNaive is very simple. For each threshold and its associated in SieveStream, upon receiving a new item , we first drop the expired item (if any). All other steps are exactly the same as SieveStream.

The second heuristic SieveGreedy is a hybrid of SieveStream and the standard greedy algorithm Greedy [16]. Let be a parameter and be the window size. We maintain as a buffer of samples over the sliding window. Upon receiving a new item , we add to with probability , and drop expired item (if any) from . On the other hand, we maintain an instance of SieveStream with the following modification: whenever an item in a buffer (associated with a certain ) expired, we update by using Greedy to choose a solution of size from .

The pseudocodes of the two heuristics are presented in Algorithm LABEL:alg:snaive and Algorithm LABEL:alg:sgreedy respectively.


algocf[t]     \end@float


algocf[t]     \end@float

4 Applications

The class of submodular functions contains a broad range of useful functions. Here we discuss two examples that have been used extensively in operations research, machine learning, and data mining. The performance of our algorithms in these settings is discussed in the experiments section.

4.1 Maximum Coverage

Let be a collection of subsets of . In the Maximum Coverage problem, we want to find at most sets from such that the cardinality of their union can be maximized. More precisely, we define the utility function as , where is a subset of . It is straightforward to verify that the utility function defined is monotone submodular. The Maximum Coverage problem is a classical optimization problem and it is NP-Hard. We can formulate it using our notations as

4.2 Active Set Selection in Kernel Machines

Kernel machines [19] are powerful non-parametric learning techniques. They use kernels to reduce non-linear problems to linear tasks that have been well studied. The data set is represented in a transformed space via the kernel matrix whose -th cell is where is the kernel function which is symmetric and positive definite.

For large-scale problems, even representing the matrix , which requires space, is prohibited. The common practice is to select a small representative subset and only work with . One popular way to measure the quality of selected set is to use Informative Vector Machine (IVM) introduced by Laurence et al. [14]. Formally, we define with , where is the identity matrix and is a parameter. IVM has a close connection to the entropy of muti-variable Gaussian distribution [5]. It has been shown that is a monotone submodular function (see, e.g., [5]). We can then select the set by solving .

5 Experiments

In this section, we compare the following algorithms experimentally. We use the objective functions introduced in the previous section, and the dataset is fed as a data stream. We try to continuously maximize the objective functions on the most recent data points.

  • Greedy: the standard greedy algorithm (c.f. [16]); does not apply to sliding windows.

  • SieveStream: the Sieve Streaming algorithm in [4]; does not apply to sliding windows.

  • SieveNaive: Algorithm LABEL:alg:snaive in this paper.

  • SieveGreedy: Algorithm LABEL:alg:sgreedy in this paper.

  • Random: random sampling over sliding windows [2] (i.e. maintain a random samples of elements in the sliding window at any time).

  • SW-RD: Algorithm LABEL:alg:reduction in this paper, using SieveStream as the -compliant algorithm.

Note that neither Greedy nor SieveStream can be used for submodular maximization over sliding windows. We thus have to run them in each selected window individually. If we want to continuously (i.e. for all sliding windows) report the solutions, then we need to initialize one instance of SieveStream or Greedy for each window, which is space and time prohibitive.

We run Greedy as it provides a benchmark of the qualities of solutions. We run SieveStream in selected windows since SW-RD uses it as a subroutine and we want to see how good the solutions of SW-RD is compared with the original SieveStream in practice.

We have implemented all algorithms in C++ with the support of the C++ linear algebra library Armadillo [18]. All experiments are conducted on a laptop equipped with an Intel Core i5 1.7GHz x 2 processor and 4GB RAM. The operating system is Linux Mint 17.2.


We use three time-series datasets.

  • Eyes[17]: this dataset is from one continuous EEG measurement with the Emotiv EEG Neuroheadset. The duration of the measurement is 117 seconds. The dataset contains instances, each of which can be considered as a vector of dimension .

  • GasSensor[10]: this dataset contains the acquired time series from 16 chemical sensors exposed to gas mixtures at varying concentration levels. Together with other features, each record can be considered as a vector of dimension . There are records in total. We normalize the dataset first by column, and then by row.

  • WorldCup[1]: this dataset contains all the requests made to the 1998 World Cup Web site on June 7, 1998. There are requests made on that day and we consider the requested resource URLs in each second as a set. This results in sets.

Figure 1: Eyes dataset for active set selection; in the left figure, in the right; ; in SieveGreedy; -axis specifies the windows; -axis is the utility

Figure 2: GasSensor dataset for active set selection; in the left figure, in the right; ; in SieveGreedy
Figure 3: WorldCup dataset for maximum coverage; ; in SieveGreedy except ((c)c)
Figure 4: Eyes dataset for active set selection; # function calls normalized by SieveStream
Figure 5: Eyes dataset for active set selection; space usages measured by the peak number of items kept in the buffer; (b), (c), and (d) are normalized by the space usages of SieveStream

Discussion on the Results

For the application of active set selection, we run experiments on both Eyes and GasSensor datasets. We choose the squared exponential kernel as the kernel function: ; we set and . For the application of maximum coverage problem, we run experiments on the WorldCup dataset. For all algorithms, we set .

It can be observed from Figure 1, Figure 2 and Figure 3 that the maximum utility given by the standard greedy changes when we slide the window over the data stream. In Figure 1, SieveStream, SW-RD, SieveGreedy and SieveNaive generate results of almost the same quality as the one given by Greedy, and Random gives the worst results in all selected windows. In both Figure 2 and Figure 3, results generated by SW-RD, SieveNaive, SieveGreedy and SieveStream are slightly worse than the one given by Greedy. In most windows, SieveGreedy is as good as SieveStream. SieveNaive also performs well in most windows, but it is worse than Random in some windows. In theory, SW-RD can be worse than SieveStream by a factor of , but our experiments show that solutions returned by the two algorithms have similar utilities. Figure (c)c shows in SieveGreedy, increasing will slightly increase the utility.

For the comparisons of space/time costs, we only include the results of Eyes dataset due to the space constraints. Similar results can observed on other datasets as well. Figure 4 compares the time costs on Eyes dataset. We measure the time costs by the numbers of function calls (of the submodular function). All results are normalized by the corresponding costs of SieveStream. By Theorem 1 the time cost of SW-RD is independent of and once it is normalized by the corresponding cost of SieveStream. This result has been confirmed by Figure (a)a. Figure (b)b shows that SieveNaive is as fast as SieveStream. Figure (c)c shows that increasing will increase the cost of SieveGreedy, while increasing will decrease the cost. This is because items in the solution buffers are less likely to expire for small and large . Figure (d)d shows how the time costs of SieveGreedy are affected by the values of .

Figure 5 compares the space costs on Eyes dataset. To be consistent with the theorems, we measure the space usages by the maximum numbers of items kept in memory. To compare with the costs of SieveStream, we also normalize the costs of SW-RD, SieveNaive and SieveGreedy by the corresponding costs of SieveStream. Figure (c)c and Figure (d)d show that the space usages of SieveNaive and SieveGreedy are almost the same as SieveStream.


We conclude from our experiments that (1) the distribution of data stream changes over sliding windows in our tested datasets; (2) in terms of solution quality, SW-RD, SieveNaive and SieveGreedy generate comparable results as SieveStream, and Random is clearly the worst. SieveNaive can sometimes perform very badly, while SW-RD (the only algorithm with theoretical guarantees) and SieveGreedy are relatively stable; and (3) SieveNaive is the most time and space efficient algorithm among SW-RD, SieveNaive and SieveGreedy, and the performance of SieveGreedy is close for large window size and small . For large window size and small , SieveGreedy runs very fast and the only extra space it uses compared with SieveStream is the buffer of samples (i.e. ). Depending on the value of , SW-RD typically uses -x processing time and -x space compared to SieveStream.


  • [1] M. Arlitt and T. Jin. 1998 world cup web site access logs., 1998.
  • [2] B. Babcock, M. Datar, and R. Motwani. Sampling from a moving window over streaming data. In SODA, pages 633–634. Society for Industrial and Applied Mathematics, 2002.
  • [3] B. Babcock, M. Datar, R. Motwani, and L. O’Callaghan. Maintaining variance and k-medians over data stream windows. In PODS, pages 234–243. ACM, 2003.
  • [4] A. Badanidiyuru, B. Mirzasoleiman, A. Karbasi, and A. Krause. Streaming submodular maximization: Massive data summarization on the fly. In SIGKDD, pages 671–680. ACM, 2014.
  • [5] J. Bilmes. Lecture notes on submodular optimization., 2014.
  • [6] V. Braverman, H. Lang, K. Levin, and M. Monemizadeh. A unified approach for clustering problems on sliding windows. arXiv preprint arXiv:1504.05553, 2015.
  • [7] V. Braverman and R. Ostrovsky. Smooth histograms for sliding windows. In FOCS, pages 283–293, 2007.
  • [8] A. Chakrabarti and S. Kale. Submodular maximization meets streaming: matchings, matroids, and more. Math. Program., 154(1-2):225–247, 2015.
  • [9] C. Chekuri, S. Gupta, and K. Quanrud. Streaming algorithms for submodular function maximization. In ICALP, pages 318–330, 2015.
  • [10] J. Fonollosa, S. Sheik, R. Huerta, and S. Marco. Reservoir computing compensates slow response of chemosensor arrays exposed to fast varying gas concentrations in continuous monitoring. Sensors and Actuators B: Chemical, 215:618–629, 2015.
  • [11] J. Gillenwater, A. Kulesza, and B. Taskar. Near-optimal map inference for determinantal point processes. In NIPS, pages 2735–2743, 2012.
  • [12] A. Krause and R. G. Gomes. Budgeted nonparametric learning from data streams. In ICML, pages 391–398, 2010.
  • [13] R. Kumar, B. Moseley, S. Vassilvitskii, and A. Vattani. Fast greedy algorithms in mapreduce and streaming. ACM Transactions on Parallel Computing, 2(3):14, 2015.
  • [14] N. Lawrence, M. Seeger, and R. Herbrich. Fast sparse gaussian process methods: The informative vector machine. In NIPS, number EPFL-CONF-161319, pages 609–616, 2003.
  • [15] S. Muthukrishnan. Data streams: Algorithms and applications. Now Publishers Inc, 2005.
  • [16] G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions—i. Mathematical Programming, 14(1):265–294, 1978.
  • [17] O. Roesler. Eeg eye state data set., 2013.
  • [18] C. Sanderson. Armadillo: An open source c++ linear algebra library for fast prototyping and computationally intensive experiments. 2010.
  • [19] B. Schölkopf and A. J. Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2002.
  • [20] R. Sipos, A. Swaminathan, P. Shivaswamy, and T. Joachims. Temporal corpus summarization using submodular word coverage. In CIKM, CIKM ’12, pages 754–763, 2012.
  • [21] S. Van Vaerenbergh, J. Via, and I. Santamaría. A sliding-window kernel rls algorithm and its application to nonlinear channel identification. In ICASSP, volume 5, pages 789–792. IEEE, 2006.
Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
Add comment
Loading ...
This is a comment super asjknd jkasnjk adsnkj
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test description