def __insert_branch(u, v, dfs_data):
    """Embeds a branch Bu(v) (as described on page 22 of the paper). Returns whether the embedding was successful."""
    w = L1(v, dfs_data)
    d_u = D(u, dfs_data)
    d_w = D(w, dfs_data)

    # Embed uw
    successful = __embed_frond(u, w, dfs_data)
    if not successful:
        return False

    # Embed a branch marker uu on the side opposite to uw, in the same frond block
    #successful = __embed_frond(u, v, dfs_data, as_branch_marker=True)
    successful = __embed_frond(u, u, dfs_data, as_branch_marker=True)
    if not successful:
        return False

    return True
def __insert_branch ( u , v , dfs_data ) : w = L1 ( v , dfs_data ) d_u = D ( u , dfs_data ) d_w = D ( w , dfs_data ) successful = __embed_frond ( u , w , dfs_data ) if not successful : return False successful = __embed_frond ( u , u , dfs_data , as_branch_marker = True ) if not successful : return False return True
Embeds a branch Bu(v) (as described on page 22 of the paper). Returns whether the embedding was successful.