Vertex colors given by a list #
A coloring, or any other labeling of the vertices of a Cslib.Complexity.Graph by numbers, can be
given as a list of numbers parallel to the vertex list: the label of a vertex is the entry at its
first occurrence among the declared vertices (Cslib.Complexity.colorOf). The colored instances of
color coding take colors in this form, and NP verifiers with colorings or vertex ranks as
witnesses read them in this form (Cslib.Complexity.mem_NP_of_colorOf).
Main definitions #
Cslib.Complexity.colorOf: the color of a vertex in a list of colors.Cslib.Complexity.encColoredGraph: graphs with a list of vertex colors.
Main results #
Cslib.Complexity.colorOf_map: listing the colors of the declared vertices gives every declared vertex its color.Cslib.Complexity.computableInPolyTime_colorOf,Cslib.Complexity.computableInPolyTime_colorOf_comp: reading a color is polynomial-time.Cslib.Complexity.Graph.length_encList_map_le: quadratic encoded-length bound for a bounded vertex labeling listed alongG.vertices.Cslib.Complexity.mem_NP_of_colorOf:NPmembership for graph problems verified from a bounded vertex labeling.
Graphs with vertex colors: the graph (encGraph), framed, then the list of colors parallel to
its vertex list (Cslib.Complexity.colorOf), each color framed and in binary.
Instances For
Reading a color from a list of colors is polynomial-time.
Reading computed colors of computed vertices is polynomial-time; the compositional form of
Cslib.Complexity.computableInPolyTime_colorOf used by fun_prop.
A labeling listed along the vertex list of a graph with at most n listed vertices, whose
values on the declared vertices are at most n, has an encoding of length at most 2 n ^ 2 + n.
NP membership from a bounded vertex labeling. Let check be polynomial-time on instances
x paired with a list of vertex labels (Cslib.Complexity.colorOf). If every accepted list
certifies membership in S, and every member x ∈ S has a labeling g of the declared vertices
(graph x).vertices bounded by (graph x).vertices.length whose list
(graph x).vertices.map g is accepted by check, then S ∈ NP enc.