  In this paper, we describe how to get Janet decomposition for a finite set of
terms and detect completeness of that set by means of the associated Bar Code.
Moreover, we explain an algorithm to find a variable ordering (if it exists)
s.t. a given set of terms is complete according to that ordering. The algorithm
is greedy and constructs a Bar Code from the maximal to the minimal variable,
adjusting the variable ordering with a sort of backtracking technique, thus
allowing to construct the desired ordering without trying all the n! possible
orderings

Combinatorics;Commutative Algebra