# Path: pyalgs/data_structures/commons/queue.py
# class Queue(object):
#     """ Queue interface
#     
#     """
# 
#     __metaclass__ = ABCMeta
# 
#     @abstractmethod
#     def enqueue(self, item):
#         pass
# 
#     @abstractmethod
#     def dequeue(self):
#         pass
# 
#     @abstractmethod
#     def is_empty(self):
#         pass
# 
#     @abstractmethod
#     def size(self):
#         pass
# 
#     @staticmethod
#     def create():
#         return LinkedListQueue()
# 
#     @abstractmethod
#     def iterate(self):
#         pass


from pyalgs.data_structures.commons.queue import Queue
    marked = None
    s = None
    t = None
    value = 0.0
    network = None

    def __init__(self, network, s, t):
        self.s = s
        self.t = t
        self.network = network
        self.value = 0.0
        while self.has_augmenting_path():
            x = self.t
            bottle = float('inf')
            while x != self.s:
                bottle = min(bottle, self.edgeTo[x].residual_capacity_to(x))
                x = self.edgeTo[x].other(x)

            x = self.t
            while x != self.s:
                self.edgeTo[x].add_residual_flow_to(x, bottle)
                x = self.edgeTo[x].other(x)

            self.value += bottle

    def has_augmenting_path(self):
        vertex_count = self.network.vertex_count()
        self.edgeTo = [None] * vertex_count
        self.marked = [False] * vertex_count


# Path: pyalgs/data_structures/commons/queue.py
# class Queue(object):
#     """ Queue interface
#     
#     """
# 
#     __metaclass__ = ABCMeta
# 
#     @abstractmethod
#     def enqueue(self, item):
#         pass
# 
#     @abstractmethod
#     def dequeue(self):
#         pass
# 
#     @abstractmethod
#     def is_empty(self):
#         pass
# 
#     @abstractmethod
#     def size(self):
#         pass
# 
#     @staticmethod
#     def create():
#         return LinkedListQueue()
# 
#     @abstractmethod
#     def iterate(self):
#         pass


# Path: pyalgs/algorithms/graphs/max_flow.py
from pyalgs.data_structures.commons.queue import Queue

    marked = None
    s = None
    t = None
    value = 0.0
    network = None

    def __init__(self, network, s, t):
        self.s = s
        self.t = t
        self.network = network
        self.value = 0.0
        while self.has_augmenting_path():
            x = self.t
            bottle = float('inf')
            while x != self.s:
                bottle = min(bottle, self.edgeTo[x].residual_capacity_to(x))
                x = self.edgeTo[x].other(x)

            x = self.t
            while x != self.s:
                self.edgeTo[x].add_residual_flow_to(x, bottle)
                x = self.edgeTo[x].other(x)

            self.value += bottle

    def has_augmenting_path(self):
        vertex_count = self.network.vertex_count()
        self.edgeTo = [None] * vertex_count
        self.marked = [False] * vertex_count


        queue = Queue.create()