Week 7

Problem 1

Complete the notebook Graphs as Data (live). Note, this will not be on the quiz.

Problem 2

In the prior exercise, we saw that spectral clustering can fails when the graph is too connected. For example, too large a bandwidth \(\varepsilon\), or too many neighbours \(m\). Let’s look at the extreme case. Fix distinct points \(\bfx_1,\ldots,\bfx_n\in\Rbb^d\) with \(n\) even. Their Gaussian similarity graph with bandwidth \(\varepsilon>0\) joins every pair \(i\neq j\) by an edge of weight \[ w_{ij}=\exp\Big(-\frac{\|\bfx_i-\bfx_j\|_2^2}{2\varepsilon}\Big), \] with no self-loops (\(w_{ii}=0\)). Let \(\bfL_\varepsilon\) be its Laplacian.

  1. Show that as \(\varepsilon\to\infty\), \(\bfL_\varepsilon\) converges entrywise to \(n\bfI-\mathbf{1}\mathbf{1}^\top\), the Laplacian of the complete graph \(K_n\) (every pair of vertices joined by an edge of weight \(1\)).
  2. Show that \(\mathbf{1}\) is an eigenvector of \(n\bfI-\mathbf{1}\mathbf{1}^\top\) with eigenvalue \(0\), and that every non-zero \(\bfv\perp\mathbf{1}\) is an eigenvector with eigenvalue \(n\). Conclude that \(\lambda_2=\cdots=\lambda_n=n\).
  3. Show that every \(S\) with \(|S|=n/2\) has \(\operatorname{cut}(S)=n^2/4\) in \(K_n\). Conclude why there is no notion of the “best” split.
NoteSolution sketch
  1. For \(i\neq j\), \(w_{ij}=\exp(-\|\bfx_i-\bfx_j\|_2^2/(2\varepsilon))\to e^0=1\), so \(\bfW\to\mathbf{1}\mathbf{1}^\top-\bfI\) and every degree tends to \(n-1\). Hence \(\bfL_\varepsilon=\bfD-\bfW\to(n-1)\bfI-(\mathbf{1}\mathbf{1}^\top-\bfI)=n\bfI-\mathbf{1}\mathbf{1}^\top\).
  2. \((n\bfI-\mathbf{1}\mathbf{1}^\top)\mathbf{1}=n\mathbf{1}-\mathbf{1}(\mathbf{1}^\top\mathbf{1})=n\mathbf{1}-n\mathbf{1}=\mathbf{0}\). If \(\bfv\perp\mathbf{1}\), then \(\mathbf{1}\mathbf{1}^\top\bfv=\mathbf{1}(\mathbf{1}^\top\bfv)=\mathbf{0}\), so \((n\bfI-\mathbf{1}\mathbf{1}^\top)\bfv=n\bfv\). The space \(\mathbf{1}^\perp\) has dimension \(n-1\), so the eigenvalues are \(0\) once and \(n\) with multiplicity \(n-1\).
  3. Each of the \(n/2\) vertices of \(S\) is joined to each of the \(n/2\) vertices outside it, so \(\operatorname{cut}(S)=n^2/4=\). Every unit vector orthogonal to \(\mathbf{1}\) is optimal, so the one a computer returns is arbitrary, and so is the split we round it to. This is correct for this graph; every pair of points is equally similar, and every balanced split is equally good. The graph cannot disambiguate the data, so a cluster can’t either.

Problem 3

