Added test for cycle removal in generate_bn