# Path: pyalgs/algorithms/commons/util.py
# def less(a, b):
# def greater(a, b):
# def cmp(a, b):
# def exchange(a, i, j):
# def is_sorted(a):
# 
# Path: pyalgs/data_structures/commons/bag.py
# class Bag(object):
#     def __init__(self):
#         self.stack = Stack.create()
# 
#     def add(self, item):
#         self.stack.push(item)
# 
#     def size(self):
#         return self.stack.size()
# 
#     def is_empty(self):
#         return self.stack.is_empty()
# 
#     def iterate(self):
#         return self.stack.iterate()
# 
#     @staticmethod
#     def create():
#         return Bag()


from pyalgs.algorithms.commons import util
from pyalgs.data_structures.commons.bag import Bag
            self.flow += delta
        else:
            raise ValueError('end point not belong to flow edge')

    def start(self):
        return self.v

    def end(self):
        return self.w

    def other(self, x):
        if x == self.v:
            return self.w
        else:
            return self.v

    def __str__(self):
        return str(self.v) + ' =(' + str(self.capacity) + ', ' + str(self.flow) + ')=> ' + str(self.w)


class FlowNetwork(object):

    V = None
    adjList = None

    def __init__(self, V):
        self.V = V
        self.adjList = [None] * V

        for v in range(self.V):

# Path: pyalgs/algorithms/commons/util.py
# def less(a, b):
# def greater(a, b):
# def cmp(a, b):
# def exchange(a, i, j):
# def is_sorted(a):
# 
# Path: pyalgs/data_structures/commons/bag.py
# class Bag(object):
#     def __init__(self):
#         self.stack = Stack.create()
# 
#     def add(self, item):
#         self.stack.push(item)
# 
#     def size(self):
#         return self.stack.size()
# 
#     def is_empty(self):
#         return self.stack.is_empty()
# 
#     def iterate(self):
#         return self.stack.iterate()
# 
#     @staticmethod
#     def create():
#         return Bag()


# Path: pyalgs/data_structures/graphs/graph.py
from pyalgs.algorithms.commons import util
from pyalgs.data_structures.commons.bag import Bag

            self.flow += delta
        else:
            raise ValueError('end point not belong to flow edge')

    def start(self):
        return self.v

    def end(self):
        return self.w

    def other(self, x):
        if x == self.v:
            return self.w
        else:
            return self.v

    def __str__(self):
        return str(self.v) + ' =(' + str(self.capacity) + ', ' + str(self.flow) + ')=> ' + str(self.w)


class FlowNetwork(object):

    V = None
    adjList = None

    def __init__(self, V):
        self.V = V
        self.adjList = [None] * V

        for v in range(self.V):

            self.adjList[v] = Bag()