elif len(comp :connected_components(contextfactorssplit_order) there are disconnected components self display( ,"splitting into connected components",compreturn(math prod(self rc(context, ,eofor ( ,eoin comp)elseassert split_orderf"split_order empty rc({context},{factors})var split_order[ self display( "rc branching on"varif isinstance(var,decisionvariable)assert set(context<set(var parents) "cannot optimize {varin context {context}maxres -math inf for val in var domainself display( ,"in rcbranching on",var,"=",valnewres self rc(dict_union({var:val},context)factorssplit_order[ :]if newres maxresmaxres newres theval val self opt_policy[frozenset(context items())(var,thevalself cache[cemaxres return maxres elsetotal for val in var domaintotal +self rc(dict_union({var:val},context)factorssplit_order[ :]self display( "rc branching on"var,"returning"totalself cache[cetotal return total here is how to run the optimize the example decision networksdecnnetworks py -(continued umbrella decision network #urc rc_dn(umberella_dn#urc optimize(#urc opt_policy #rc_fire rc_dn(fire_dn#rc_fire optimize(#rc_fire opt_policy #rc_cheat rc_dn(cheating_dn#rc_cheat optimize(#rc_cheat opt_policy #rc_ch rc_dn(ch #rc_ch optimize(#rc_ch opt_policy version june