def METHOD_NAME(self, sdfg: SDFG) -> Iterator[SDFGState]:
    """
    Traverse SDFG and keep track of whether the state is executed unconditionally.
    """
    ipostdom = sdutil.postdominators(sdfg)
    curstate = sdfg.start_state
    out_degree = sdfg.out_degree(curstate)
    while out_degree > 0:
        yield curstate
        if out_degree == 1:  # Unconditional, continue to next state
            curstate = sdfg.successors(curstate)[0]
        elif out_degree > 1:  # Conditional branch
            # Conditional code follows, use immediate post-dominator for next unconditional state
            curstate = ipostdom[curstate]
        # Compute new out degree
        if curstate in sdfg.nodes():
            out_degree = sdfg.out_degree(curstate)
        else:
            out_degree = 0
    # Yield final state
    yield curstate