elseassert split_order"split_order should not be empty to get heretotal var split_order[ self display( "rc branching on"varfor val in var domaintotal +self prob_search(dict_union({var:val},context)factorssplit_order[ :]self cache[cetotal self display( "rc branching on"var,"returning"totalreturn total connected_components returns list of connected componentswhere connected component is set of factors and set of variableswhere the graph that connects variables and factors that involve them is connected the connected components are built one at timewith current connected component at all times factors is partitioned into disjoint setscomponent_factors containing factors in the current connected component where all factors that share variable are already in the component factors_to_check containing factors in the current connected component where potentially some factors that share variable are not in the componentthese need to be checked other_factors the other factors that are not (yetin the connected component probrc py -(continued def connected_components(contextfactorssplit_order)"""returns list of ( ,ewhere is subset of factors and is subset of split_order such that each element shares the same variables that are disjoint from other elements ""other_factors set(factors#copies factors factors_to_check {other_factors pop()factors in connected component still to be checked component_factors set(factors in first connected component already checked component_variables set(variables in first connected component while factors_to_checknext_fac factors_to_check pop(component_factors add(next_facnew_vars set(next_fac variablescomponent_variables context keys(component_variables |new_vars for var in new_varsversion june