<p>Roughly $O(k \log(n/k))$ queries suffice, in the regime you are talking about.</p>

<p>We can equivalently think of this as finding a minimal vertex cover for $G$, given ability to query whether a particular set is a vertex cover or not.  The  algorithm is as follows:</p>

<ol>
<li>Let $S := V$ (the set of all vertices).</li>
<li><p>While $S$ is not a minimal vertex cover:</p>

<ul>
<li>Pick a random subset $T \subseteq S$ of size $|T| = \lceil |S|/k \rceil$.</li>
<li>If $S \setminus T$ is a vertex cover, let $S := S \setminus T$.</li>
</ul></li>
</ol>

<p>Note that the final vertex cover will have size $\le k$.</p>

<p>How many iterations does this take to converge?  Well, for $S \setminus T$ to be a vertex cover, $T$ must avoid all of the vertices in the final minimal vertex cover, so the probability that a $S \setminus T$ is a vertex cover is at least</p>

<p>$$\left(1 - {k \over |S|}\right)^{|T|} \approx \left(1 - {k \over |S|}\right)^{|S|/k} \approx 1/e.$$</p>

<p>In other words, there is a constant probability in each iteration that $S \setminus T$ is a vertex cover.  Thus, the total number of iterations is proportional to the number of times that we succeed in reducing the size of $S$.</p>

<p>Each time that we successfully reduce the size of $S$, we multiply its size by a factor of $1 - 1/k$.  We start with $n$ vertices, and end with about $k$ vertices, so the number of reductions $r$ satisfies</p>

<p>$$n \times \left(1 - {1 \over k}\right)^r = k,$$</p>

<p>or in other words,</p>

<p>$$r = {\log(k/n) \over \log(1 - 1/k)} \approx k \log(k/n).$$</p>

<p>Thus, we do a total of $O(k \log(k/n))$ iterations, i.e., a total of $O(k \log(k/n))$ queries.  When the algorithm terminates, we have found a minimal vertex cover.</p>

<p>What is the cost of testing the termination condition?  The algorithm terminates when we have already tried all possible subsets $T$ of $S$ and none of them can be removed from $S$ ($S \setminus T$ was not a vertex cover for any subset $T$ of size $\lceil |S|/k \rceil$).  Note that we'll end with a vertex cover of size $\le k$, so in the last iterations, $|T|=1$, so it'll only take $O(k \log k)$ iterations before we've tried all possibilities for $T$.  At that point the procedure terminates.  So, this doesn't increase the total asymptotic running time.</p>

<p>You can think of this algorithm as a simple variant of <a href="https://en.wikipedia.org/wiki/Delta_Debugging" rel="nofollow noreferrer">delta debugging</a>.</p>

