Graphs encoded by edge bits #
A simple graph on n labelled vertices is encoded by one Boolean coordinate for each unordered
pair of distinct vertices. edgeEquiv numbers these coordinates without changing the layout
formerly used by the clique function. The common encoding supports graph properties such as
clique containment and connectivity without importing either application.
Main definitions #
Cslib.BitString.Graph.Edge,edgeCount,edgeEquiv: the possible edges and their numbering.Cslib.BitString.Graph.graph,ofGraph: graph/edge-word conversion.
Main results #
Cslib.BitString.Graph.edgeCount_eq_choose: the coordinate count isn.choose 2.Cslib.BitString.Graph.graph_adj: adjacency is the corresponding edge bit.Cslib.BitString.Graph.graph_ofGraph,ofGraph_graph: both conversions are inverse.
The encoding and its original lemmas were extracted from Samuel Schlesinger's clique module.
The possible edges of a graph on n vertices: unordered pairs of distinct vertices.
The number of possible edges of a graph on n vertices.
The graph of an input: its edges are the possible edges set to true.
Distinct edge words encode distinct graphs.
The edge word of a labelled simple graph, in the same numbering as graph.
Encoding a graph and reading its edge word recovers the graph.