- $X_{u,r}=1$ if there is an edge between $u\in \overline{I_{r-1}}\setminus \{v_{r-1}\}$ and a vertex in the right star.
- $X_{u,r}=0$ if there is no edge between $u\in \overline{I_{r-1}}\setminus \{v_{r-1}\}$ and a vertex in the right star.
Monday, December 13, 2021
Flooding requires $\Omega(n\log{k}/k)$ rounds in a $k$-smoothed adversarial dynamic graph
Saturday, December 11, 2021
Flooding in $O(n\sqrt{\log{n}/k})$ on a $k$-smoothed adaptive dynamic graph
We have previously shown an $O(n^{2/3}\log{n}/k^{1/3})$ upper bound for flooding on $k$-smoothed connected dynamic graphs. However, our adversary was constrained to select the dynamic graph sequence $G_1,G_2,...$ without knowing the outcomes of $k$-smoothing. In this post we present [MPS20]'s work which extends this analysis to an adaptive adversary, i.e. one who can construct $G_r$ based on the previous outcomes of $k$-smoothing on $G_1,...,G_{r-1}$.
The intuitive idea is similar to what we have seen before:
- In the first $r$ rounds of flooding we are guaranteed to have $r$ nodes learn the flooded message.
- We then show that it is likely for some node in a support sequence to receive the message in the next $r$ rounds.
- If a node in the support sequence has the flooded message, then it is likely that our target node $u$ will receive the message within the next $r$ rounds.
Thursday, December 9, 2021
$O(n^{2/3}\log{n}/k^{1/3})$ $k$-smoothed algorithm for flooding.
[Din+15] present an algorithm which runs in $O(n^{2/3}\log{n}/k^{1/3})$ rounds with high probability on a $k$-smoothed dynamic graph.
At the core of their argument is the concept of a support sequence, i.e. a temporally connected subgraph across some number of rounds. The motivation being that if any node in the support sequence receives the flooded message, then it is likely to later be propagated to the target node in the support sequence. In essence a support sequence is just a "fat" target the flooded message needs to hit for $u$ to get the message within some bounded number of rounds dependent on the size of the support sequence. We use this to show that each node receives the flooded message with high probability.
Def 1: Fix integers $t$ and $l$ s.t. $1\leq l < t$, a dynamic graph $\mathcal{G}=(V, \mathcal{E})$, and a target node $u\in V$. A $(t,l)$-support sequence for $u$ in $\mathcal{G}$ is a sequence $S_0,S_1,...,S_l$ such that
- $S_0=\{u\}$,
- for every $i\in [0,l]$ we have $S_i \subseteq V$,
- for every $i\in [1,l]$ we have $S_{i-1}\subset S_i$ and $S_i\setminus S_{i-1}=\{v\}$ for some $v\in V$ such that $v$ is adjacent to at least one node of $S_{i-1}$ in $G_{t-i}$.
Tuesday, December 7, 2021
Self-reducibility
When studying the complexity of problems, we often focus on decision problems. For example, NP-complete problems must be decision problems since they must be in NP. What about problems which aren't answered by a simple yes or no? What about finding the minimum vertex cover, or finding an actual $3$-coloring?
Well it turns out that most of the time, if we have an oracle TM with access to the decider for $X$, we can solve the search/optimisation version of $X$. This means that the search version of $X$ cook reduces to the decision version of $X$.
We take the search problem of finding a $3$-coloring of a graph $G=(V,E)$ as an example. Suppose we have access to an oracle which decides if its input graph has a valid $3$-coloring. We want to use this oracle to actually construct a $3$-coloring on $G$ in polynomial time.
First, we should check if $G$ has a valid $3$-coloring to begin with. If it does not then we halt. Otherwise, we can start building the $3$-coloring.
Let's impose an ordering on the vertices, $v_1<v_2<...<v_n$. We will color these vertices one by one starting from $v_1$. Suppose we have colored all vertices $v_1,...,v_{i-1}$ in a way that can be extended to the entire graph $G$. Let $C_i$ be the set of valid colors for $v_i$, for each $c\in C_i$ we assign $c$ to $v_i$. Now we need a way to test if our new coloring can be extended to the entire graph $G$.
Since our oracle takes as input a graph and that is all, we can't just call the oracle on our graph since it will just ignore the colors we have assigned to it. We need a way to encode the choices of colors into a new graph $G'$ which is $3$-colorable iff the partial coloring can be extended to the entire graph $G$.
We propose the following construction for $G'$: merge all vertices with the same color into one super-vertex whose neighborhood is the union of the neighborhoods of all the vertices being merged. Uncolored vertices are left as in $G$.
Claim: The partial coloring over $v_1,...,v_i$ is extendable to the entire graph $G$ iff $G'$ is $3$-colorable.
proof. Suppose $v_1,...,v_i$ is extendable to the entire graph $G$. Then uncolored vertices in $G$ have a valid assignment of colors. If we construct $G'$, then all uncolored vertices are still adjacent to the same set of colors, so the coloring is still valid, hence $G'$ is $3$-colorable. Suppose $G'$ is $3$-colorable. Then if we undo our construction, we can still color the uncolored vertices since they will be adjacent to the same colors as in $G'$.
Thus we can simply construct $G'$ and call the oracle on it. If the oracle returns yes, then we fix $c$ as the color assigned to $v_i$. Otherwise we move to the next valid color in $C_i$ and do the same. Note that for some color in $c\in C_i$, the assignment of $c$ to $v_i$ must be a valid assignment for a $3$-coloring over the entire graph $G$, since we know that the coloring over $v_1,...,v_{i-1}$ is extendable to the entire graph $G$ and we know that $G$ is $3$-colorable to begin with.
This informal walkthrough demonstrates an example of self-reducibility. In this case we call the oracle $O(n)$ times and the construction of $G'$ can be done in polynomial time. Pretty neat!
Sunday, December 5, 2021
A huge sum
Problem E in the latest atCoder beginner round was quite interesting. The problem statement is quite simple, we are asked to compute
$$\sum_{i=1}^{N}{\lfloor \frac{N}{i} \rfloor}$$
for $1\leq N \leq 10^{12}$.
This problem would be easy if $N$ wasn't so huge. But since it is, we need a faster way to compute the sum than just doing it directly.
The first thing to notice is that all $\lfloor \frac{N}{2}\rfloor < i \leq N$ have $\lfloor \frac{N}{i}\rfloor =1$. More generally, $\lfloor \frac{N}{k+1}\rfloor < i \leq \lfloor \frac{N}{k}\rfloor$ have $\lfloor\frac{N}{i}\rfloor = k$. So our strategy becomes to group equal values together.
If we do this for say $X$ groups we will have
$$N-((N-\lfloor \frac{N}{2}\rfloor)+(\lfloor \frac{N}{2}\rfloor - \lfloor \frac{N}{3}\rfloor) + ... + (\lfloor \frac{N}{X}\rfloor - \lfloor \frac{N}{X+1}\rfloor))=\lfloor \frac{N}{X+1}\rfloor$$
values of $i$ for which we have still not computed the value of $\lfloor \frac{N}{i}\rfloor$ for. If we choose $X=\lfloor\sqrt{N}\rfloor$, then we have $O(\sqrt{N})$ groups and $\lfloor \frac{N}{\sqrt{N}+1}\rfloor = O(\sqrt{N})$ indices $i$ for which we can directly compute their contribution.
Thus we compute the sum using the following.
$$\sum_{k=1}^{\lfloor\sqrt{N}\rfloor}{k\cdot\left(\lfloor \frac{N}{k}\rfloor - \lfloor \frac{N}{k+1}\rfloor\right)} + \sum_{i=1}^{\lfloor \frac{N}{\sqrt{N}+1}\rfloor}{\lfloor \frac{N}{i}\rfloor}$$
This is done in $O(\sqrt{N})$ which is fast enough for the given constraints.
AtCoder shananigans
Here is the problem , and below is the raw transcript of my thoughts. Obs: It is always optimal to use all $K$ moves. intuitive proof. While...
-
We are given $N$ cities on an integer number line at positions $0<x_1<x_2<...<x_N$, where our capital is initially at position 0...
-
When studying the complexity of problems, we often focus on decision problems. For example, NP-complete problems must be decision problems s...
-
The problem is essentially, given $2\leq n\leq 10^5$ people, where the $i^{\text{th}}$ person has a skill level of $b_i$ in billiards and $p...