Passed parameter cls to the gen-bd function is useless (do not work).
Functions for checking transforming graphs.