B @`-@sNddlmZedkredes(dekr6ddlmZnddlZy ddlZ Wne k rfddl Z YnXdd Z d d Z d d Z ddZGdddeZGdddeZeeGdddeZeeGdddeZeeGdddeZeeddddddddd Zdddddddd!d"Zddddd#ddd$d%d&ZdS)') version_info)rzPython 2.7 or later required.) _pywrapgraphNcCsDyd|j}Wntjk r,d}YnXd|jj|jj|fS)Nz proxy of z <%s.%s; %s >)this__repr__ __builtin__ Exception __class__ __module____name__)selfZstrthisr=/tmp/pip-unpacked-wheel-6vtt70cy/ortools/graph/pywrapgraph.py _swig_reprs  rcsfdd}|S)Ncsh|dkr|j|nN|dkr,|||n8t||rXttt||trX|||n td|dS)Nthisownr z(You cannot add instance attributes to %s)r ownhasattr isinstancegetattrtypepropertyAttributeError)rnamevalue)setrrset_instance_attrszE_swig_setattr_nondynamic_instance_variable..set_instance_attrr)rrr)rr*_swig_setattr_nondynamic_instance_variables r csfdd}|S)Ncs8t||r(tt||ts(|||n td|dS)Nz%You cannot add class attributes to %s)rrrrr)clsrr)rrrset_class_attr,sz?_swig_setattr_nondynamic_class_variable..set_class_attrr)rr"r)rr'_swig_setattr_nondynamic_class_variable+s r#csfdd}|S)zlClass decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclasscs|j|j|jS)N)r __bases____dict__copy)r!) metaclassrrwrapper6sz$_swig_add_metaclass..wrapperr)r'r(r)r'r_swig_add_metaclass4s r)c@seZdZdZeejZdS)_SwigNonDynamicMetazKMeta class to enforce nondynamic attributes (no new attributes) for a classN)rr __qualname____doc__r#r __setattr__rrrrr*;sr*c@s eZdZeddddddZeZddZddd d d d d ZddddZ d dddZ d ddddZ d ddddZ d d dddZ ejZejZejZejZddddddZd dddZd d dd d!Zd"dd#d$Zd"dd%d&Zd d d"d'd(d)ZejZd*S)+ SimpleMaxFlowcCs |jS)N)r r)xrrrAzSimpleMaxFlow.cCs |j|S)N)r r)r/vrrrr0Ar1zThe membership flag)doccCst|tdS)N)rZSimpleMaxFlow_swiginitZnew_SimpleMaxFlow)rrrr__init__DszSimpleMaxFlow.__init__zoperations_research::NodeIndexz!operations_research::FlowQuantityzoperations_research::ArcIndex)tailheadcapacityreturncCst||||S)N)rZ SimpleMaxFlow_AddArcWithCapacity)rr5r6r7rrrAddArcWithCapacityGsz SimpleMaxFlow.AddArcWithCapacity)r8cCs t|S)N)rZSimpleMaxFlow_NumNodes)rrrrNumNodesJszSimpleMaxFlow.NumNodescCs t|S)N)rZSimpleMaxFlow_NumArcs)rrrrNumArcsMszSimpleMaxFlow.NumArcs)arcr8cCs t||S)N)rZSimpleMaxFlow_Tail)rr<rrrTailPszSimpleMaxFlow.TailcCs t||S)N)rZSimpleMaxFlow_Head)rr<rrrHeadSszSimpleMaxFlow.HeadcCs t||S)N)rZSimpleMaxFlow_Capacity)rr<rrrCapacityVszSimpleMaxFlow.Capacityz*operations_research::SimpleMaxFlow::Status)sourcesinkr8cCst|||S)N)rZSimpleMaxFlow_Solve)rr@rArrrSolve]szSimpleMaxFlow.SolvecCs t|S)N)rZSimpleMaxFlow_OptimalFlow)rrrr OptimalFlow`szSimpleMaxFlow.OptimalFlowcCs t||S)N)rZSimpleMaxFlow_Flow)rr<rrrFlowcszSimpleMaxFlow.FlowvoidcCs t|S)N)rZ!SimpleMaxFlow_GetSourceSideMinCut)rrrrGetSourceSideMinCutfsz!SimpleMaxFlow.GetSourceSideMinCutcCs t|S)N)rZSimpleMaxFlow_GetSinkSideMinCut)rrrrGetSinkSideMinCutiszSimpleMaxFlow.GetSinkSideMinCut)r<r7r8cCst|||S)N)rZSimpleMaxFlow_SetArcCapacity)rr<r7rrrSetArcCapacitylszSimpleMaxFlow.SetArcCapacityN)rrr+rrrr r4r9r:r;r=r>r?rZSimpleMaxFlow_OPTIMALOPTIMALZSimpleMaxFlow_POSSIBLE_OVERFLOWPOSSIBLE_OVERFLOWZSimpleMaxFlow_BAD_INPUTZ BAD_INPUTZSimpleMaxFlow_BAD_RESULT BAD_RESULTrBrCrDrFrGrHZdelete_SimpleMaxFlow__swig_destroy__rrrrr.@s(r.c@s^eZdZeddddddZeZejZ ej Z ej Z ejZejZejZejZddZejZdS) MinCostFlowBasecCs |jS)N)r r)r/rrrr0tr1zMinCostFlowBase.cCs |j|S)N)r r)r/r2rrrr0tr1zThe membership flag)r3cCst|tdS)N)rZMinCostFlowBase_swiginitZnew_MinCostFlowBase)rrrrr4~szMinCostFlowBase.__init__N)rrr+rrrr rZMinCostFlowBase_NOT_SOLVEDZ NOT_SOLVEDZMinCostFlowBase_OPTIMALrIZMinCostFlowBase_FEASIBLEZFEASIBLEZMinCostFlowBase_INFEASIBLE INFEASIBLEZMinCostFlowBase_UNBALANCEDZ UNBALANCEDZMinCostFlowBase_BAD_RESULTrKZMinCostFlowBase_BAD_COST_RANGEZBAD_COST_RANGEr4Zdelete_MinCostFlowBaserLrrrrrMssrMc@seZdZeddddddZeZd2ddd d d Zddd d ddddZdd ddddZ ddddZ ddddZ d dddZ d dddZ dd dd d!Zddd"d#Zddd$d%Zdddd&d'Zdddd(d)Zdd dd*d+Zdd d,d-d.Zdd dd/d0ZejZd1S)3SimpleMinCostFlowcCs |jS)N)r r)r/rrrr0r1zSimpleMinCostFlow.cCs |j|S)N)r r)r/r2rrrr0r1zThe membership flag)r3rzoperations_research::NodeIndexzoperations_research::ArcIndex)reserve_num_nodesreserve_num_arcscCst|t||dS)N)rZSimpleMinCostFlow_swiginitZnew_SimpleMinCostFlow)rrPrQrrrr4szSimpleMinCostFlow.__init__z!operations_research::FlowQuantityzoperations_research::CostValue)r5r6r7 unit_costr8cCst|||||S)N)rZ/SimpleMinCostFlow_AddArcWithCapacityAndUnitCost)rr5r6r7rRrrrAddArcWithCapacityAndUnitCostsz/SimpleMinCostFlow.AddArcWithCapacityAndUnitCostrE)nodesupplyr8cCst|||S)N)rZSimpleMinCostFlow_SetNodeSupply)rrTrUrrr SetNodeSupplyszSimpleMinCostFlow.SetNodeSupplyz,operations_research::MinCostFlowBase::Status)r8cCs t|S)N)rZSimpleMinCostFlow_Solve)rrrrrBszSimpleMinCostFlow.SolvecCs t|S)N)rZ)SimpleMinCostFlow_SolveMaxFlowWithMinCost)rrrrSolveMaxFlowWithMinCostsz)SimpleMinCostFlow.SolveMaxFlowWithMinCostcCs t|S)N)rZSimpleMinCostFlow_OptimalCost)rrrr OptimalCostszSimpleMinCostFlow.OptimalCostcCs t|S)N)rZSimpleMinCostFlow_MaximumFlow)rrrr MaximumFlowszSimpleMinCostFlow.MaximumFlow)r<r8cCs t||S)N)rZSimpleMinCostFlow_Flow)rr<rrrrDszSimpleMinCostFlow.FlowcCs t|S)N)rZSimpleMinCostFlow_NumNodes)rrrrr:szSimpleMinCostFlow.NumNodescCs t|S)N)rZSimpleMinCostFlow_NumArcs)rrrrr;szSimpleMinCostFlow.NumArcscCs t||S)N)rZSimpleMinCostFlow_Tail)rr<rrrr=szSimpleMinCostFlow.TailcCs t||S)N)rZSimpleMinCostFlow_Head)rr<rrrr>szSimpleMinCostFlow.HeadcCs t||S)N)rZSimpleMinCostFlow_Capacity)rr<rrrr?szSimpleMinCostFlow.Capacity)rTr8cCs t||S)N)rZSimpleMinCostFlow_Supply)rrTrrrSupplyszSimpleMinCostFlow.SupplycCs t||S)N)rZSimpleMinCostFlow_UnitCost)rr<rrrUnitCostszSimpleMinCostFlow.UnitCostN)rr)rrr+rrrr r4rSrVrBrWrXrYrDr:r;r=r>r?rZr[rZdelete_SimpleMinCostFlowrLrrrrrOs$rOc@seZdZeddddddZeZddZddd d d d d ZddddZ d dddZ d ddddZ d ddddZ d d dddZ ejZejZejZddddZd dddZdddd d!Zdd dd"d#ZejZd$S)%LinearSumAssignmentcCs |jS)N)r r)r/rrrr0r1zLinearSumAssignment.cCs |j|S)N)r r)r/r2rrrr0r1zThe membership flag)r3cCst|tdS)N)rZLinearSumAssignment_swiginitZnew_LinearSumAssignment)rrrrr4szLinearSumAssignment.__init__zoperations_research::NodeIndexzoperations_research::CostValuezoperations_research::ArcIndex) left_node right_nodecostr8cCst||||S)N)rZ"LinearSumAssignment_AddArcWithCost)rr]r^r_rrrAddArcWithCostsz"LinearSumAssignment.AddArcWithCost)r8cCs t|S)N)rZLinearSumAssignment_NumNodes)rrrrr:szLinearSumAssignment.NumNodescCs t|S)N)rZLinearSumAssignment_NumArcs)rrrrr;szLinearSumAssignment.NumArcs)r<r8cCs t||S)N)rZLinearSumAssignment_LeftNode)rr<rrrLeftNodeszLinearSumAssignment.LeftNodecCs t||S)N)rZLinearSumAssignment_RightNode)rr<rrr RightNodeszLinearSumAssignment.RightNodecCs t||S)N)rZLinearSumAssignment_Cost)rr<rrrCostszLinearSumAssignment.Costz6operations_research::SimpleLinearSumAssignment::StatuscCs t|S)N)rZLinearSumAssignment_Solve)rrrrrBszLinearSumAssignment.SolvecCs t|S)N)rZLinearSumAssignment_OptimalCost)rrrrrXszLinearSumAssignment.OptimalCost)r]r8cCs t||S)N)rZLinearSumAssignment_RightMate)rr]rrr RightMateszLinearSumAssignment.RightMatecCs t||S)N)rZ"LinearSumAssignment_AssignmentCost)rr]rrrAssignmentCostsz"LinearSumAssignment.AssignmentCostN)rrr+rrrr r4r`r:r;rarbrcrZLinearSumAssignment_OPTIMALrIZLinearSumAssignment_INFEASIBLErNZ%LinearSumAssignment_POSSIBLE_OVERFLOWrJrBrXrdreZdelete_LinearSumAssignmentrLrrrrr\s"r\intz std::function< int64 (int,int) >Zint64zstd::vector< int > *) node_count start_nodeend_nodegraphdisconnected_distancer8cCst|||||S)N)rDijkstraShortestPath)rgrhrirjrkrrrrlsrlcCst|||||S)N)rBellmanFordShortestPath)rgrhrirjrkrrrrmsrmzstd::function< int64 (int) >)rgrhrirj heuristicrkr8cCst||||||S)N)rAStarShortestPath)rgrhrirjrnrkrrrrosro)sysrZ_swig_python_version_info RuntimeError __package__rrrbuiltinsr ImportErrorrr r#r)rr*objectr.ZSimpleMaxFlow_swigregisterrMZMinCostFlowBase_swigregisterrOZSimpleMinCostFlow_swigregisterr\Z LinearSumAssignment_swigregisterrlrmrorrrrs2     1  3 *