Undirected s–t connectivity #
An instance of undirected s–t connectivity (Cslib.Complexity.USTCONInstance) is a simple
graph on Fin n, given by its adjacency matrix, symmetric and with zero diagonal, together with
two vertices s and t; it belongs to Cslib.Complexity.USTCON when t is reachable from s
Arora and Barak, Section 21.4 Reingold, Section 4.
Instances are encoded (Cslib.Complexity.encUSTCON) as their directed graphs
(Cslib.Complexity.USTCONInstance.toSTCONInstance, encoded by Cslib.Complexity.encSTCON): the
unary header 1^n 0 1^s 0 1^t 0 followed by the adjacency matrix, row by row, so that the bit at
n + s + t + 3 + a * n + b is the entry of the row a and the column b. The matrix has n ^ 2
bits, so the header is no longer than the matrix plus three bits and every number a machine reads
from it has logarithmically many binary digits; this is the adjacency matrix representation of
Reingold's algorithm, with a header that a machine reading its input by address can parse by
counting.
Main definitions #
Cslib.Complexity.USTCONInstance: instances of undirecteds–tconnectivity.Cslib.Complexity.USTCONInstance.graph: the simple graph of an instance.Cslib.Complexity.USTCONInstance.toSTCONInstance: the directed graph of an instance.Cslib.Complexity.USTCONInstance.edgeTwo,Cslib.Complexity.USTCONInstance.emptyTwo,Cslib.Complexity.USTCONInstance.ofBool: canonical two-vertex connected and disconnected instances.Cslib.Complexity.encUSTCON: the encoding of instances.Cslib.Complexity.USTCON: the instances in whichtis reachable froms.
Main results #
Cslib.Complexity.USTCONInstance.getD_encode_n,.getD_encode_s,.getD_encode_t,.getD_encode_matrix: the bits of the header and of the matrix in the encoding.Cslib.Complexity.USTCONInstance.encode_injective: the encoding is injective.Cslib.Complexity.USTCONInstance.size_n_le_log2: the number of vertices has logarithmically many binary digits in the length of the encoding.Cslib.Complexity.USTCONInstance.edgeTwo_mem_USTCON,Cslib.Complexity.USTCONInstance.emptyTwo_notMem_USTCON,Cslib.Complexity.USTCONInstance.ofBool_mem_USTCON: membership of the canonical two-vertex instances inUSTCON.
References #
An instance of undirected s–t connectivity: a simple graph on Fin n, given by its
adjacency matrix, symmetric and with zero diagonal, and two vertices s and t.
- n : ℕ
The number of vertices.
The adjacency matrix.
The adjacency matrix is symmetric.
No vertex is adjacent to itself.
The source.
The target.
Instances For
An instance has a vertex, its source.
The simple graph of an instance: a and b are adjacent when the entry of the row a and the
column b of the adjacency matrix is set.
Instances For
Adjacency in the graph of an instance is decidable.
The directed graph of an instance, with its source and target: an arc in each direction for every edge.
Instances For
Distinct instances have distinct directed graphs, since the adjacency matrix determines the proofs of symmetry and looplessness.
The encoding of an instance, that of its directed graph (Cslib.Complexity.encSTCON): the
unary header 1^n 0 1^s 0 1^t 0, then the adjacency matrix row by row.
Instances For
The encoding is injective.
The single edge on two vertices 0 and 1, with source 0 and target 1.
Instances For
The edgeless graph on two vertices 0 and 1, with source 0 and target 1.
Instances For
The edgeless graph on two vertices does not belong to USTCON.