Enumerating and Generating Labeled k-degenerate Graphs
Reinhard Bauer, Marcus Krug, Dorothea Wagner · 2010
A k-degenerate graph is a graph in which every induced subgraph has a vertex with degree at most k. The class of k-degenerate graphs is interesting from a theoretical point of view and it plays an interesting role in the theory of fixed parameter tractability since some otherwise W[2]-hard domination problems become fixed-parameter tractable for k-degenerate graphs. It is a well-known fact that the k-degenerate graphs are exactly the graphs whose vertex-set can be well-ordered such that each vertex is incident to at most k larger vertices with respect to this ordering. A well-ordered k-degenerate graph is a labeled graph with vertex-labels 1, …, n such that the ordering of the vertices by their labels is a well-ordering of the graph. We consider the problem of enumerating and generating well-ordered k-degenerate graphs with a given number of vertices and with a given number of vertices and edges, respectively, uniformly at random. By generating well-ordered k-degenerate graphs we generate at least one labeled copy of each unlabeled k-degenerate graph and we filter some but not all isomorphies compared to the classical labeled approach. We also introduce the class of strongly k-degenerate graphs, which are k-degenerate graphs with minimum degree k. These graphs are a natural generalization of k-regular graphs which can be used in order to generate graphs with predefined core-decomposition. We present efficient algorithms for generating well-ordered k-degenerate graphs with given number of vertices (and edges). After a precomputation which must only be performed once when generating more than one well-ordered k-degenerate graph these algorithms are almost optimal. Additionally, we present complete non-uniform generators for these classes with optimal running time. We also present an efficient and complete generator for well-ordered strongly k-degenerate graphs with given number of vertices (and edges). Finally, we present efficient algorithms for enumerating well-ordered k-degenerate and strongly k-degenerate graphs.