Module pywrapgraph

Source code
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError('Python 2.7 or later required')

# Import the low-level C/C++ module
if __package__ or '.' in __name__:
    from . import _pywrapgraph
else:
    import _pywrapgraph

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if name == "thisown":
        return self.this.own(value)
    if name == "this":
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if not static:
        object.__setattr__(self, name, value)
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if name == "thisown":
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class SimpleMaxFlow(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.SimpleMaxFlow_swiginit(self, _pywrapgraph.new_SimpleMaxFlow())

    def AddArcWithCapacity(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity') -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMaxFlow_AddArcWithCapacity(self, tail, head, capacity)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMaxFlow_NumArcs(self)

    def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_Tail(self, arc)

    def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_Head(self, arc)

    def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_Capacity(self, arc)
    OPTIMAL = _pywrapgraph.SimpleMaxFlow_OPTIMAL
    POSSIBLE_OVERFLOW = _pywrapgraph.SimpleMaxFlow_POSSIBLE_OVERFLOW
    BAD_INPUT = _pywrapgraph.SimpleMaxFlow_BAD_INPUT
    BAD_RESULT = _pywrapgraph.SimpleMaxFlow_BAD_RESULT

    def Solve(self, source: 'operations_research::NodeIndex', sink: 'operations_research::NodeIndex') -> "operations_research::SimpleMaxFlow::Status":
        return _pywrapgraph.SimpleMaxFlow_Solve(self, source, sink)

    def OptimalFlow(self) -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_OptimalFlow(self)

    def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_Flow(self, arc)

    def GetSourceSideMinCut(self) -> "void":
        return _pywrapgraph.SimpleMaxFlow_GetSourceSideMinCut(self)

    def GetSinkSideMinCut(self) -> "void":
        return _pywrapgraph.SimpleMaxFlow_GetSinkSideMinCut(self)

    def SetArcCapacity(self, arc: 'operations_research::ArcIndex', capacity: 'operations_research::FlowQuantity') -> "void":
        return _pywrapgraph.SimpleMaxFlow_SetArcCapacity(self, arc, capacity)
    __swig_destroy__ = _pywrapgraph.delete_SimpleMaxFlow

# Register SimpleMaxFlow in _pywrapgraph:
_pywrapgraph.SimpleMaxFlow_swigregister(SimpleMaxFlow)

class MinCostFlowBase(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    NOT_SOLVED = _pywrapgraph.MinCostFlowBase_NOT_SOLVED
    OPTIMAL = _pywrapgraph.MinCostFlowBase_OPTIMAL
    FEASIBLE = _pywrapgraph.MinCostFlowBase_FEASIBLE
    INFEASIBLE = _pywrapgraph.MinCostFlowBase_INFEASIBLE
    UNBALANCED = _pywrapgraph.MinCostFlowBase_UNBALANCED
    BAD_RESULT = _pywrapgraph.MinCostFlowBase_BAD_RESULT
    BAD_COST_RANGE = _pywrapgraph.MinCostFlowBase_BAD_COST_RANGE

    def __init__(self):
        _pywrapgraph.MinCostFlowBase_swiginit(self, _pywrapgraph.new_MinCostFlowBase())
    __swig_destroy__ = _pywrapgraph.delete_MinCostFlowBase

# Register MinCostFlowBase in _pywrapgraph:
_pywrapgraph.MinCostFlowBase_swigregister(MinCostFlowBase)

class SimpleMinCostFlow(MinCostFlowBase):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.SimpleMinCostFlow_swiginit(self, _pywrapgraph.new_SimpleMinCostFlow())

    def AddArcWithCapacityAndUnitCost(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity', unit_cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMinCostFlow_AddArcWithCapacityAndUnitCost(self, tail, head, capacity, unit_cost)

    def SetNodeSupply(self, node: 'operations_research::NodeIndex', supply: 'operations_research::FlowQuantity') -> "void":
        return _pywrapgraph.SimpleMinCostFlow_SetNodeSupply(self, node, supply)

    def Solve(self) -> "operations_research::MinCostFlowBase::Status":
        return _pywrapgraph.SimpleMinCostFlow_Solve(self)

    def SolveMaxFlowWithMinCost(self) -> "operations_research::MinCostFlowBase::Status":
        return _pywrapgraph.SimpleMinCostFlow_SolveMaxFlowWithMinCost(self)

    def OptimalCost(self) -> "operations_research::CostValue":
        return _pywrapgraph.SimpleMinCostFlow_OptimalCost(self)

    def MaximumFlow(self) -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_MaximumFlow(self)

    def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Flow(self, arc)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMinCostFlow_NumArcs(self)

    def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_Tail(self, arc)

    def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_Head(self, arc)

    def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Capacity(self, arc)

    def Supply(self, node: 'operations_research::NodeIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Supply(self, node)

    def UnitCost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
        return _pywrapgraph.SimpleMinCostFlow_UnitCost(self, arc)
    __swig_destroy__ = _pywrapgraph.delete_SimpleMinCostFlow

# Register SimpleMinCostFlow in _pywrapgraph:
_pywrapgraph.SimpleMinCostFlow_swigregister(SimpleMinCostFlow)

class LinearSumAssignment(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.LinearSumAssignment_swiginit(self, _pywrapgraph.new_LinearSumAssignment())

    def AddArcWithCost(self, left_node: 'operations_research::NodeIndex', right_node: 'operations_research::NodeIndex', cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
        return _pywrapgraph.LinearSumAssignment_AddArcWithCost(self, left_node, right_node, cost)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.LinearSumAssignment_NumArcs(self)

    def LeftNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_LeftNode(self, arc)

    def RightNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_RightNode(self, arc)

    def Cost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_Cost(self, arc)
    OPTIMAL = _pywrapgraph.LinearSumAssignment_OPTIMAL
    INFEASIBLE = _pywrapgraph.LinearSumAssignment_INFEASIBLE
    POSSIBLE_OVERFLOW = _pywrapgraph.LinearSumAssignment_POSSIBLE_OVERFLOW

    def Solve(self) -> "operations_research::SimpleLinearSumAssignment::Status":
        return _pywrapgraph.LinearSumAssignment_Solve(self)

    def OptimalCost(self) -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_OptimalCost(self)

    def RightMate(self, left_node: 'operations_research::NodeIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_RightMate(self, left_node)

    def AssignmentCost(self, left_node: 'operations_research::NodeIndex') -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_AssignmentCost(self, left_node)
    __swig_destroy__ = _pywrapgraph.delete_LinearSumAssignment

# Register LinearSumAssignment in _pywrapgraph:
_pywrapgraph.LinearSumAssignment_swigregister(LinearSumAssignment)


def DijkstraShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.DijkstraShortestPath(node_count, start_node, end_node, graph, disconnected_distance)

def BellmanFordShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.BellmanFordShortestPath(node_count, start_node, end_node, graph, disconnected_distance)

def AStarShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', heuristic: 'std::function< int64 (int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.AStarShortestPath(node_count, start_node, end_node, graph, heuristic, disconnected_distance)

Functions

def AStarShortestPath(node_count, start_node, end_node, graph, heuristic, disconnected_distance)
Source code
def AStarShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', heuristic: 'std::function< int64 (int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.AStarShortestPath(node_count, start_node, end_node, graph, heuristic, disconnected_distance)
def BellmanFordShortestPath(node_count, start_node, end_node, graph, disconnected_distance)
Source code
def BellmanFordShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.BellmanFordShortestPath(node_count, start_node, end_node, graph, disconnected_distance)
def DijkstraShortestPath(node_count, start_node, end_node, graph, disconnected_distance)
Source code
def DijkstraShortestPath(node_count: 'int', start_node: 'int', end_node: 'int', graph: 'std::function< int64 (int,int) >', disconnected_distance: 'int64') -> "std::vector< int > *":
    return _pywrapgraph.DijkstraShortestPath(node_count, start_node, end_node, graph, disconnected_distance)

Classes

class LinearSumAssignment
Source code
class LinearSumAssignment(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.LinearSumAssignment_swiginit(self, _pywrapgraph.new_LinearSumAssignment())

    def AddArcWithCost(self, left_node: 'operations_research::NodeIndex', right_node: 'operations_research::NodeIndex', cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
        return _pywrapgraph.LinearSumAssignment_AddArcWithCost(self, left_node, right_node, cost)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.LinearSumAssignment_NumArcs(self)

    def LeftNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_LeftNode(self, arc)

    def RightNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_RightNode(self, arc)

    def Cost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_Cost(self, arc)
    OPTIMAL = _pywrapgraph.LinearSumAssignment_OPTIMAL
    INFEASIBLE = _pywrapgraph.LinearSumAssignment_INFEASIBLE
    POSSIBLE_OVERFLOW = _pywrapgraph.LinearSumAssignment_POSSIBLE_OVERFLOW

    def Solve(self) -> "operations_research::SimpleLinearSumAssignment::Status":
        return _pywrapgraph.LinearSumAssignment_Solve(self)

    def OptimalCost(self) -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_OptimalCost(self)

    def RightMate(self, left_node: 'operations_research::NodeIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.LinearSumAssignment_RightMate(self, left_node)

    def AssignmentCost(self, left_node: 'operations_research::NodeIndex') -> "operations_research::CostValue":
        return _pywrapgraph.LinearSumAssignment_AssignmentCost(self, left_node)
    __swig_destroy__ = _pywrapgraph.delete_LinearSumAssignment

Class variables

var INFEASIBLE
var OPTIMAL
var POSSIBLE_OVERFLOW

Instance variables

var thisown

The membership flag

Source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

Methods

def AddArcWithCost(self, left_node, right_node, cost)
Source code
def AddArcWithCost(self, left_node: 'operations_research::NodeIndex', right_node: 'operations_research::NodeIndex', cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
    return _pywrapgraph.LinearSumAssignment_AddArcWithCost(self, left_node, right_node, cost)
def AssignmentCost(self, left_node)
Source code
def AssignmentCost(self, left_node: 'operations_research::NodeIndex') -> "operations_research::CostValue":
    return _pywrapgraph.LinearSumAssignment_AssignmentCost(self, left_node)
def Cost(self, arc)
Source code
def Cost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
    return _pywrapgraph.LinearSumAssignment_Cost(self, arc)
def LeftNode(self, arc)
Source code
def LeftNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.LinearSumAssignment_LeftNode(self, arc)
def NumArcs(self)
Source code
def NumArcs(self) -> "operations_research::ArcIndex":
    return _pywrapgraph.LinearSumAssignment_NumArcs(self)
def NumNodes(self)
Source code
def NumNodes(self) -> "operations_research::NodeIndex":
    return _pywrapgraph.LinearSumAssignment_NumNodes(self)
def OptimalCost(self)
Source code
def OptimalCost(self) -> "operations_research::CostValue":
    return _pywrapgraph.LinearSumAssignment_OptimalCost(self)
def RightMate(self, left_node)
Source code
def RightMate(self, left_node: 'operations_research::NodeIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.LinearSumAssignment_RightMate(self, left_node)
def RightNode(self, arc)
Source code
def RightNode(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.LinearSumAssignment_RightNode(self, arc)
def Solve(self)
Source code
def Solve(self) -> "operations_research::SimpleLinearSumAssignment::Status":
    return _pywrapgraph.LinearSumAssignment_Solve(self)
class MinCostFlowBase
Source code
class MinCostFlowBase(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    NOT_SOLVED = _pywrapgraph.MinCostFlowBase_NOT_SOLVED
    OPTIMAL = _pywrapgraph.MinCostFlowBase_OPTIMAL
    FEASIBLE = _pywrapgraph.MinCostFlowBase_FEASIBLE
    INFEASIBLE = _pywrapgraph.MinCostFlowBase_INFEASIBLE
    UNBALANCED = _pywrapgraph.MinCostFlowBase_UNBALANCED
    BAD_RESULT = _pywrapgraph.MinCostFlowBase_BAD_RESULT
    BAD_COST_RANGE = _pywrapgraph.MinCostFlowBase_BAD_COST_RANGE

    def __init__(self):
        _pywrapgraph.MinCostFlowBase_swiginit(self, _pywrapgraph.new_MinCostFlowBase())
    __swig_destroy__ = _pywrapgraph.delete_MinCostFlowBase

Subclasses

Class variables

var BAD_COST_RANGE
var BAD_RESULT
var FEASIBLE
var INFEASIBLE
var NOT_SOLVED
var OPTIMAL
var UNBALANCED

Instance variables

var thisown

The membership flag

Source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
class SimpleMaxFlow
Source code
class SimpleMaxFlow(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.SimpleMaxFlow_swiginit(self, _pywrapgraph.new_SimpleMaxFlow())

    def AddArcWithCapacity(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity') -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMaxFlow_AddArcWithCapacity(self, tail, head, capacity)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMaxFlow_NumArcs(self)

    def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_Tail(self, arc)

    def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMaxFlow_Head(self, arc)

    def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_Capacity(self, arc)
    OPTIMAL = _pywrapgraph.SimpleMaxFlow_OPTIMAL
    POSSIBLE_OVERFLOW = _pywrapgraph.SimpleMaxFlow_POSSIBLE_OVERFLOW
    BAD_INPUT = _pywrapgraph.SimpleMaxFlow_BAD_INPUT
    BAD_RESULT = _pywrapgraph.SimpleMaxFlow_BAD_RESULT

    def Solve(self, source: 'operations_research::NodeIndex', sink: 'operations_research::NodeIndex') -> "operations_research::SimpleMaxFlow::Status":
        return _pywrapgraph.SimpleMaxFlow_Solve(self, source, sink)

    def OptimalFlow(self) -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_OptimalFlow(self)

    def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMaxFlow_Flow(self, arc)

    def GetSourceSideMinCut(self) -> "void":
        return _pywrapgraph.SimpleMaxFlow_GetSourceSideMinCut(self)

    def GetSinkSideMinCut(self) -> "void":
        return _pywrapgraph.SimpleMaxFlow_GetSinkSideMinCut(self)

    def SetArcCapacity(self, arc: 'operations_research::ArcIndex', capacity: 'operations_research::FlowQuantity') -> "void":
        return _pywrapgraph.SimpleMaxFlow_SetArcCapacity(self, arc, capacity)
    __swig_destroy__ = _pywrapgraph.delete_SimpleMaxFlow

Class variables

var BAD_INPUT
var BAD_RESULT
var OPTIMAL
var POSSIBLE_OVERFLOW

Instance variables

var thisown

The membership flag

Source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

Methods

def AddArcWithCapacity(self, tail, head, capacity)
Source code
def AddArcWithCapacity(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity') -> "operations_research::ArcIndex":
    return _pywrapgraph.SimpleMaxFlow_AddArcWithCapacity(self, tail, head, capacity)
def Capacity(self, arc)
Source code
def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMaxFlow_Capacity(self, arc)
def Flow(self, arc)
Source code
def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMaxFlow_Flow(self, arc)
def GetSinkSideMinCut(self)
Source code
def GetSinkSideMinCut(self) -> "void":
    return _pywrapgraph.SimpleMaxFlow_GetSinkSideMinCut(self)
def GetSourceSideMinCut(self)
Source code
def GetSourceSideMinCut(self) -> "void":
    return _pywrapgraph.SimpleMaxFlow_GetSourceSideMinCut(self)
def Head(self, arc)
Source code
def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMaxFlow_Head(self, arc)
def NumArcs(self)
Source code
def NumArcs(self) -> "operations_research::ArcIndex":
    return _pywrapgraph.SimpleMaxFlow_NumArcs(self)
def NumNodes(self)
Source code
def NumNodes(self) -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMaxFlow_NumNodes(self)
def OptimalFlow(self)
Source code
def OptimalFlow(self) -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMaxFlow_OptimalFlow(self)
def SetArcCapacity(self, arc, capacity)
Source code
def SetArcCapacity(self, arc: 'operations_research::ArcIndex', capacity: 'operations_research::FlowQuantity') -> "void":
    return _pywrapgraph.SimpleMaxFlow_SetArcCapacity(self, arc, capacity)
def Solve(self, source, sink)
Source code
def Solve(self, source: 'operations_research::NodeIndex', sink: 'operations_research::NodeIndex') -> "operations_research::SimpleMaxFlow::Status":
    return _pywrapgraph.SimpleMaxFlow_Solve(self, source, sink)
def Tail(self, arc)
Source code
def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMaxFlow_Tail(self, arc)
class SimpleMinCostFlow
Source code
class SimpleMinCostFlow(MinCostFlowBase):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapgraph.SimpleMinCostFlow_swiginit(self, _pywrapgraph.new_SimpleMinCostFlow())

    def AddArcWithCapacityAndUnitCost(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity', unit_cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMinCostFlow_AddArcWithCapacityAndUnitCost(self, tail, head, capacity, unit_cost)

    def SetNodeSupply(self, node: 'operations_research::NodeIndex', supply: 'operations_research::FlowQuantity') -> "void":
        return _pywrapgraph.SimpleMinCostFlow_SetNodeSupply(self, node, supply)

    def Solve(self) -> "operations_research::MinCostFlowBase::Status":
        return _pywrapgraph.SimpleMinCostFlow_Solve(self)

    def SolveMaxFlowWithMinCost(self) -> "operations_research::MinCostFlowBase::Status":
        return _pywrapgraph.SimpleMinCostFlow_SolveMaxFlowWithMinCost(self)

    def OptimalCost(self) -> "operations_research::CostValue":
        return _pywrapgraph.SimpleMinCostFlow_OptimalCost(self)

    def MaximumFlow(self) -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_MaximumFlow(self)

    def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Flow(self, arc)

    def NumNodes(self) -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_NumNodes(self)

    def NumArcs(self) -> "operations_research::ArcIndex":
        return _pywrapgraph.SimpleMinCostFlow_NumArcs(self)

    def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_Tail(self, arc)

    def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
        return _pywrapgraph.SimpleMinCostFlow_Head(self, arc)

    def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Capacity(self, arc)

    def Supply(self, node: 'operations_research::NodeIndex') -> "operations_research::FlowQuantity":
        return _pywrapgraph.SimpleMinCostFlow_Supply(self, node)

    def UnitCost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
        return _pywrapgraph.SimpleMinCostFlow_UnitCost(self, arc)
    __swig_destroy__ = _pywrapgraph.delete_SimpleMinCostFlow

Ancestors

Methods

def AddArcWithCapacityAndUnitCost(self, tail, head, capacity, unit_cost)
Source code
def AddArcWithCapacityAndUnitCost(self, tail: 'operations_research::NodeIndex', head: 'operations_research::NodeIndex', capacity: 'operations_research::FlowQuantity', unit_cost: 'operations_research::CostValue') -> "operations_research::ArcIndex":
    return _pywrapgraph.SimpleMinCostFlow_AddArcWithCapacityAndUnitCost(self, tail, head, capacity, unit_cost)
def Capacity(self, arc)
Source code
def Capacity(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMinCostFlow_Capacity(self, arc)
def Flow(self, arc)
Source code
def Flow(self, arc: 'operations_research::ArcIndex') -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMinCostFlow_Flow(self, arc)
def Head(self, arc)
Source code
def Head(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMinCostFlow_Head(self, arc)
def MaximumFlow(self)
Source code
def MaximumFlow(self) -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMinCostFlow_MaximumFlow(self)
def NumArcs(self)
Source code
def NumArcs(self) -> "operations_research::ArcIndex":
    return _pywrapgraph.SimpleMinCostFlow_NumArcs(self)
def NumNodes(self)
Source code
def NumNodes(self) -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMinCostFlow_NumNodes(self)
def OptimalCost(self)
Source code
def OptimalCost(self) -> "operations_research::CostValue":
    return _pywrapgraph.SimpleMinCostFlow_OptimalCost(self)
def SetNodeSupply(self, node, supply)
Source code
def SetNodeSupply(self, node: 'operations_research::NodeIndex', supply: 'operations_research::FlowQuantity') -> "void":
    return _pywrapgraph.SimpleMinCostFlow_SetNodeSupply(self, node, supply)
def Solve(self)
Source code
def Solve(self) -> "operations_research::MinCostFlowBase::Status":
    return _pywrapgraph.SimpleMinCostFlow_Solve(self)
def SolveMaxFlowWithMinCost(self)
Source code
def SolveMaxFlowWithMinCost(self) -> "operations_research::MinCostFlowBase::Status":
    return _pywrapgraph.SimpleMinCostFlow_SolveMaxFlowWithMinCost(self)
def Supply(self, node)
Source code
def Supply(self, node: 'operations_research::NodeIndex') -> "operations_research::FlowQuantity":
    return _pywrapgraph.SimpleMinCostFlow_Supply(self, node)
def Tail(self, arc)
Source code
def Tail(self, arc: 'operations_research::ArcIndex') -> "operations_research::NodeIndex":
    return _pywrapgraph.SimpleMinCostFlow_Tail(self, arc)
def UnitCost(self, arc)
Source code
def UnitCost(self, arc: 'operations_research::ArcIndex') -> "operations_research::CostValue":
    return _pywrapgraph.SimpleMinCostFlow_UnitCost(self, arc)

Inherited members