CC BY-SA 3.0
2017-07-16T11:23:29.220Z
Thanks for the answer, but I must be missing something. Consider a graph with many vertices and only $k=2$ edges (say, $a,b$ are connected to a shared vertex $c$). Now if the randomly chosen subset $T$ contains $c$ but not $a,b$, then you'll end up with a vertex cover of $\{a,b\}$, right? so your method won't succeed in finding the VC $\{c\}$. Your solution might find a VC of size $\le k$, but I don't see a reason for it to find the minimal $VC$, which is what I'm after.
R B
CC BY-SA 3.0
2017-07-16T17:14:50.107Z
@RB, Are you looking for a [maximum independent set](https://en.wikipedia.org/wiki/Independent_set_(graph_theory)) or a [maximal independent set](https://en.wikipedia.org/wiki/Maximal_independent_set)?  The problem says the latter, but your comment makes it sound like you actually want the former.  If so, I suggest you edit the question to ask about maximum independent set rather than maximal independent set.
D.W.
CC BY-SA 3.0
2017-07-12T23:34:09.257Z
2017-07-12T23:34:09.257Z
D.W.
<p>Maximal independent set is known to be hard in many meanings (hard to approximate, <span class="math-container">$W[1]$</span>-hard, etc.). But if the number of edges is very small, then the problem becomes simpler. Here, I'm interested in learning an independent set from an unknown graph.</p>
<p>Assume that we have an unknown sparse graph <span class="math-container">$G=(V,E)$</span> with at most <span class="math-container">$k\ll |V|$</span> edges (<span class="math-container">$k$</span> is given).</p>
<p>We want to find a maximal independent set for the graph using as few queries as possible, where Query<span class="math-container">$(S)$</span>, for some <span class="math-container">$S\subseteq V$</span> returns 1 if <span class="math-container">$S$</span> is an independent set and <span class="math-container">$0$</span> otherwise.</p>
<p>For example, if <span class="math-container">$k=1$</span>, we can find an independent set of size <span class="math-container">$n-1$</span> using <span class="math-container">$\Theta(\log n)$</span> queries.</p>
<blockquote>
<p>What is the query complexity for general <span class="math-container">$k$</span>?</p>
<p>If I want to learn the exact graph (rather than just a maximal independent set), is the query complexity similar?</p>
</blockquote>
<p>For <span class="math-container">$k=1$</span> we can also find the edge using <span class="math-container">$\Theta(\log n)$</span> queries.</p>
<p>The run time of the algorithm here can be arbitrary, all I care about is the query complexity.</p>

<ds.algorithms><graph-algorithms><lg.learning><query-complexity>
What is known about learning a maximal independent set in a (very) sparse graph?
R B
# What is known about learning a maximal independent set in a (very) sparse graph?

(Asked by: username_0 on 2017-07-12)

Maximal independent set is known to be hard in many meanings (hard to approximate, $W[1]$-hard, etc.). But if the number of edges is very small, then the problem becomes simpler. Here, I'm interested in learning an independent set from an unknown graph.

Assume that we have an unknown sparse graph $G=(V,E)$ with at most $k\ll |V|$ edges ($k$ is given).

We want to find a maximal independent set for the graph using as few queries as possible, where Query$(S)$, for some $S\subseteq V$ returns 1 if $S$ is an independent set and $0$ otherwise.

For example, if $k=1$, we can find an independent set of size $n-1$ using $\Theta(\log n)$ queries.

> What is the query complexity for general $k$?
>
> If I want to learn the exact graph (rather than just a maximal independent set), is the query complexity similar?

For $k=1$ we can also find the edge using $\Theta(\log n)$ queries.

The run time of the algorithm here can be arbitrary, all I care about is the query complexity.

**Tags:** ds.algorithms, graph-algorithms, lg.learning, query-complexity

---

## 1 answers

### Answer by username_1 on 2017-07-12. Score: 1

Roughly $O(k \log(n/k))$ queries suffice, in the regime you are talking about.

We can equivalently think of this as finding a minimal vertex cover for $G$, given ability to query whether a particular set is a vertex cover or not. The algorithm is as follows:

1. Let $S := V$ (the set of all vertices).
2. While $S$ is not a minimal vertex cover:

   * Pick a random subset $T \subseteq S$ of size $|T| = \lceil |S|/k \rceil$.
   * If $S \setminus T$ is a vertex cover, let $S := S \setminus T$.

Note that the final vertex cover will have size $\le k$.

How many iterations does this take to converge? Well, for $S \setminus T$ to be a vertex cover, $T$ must avoid all of the vertices in the final minimal vertex cover, so the probability that a $S \setminus T$ is a vertex cover is at least

$$\left(1 - {k \over |S|}\right)^{|T|} \approx \left(1 - {k \over |S|}\right)^{|S|/k} \approx 1/e.$$

In other words, there is a constant probability in each iteration that $S \setminus T$ is a vertex cover. Thus, the total number of iterations is proportional to the number of times that we succeed in reducing the size of $S$.

Each time that we successfully reduce the size of $S$, we multiply its size by a factor of $1 - 1/k$. We start with $n$ vertices, and end with about $k$ vertices, so the number of reductions $r$ satisfies

$$n \times \left(1 - {1 \over k}\right)^r = k,$$

or in other words,

$$r = {\log(k/n) \over \log(1 - 1/k)} \approx k \log(k/n).$$

Thus, we do a total of $O(k \log(k/n))$ iterations, i.e., a total of $O(k \log(k/n))$ queries. When the algorithm terminates, we have found a minimal vertex cover.

What is the cost of testing the termination condition? The algorithm terminates when we have already tried all possible subsets $T$ of $S$ and none of them can be removed from $S$ ($S \setminus T$ was not a vertex cover for any subset $T$ of size $\lceil |S|/k \rceil$). Note that we'll end with a vertex cover of size $\le k$, so in the last iterations, $|T|=1$, so it'll only take $O(k \log k)$ iterations before we've tried all possibilities for $T$. At that point the procedure terminates. So, this doesn't increase the total asymptotic running time.

You can think of this algorithm as a simple variant of [delta debugging](https://en.wikipedia.org/wiki/Delta_Debugging).

> **Comments:**
> **username_0**: Thanks for the answer, but I must be missing something. Consider a graph with many vertices and only $k=2$ edges (say, $a,b$ are connected to a shared vertex $c$). Now if the randomly chosen subset $T$ contains $c$ but not $a,b$, then you'll end up with a vertex cover of $\{a,b\}$, right? so your method won't succeed in finding the VC $\{c\}$. Your solution might find a VC of size $\le k$, but I don't see a reason for it to find the minimal $VC$, which is what I'm after.  
> **username_1**: @RB, Are you looking for a [maximum independent set](https://en.wikipedia.org/wiki/Independent_set_(graph_theory)) or a [maximal independent set](https://en.wikipedia.org/wiki/Maximal_independent_set)?  The problem says the latter, but your comment makes it sound like you actually want the former.  If so, I suggest you edit the question to ask about maximum independent set rather than maximal independent set.  

---

