Fix logic in sort_fused_cycles
Add function to identify the types of cycle sets