Undirected connectivity of a whole graph is in logarithmic space #
Goldreich's Theorem 5.6 [Gol07a] (Section 5.2.4, r2 PDF p. 54, printed
p. 170): deciding undirected connectivity (UCONN) is in L. Goldreich's UCONN asks whether a
given graph is connected (r2 PDF p. 53, printed p. 169), and a graph "is called connected if
there exists a path between each pair of vertices in it" [Gol07e] (Appendix G.1,
r6 PDF p. 138, printed p. 646). Here graphs are undirected graph instances
(Cslib.Complexity.UGraphInstance, a symmetric loopless adjacency matrix on Fin n, encoded by
Cslib.Complexity.encUGraph), and Cslib.Complexity.UCONN is the set of instances whose graph is
SimpleGraph.Preconnected: every two vertices are joined by a walk. As in Goldreich's
definition, the graph without vertices is connected. (Mathlib's SimpleGraph.Connected
additionally requires a vertex.)
The proof reduces UCONN to undirected s–t connectivity, which is in L by Reingold's
theorem (Cslib.Complexity.USTCON_mem_L). A graph G on n vertices is connected exactly when
every vertex v is reachable from the vertex 0. The instance
Cslib.Complexity.UCONN.chainInstance G puts these n queries in series: it takes n disjoint
copies of G, joins the vertex v of the copy v to the vertex 0 of the copy v + 1, a
source to the vertex 0 of the copy 0 and the vertex n - 1 of the copy n - 1 to a target.
Every joining edge is a bridge, so the source reaches the target exactly when the vertex 0
reaches v in the copy v for every v (Cslib.Complexity.UCONN.chainInstance_mem_iff); for
n = 0, the source and the target are joined directly. The instance is written in logarithmic
space by Cslib.Complexity.UGraphInstance.ustconWriter: an entry within a copy reads one entry of
the input matrix and every other entry is arithmetic in n and its row and column
(Cslib.Complexity.UCONN.computableInLogSpace_chainInstance). This is a logarithmic-space
many-one reduction (Cslib.Complexity.UCONN.logSpaceReducible_USTCON), so UCONN is in L
(Cslib.Complexity.UCONN_mem_L). Space is that of L: the work-tape cells visited; as for every
problem in L, the decider is only required to be correct on encodings of instances.
Goldreich proves Theorem 5.6 directly, by transforming the graph into a collection of expanders
while preserving its connected components. The library's proof of Reingold's theorem decides
s–t connectivity; the series composition above is the step from s–t connectivity to the
whole graph.
The vertices of the instance are numbered so that a counter program can decode them: the source
is 0, the target 1, and the vertex x of the copy v is
Cslib.Complexity.UCONN.copyVertex n v x = 2 + v n + x.
Main definitions #
Cslib.Complexity.UCONN: the connected undirected graphs.Cslib.Complexity.UCONN.chainInstance: the copies of the graph in series, as an instance of undirecteds–tconnectivity.
Main results #
Cslib.Complexity.UCONN.chainInstance_mem_iff: the source reaches the target exactly when the graph is connected.Cslib.Complexity.UCONN.logSpaceReducible_USTCON:UCONNreduces toUSTCONin logarithmic space.Cslib.Complexity.UCONN_mem_L: Goldreich's Theorem 5.6,UCONNis inL.
References #
The numbering of the copies #
The number of vertices: the n vertices of each of the n copies, a source and a target.
The vertex of the graph that a vertex numbered at least 2 stands for.
The edges between steps of the chain, from r to c: the source 0 is joined to the vertex
0 of the copy 0, or to the target 1 when there are no copies; the vertex v of the copy v
is joined to the target when v is the last copy, and otherwise to the vertex 0 of the copy
v + 1.
Instances For
The instance #
The edges of the copies in series, on natural numbers: within a copy, x and y are joined
when they are in G; between steps, the edges Link.
The copies of the graph in series, with the source 0 and the target 1, as an instance
of undirected s–t connectivity.
The vertex x of the copy v, as a vertex of the instance.
An edge {x, y} of the graph joins x and y in every copy.
Every copy of the graph embeds in the instance.
The source reaches the target exactly when the graph is connected.
The writer #
The copies in series are computed in logarithmic space from the encoded graph, by
UGraphInstance.ustconWriter.
Undirected connectivity reduces to undirected s–t connectivity in logarithmic space,
by the copies of the graph in series.
Goldreich's Theorem 5.6 [Gol07a]: deciding undirected connectivity is in
L. A graph is connected when every two of its vertices are joined by a path, so the graph
without vertices is connected. The proof reduces to undirected s–t connectivity, which is in
L by Reingold's theorem (USTCON_mem_L).