Directed s–t connectivity #
An instance of directed s–t connectivity (Cslib.Complexity.STCONInstance) is a directed
graph on Fin n, given by its adjacency matrix, together with two vertices s and t; it
belongs to Cslib.Complexity.STCON when the graph has a directed path from s to t, of any
length, including the empty path when s = t. This is the problem PATH of
Sipser, Section 7.2 and Example 8.19, also called REACHABILITY
Papadimitriou, Section 1.1. The adjacency matrix need not be symmetric and
may have loops.
Instances are encoded (Cslib.Complexity.encSTCON) by the unary header 1^n 0 1^s 0 1^t 0
followed by the adjacency matrix, row by row: 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 every number a machine reads
from the header has logarithmically many binary digits in the length of the encoding. This is the
encoding of undirected connectivity (Cslib.Complexity.encUSTCON), which is defined through it.
Main definitions #
Cslib.Complexity.STCONInstance: instances of directeds–tconnectivity.Cslib.Complexity.STCONInstance.Adj: the arcs of an instance.Cslib.Complexity.encSTCON: the encoding of instances.Cslib.Complexity.STCON: the instances with a directed path fromstot.
Main results #
Cslib.Complexity.STCONInstance.getD_encode_n,.getD_encode_s,.getD_encode_t,.getD_encode_matrix: the bits of the header and of the matrix in the encoding;.getElem?_encode_n,.getElem?_encode_s,.getElem?_encode_t,.getElem?_encode_matrix: the same bits, read by position.Cslib.Complexity.STCONInstance.length_encode: the length of the encoding.Cslib.Complexity.STCONInstance.matrix_eq_flatMap: the matrix as the concatenation of its rows.Cslib.Complexity.STCONInstance.encode_injective: the encoding is injective.Cslib.Complexity.STCONInstance.size_n_le_log2: the number of vertices has logarithmically many binary digits in the length of the encoding.
References #
An instance has a vertex, its source.
The arcs of an instance: there is an arc from a to b when the entry of the row a and the
column b of the adjacency matrix is set.
Instances For
The adjacency matrix has n ^ 2 entries.
The encoding of an instance: the unary header 1^n 0 1^s 0 1^t 0, then the adjacency matrix
row by row.
Instances For
The number of vertices is at most the length of the encoding.
The encoding is injective.
Directed s–t connectivity: the instances whose graph has a directed path from s to
t, the problem PATH of Sipser, Example 8.19.