generate directed pseudoforest