Let \(G\) be a weighted graph on \(n\) vertices with symmetric weights \(w_{ij}\geq 0\), no self-loops (\(w_{ii}=0\)), and Laplacian \(\bfL=\bfD-\bfW\). Let \(\bfe_1,\ldots,\bfe_n\) be the standard basis vectors of \(\Rbb^n\).

  1. Compute the matrix \((\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top\) for \(i\neq j\): which entries are non-zero, and what are they?
  2. Show that \[ \bfL=\sum_{i<j}w_{ij}(\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top. \] What goes wrong if the sum is over all ordered pairs \(i\neq j\) instead?
  3. Use part 2 to recover the quadratic form \(\bff^\top\bfL\bff=\sum_{i<j}w_{ij}(f_i-f_j)^2\), and conclude that \(\bfL\) is positive semidefinite.
NoteSolution sketch
  1. \((\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top=\bfe_i\bfe_i^\top+\bfe_j\bfe_j^\top-\bfe_i\bfe_j^\top-\bfe_j\bfe_i^\top\), which has \(1\) at \((i,i)\) and \((j,j)\), \(-1\) at \((i,j)\) and \((j,i)\), and \(0\) elsewhere.
  2. Compare entries of the right-hand side with \(\bfL\). An off-diagonal entry \((k,\ell)\) appears only in the term for the pair \(\{k,\ell\}\), where it is \(-w_{k\ell}=L_{k\ell}\). A diagonal entry \((k,k)\) collects \(w_{k\ell}\) from every pair \(\{k,\ell\}\) containing \(k\), giving \(\sum_{\ell\neq k}w_{k\ell}=d_k=L_{kk}\), since \(w_{kk}=0\). Summing over ordered pairs counts each edge twice and gives \(2\bfL\).
  3. \(\bff^\top(\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top\bff=\big((\bfe_i-\bfe_j)^\top\bff\big)^2=(f_i-f_j)^2\), so by part 2, \(\bff^\top\bfL\bff=\sum_{i<j}w_{ij}(f_i-f_j)^2\). Each term is non-negative because \(w_{ij}\geq0\), so \(\bfL\succeq0\).

Problem 4

TipOn the quiz

You may use the previous problem, Problem 3, for this. If this appears on the quiz, you will be given the relevant portion, so you may use it there without proof.

Read the example How Connected Is a Graph? first; it gives the picture behind this problem.

Let \(G\) be a weighted graph with Laplacian \(\bfL\) and eigenvalues \(0=\lambda_1\leq\lambda_2\leq\cdots\leq\lambda_n\). Since \(\bfL\mathbf{1}=\mathbf{0}\), we may take \(\bfu_1=\mathbf{1}/\sqrt n\) in Rayleigh–Ritz, whether or not \(G\) is connected, so \[ \lambda_2=\min\big\{\bfz^\top\bfL\bfz:\ \|\bfz\|_2=1,\ \bfz\perp\mathbf{1}\big\}. \] Let \(G'\) be \(G\) with the weight of one pair \(\{i,j\}\) increased by \(w>0\) (if \(\{i,j\}\) was not an edge, this adds it), with Laplacian \(\bfL'\) and second eigenvalue \(\lambda_2'\).

  1. Show that \(\bfL'=\bfL+w(\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top\).
  2. Show that \(\lambda_2'\geq\lambda_2\): adding an edge never makes a graph less connected.
  3. Let \(\bfu_2\) be a unit eigenvector of \(\bfL\) for \(\lambda_2\) with \(\bfu_2\perp\mathbf{1}\). Show that \(\lambda_2'\leq\lambda_2+w\,(u_2(i)-u_2(j))^2\). Use this to explain the figure in Where an edge goes matters.
NoteSolution sketch
  1. The only entries of \(\bfL\) that involve \(w_{ij}\) are the degrees \(L_{ii},L_{jj}\), which each grow by \(w\), and \(L_{ij}=L_{ji}=-w_{ij}\), which each drop by \(w\). These are exactly the entries of \(w(\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top\), which has \(w\) at \((i,i)\) and \((j,j)\) and \(-w\) at \((i,j)\) and \((j,i)\). Alternatively, by Problem 3, \(G'\) has the same sum as \(G\) but with one more term, \(w(\bfe_i-\bfe_j)(\bfe_i-\bfe_j)^\top\). Equivalently, by the quadratic form, \(\bff^\top\bfL'\bff=\bff^\top\bfL\bff+w(f_i-f_j)^2\) for every \(\bff\).
  2. By part 1, \(\bfz^\top\bfL'\bfz=\bfz^\top\bfL\bfz+w(z_i-z_j)^2\geq\bfz^\top\bfL\bfz\) for every \(\bfz\). Take \(\bfz\) to be a minimizer for \(\bfL'\), a unit vector orthogonal to \(\mathbf{1}\) with \(\bfz^\top\bfL'\bfz=\lambda_2'\). Then \(\lambda_2'=\bfz^\top\bfL'\bfz\geq\bfz^\top\bfL\bfz\geq\lambda_2\), the last step because \(\bfz\) is a candidate in the minimum defining \(\lambda_2\).
  3. Now use \(\bfu_2\) as a candidate in the minimum defining \(\lambda_2'\): \[ \lambda_2'\leq\bfu_2^\top\bfL'\bfu_2=\bfu_2^\top\bfL\bfu_2+w(u_2(i)-u_2(j))^2=\lambda_2+w(u_2(i)-u_2(j))^2. \] The Fiedler vector is nearly constant on each community, so for an edge inside a community \(u_2(i)\approx u_2(j)\) and \(\lambda_2\) barely moves. Only edges between vertices where \(\bfu_2\) differs a lot, that is, across the bottleneck, can raise \(\lambda_2\) by much.