The Kleitman–Wang algorithms are two different algorithms in
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
solving the
digraph realization problem, i.e. the question if there exists for a finite
list
A list is a Set (mathematics), set of discrete items of information collected and set forth in some format for utility, entertainment, or other purposes. A list may be memorialized in any number of ways, including existing only in the mind of t ...
of nonnegative
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
pairs a
simple directed graph such that its
degree sequence is exactly this list. For a positive answer the list of integer pairs is called ''digraphic''. Both algorithms construct a special solution if one exists or prove that one cannot find a positive answer. These constructions are based on
recursive algorithm
In computer science, recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves ...
s. Kleitman and Wang
gave these algorithms in 1973.
Kleitman–Wang algorithm (arbitrary choice of pairs)
The algorithm is based on the following theorem.
Let
be a finite list of nonnegative integers that is in
nonincreasing lexicographical order
In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a ...
and let
be a pair of nonnegative integers with
. List
is digraphic if and only if the finite
list
A list is a Set (mathematics), set of discrete items of information collected and set forth in some format for utility, entertainment, or other purposes. A list may be memorialized in any number of ways, including existing only in the mind of t ...
has nonnegative integer pairs and is digraphic.
Note that the pair
is arbitrarily with the exception of pairs
. If the given list
digraphic then the theorem will be applied at most
times setting in each further step
. This process ends when the whole list
consists of
pairs. In each step of the algorithm one constructs the
arcs of a digraph with vertices
, i.e. if it is possible to reduce the list
to
, then we add arcs
. When the list
cannot be reduced to a list
of nonnegative integer pairs in any step of this approach, the theorem proves that the list
from the beginning is not digraphic.
Kleitman–Wang algorithm (maximum choice of a pair)
The algorithm is based on the following theorem.
Let
be a finite list of nonnegative integers such that
and let
be a pair such that
is maximal with respect to the
lexicographical order
In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a ...
under all pairs
. List
is digraphic if and only if the finite list
has nonnegative integer pairs and is digraphic.
Note that the list
must not be in lexicographical order as in the first version. If the given list
is digraphic, then the theorem will be applied at most
times, setting in each further step
. This process ends when the whole list
consists of
pairs. In each step of the algorithm, one constructs the
arcs of a digraph with vertices
, i.e. if it is possible to reduce the list
to
, then one adds arcs
. When the list
cannot be reduced to a list
of nonnegative integer pairs in any step of this approach, the theorem proves that the list
from the beginning is not digraphic.
See also
*
Fulkerson–Chen–Anstee theorem
References
*
{{DEFAULTSORT:Kleitman-Wang algorithms
Graph algorithms