public void augment(Edge[] path) {
        // find the bottleneck capacity delta on path P
        float delta = Float.MAX_VALUE;
        for (int i = 0; i < path.length; i++) {
            float tempWeight = path[i].getWeight();
            if (tempWeight < delta) {
                delta = tempWeight;
            }
        }

        // update the residual graph by pushing Delta flow through the path P
        for (int i = 0; i < path.length; i++) {
            Edge edge = path[i];
            edge.setWeight(edge.getWeight() - delta);

            Edge residualEdge = graph.getEdge(edge.getTarget(), edge.getSource());
            if (residualEdge == null) {
                residualEdge = new Edge(edge.getTarget(), edge.getSource(), delta);
                graph.addEdge(residualEdge);
            }
            else {
                residualEdge.setWeight(residualEdge.getWeight() + delta);
            }

            if (edge.getWeight() <= 0) {
                Vertex p = edge.getSource();
                Vertex q = edge.getTarget();

                if (tree(p) == S && tree(q) == S) {
                    q.setParent(null);
                    orphans.add(q);
                }
                if (tree(p) == T && tree(q) == T) {
                    p.setParent(null);
                    orphans.add(p);
                }
            }
        }
    }