C++ Reference: class GenericMaxFlow
Note: This documentation is automatically generated.
Method | |
---|---|
AugmentingPathExists | Return type: Returns true if there exists a path from the source to the sink with remaining capacity. This allows us to easily check at the end that the flow we computed is indeed optimal (provided that all the conditions tested by CheckResult() also hold). |
Capacity | Return type: Arguments: Returns the capacity of arc using the equations given in the comment on residual_arc_capacity_. |
CheckInputConsistency | Return type: Checks the consistency of the input, i.e. that capacities on the arcs are non-negative or null. |
CheckResult | Return type: Checks whether the result is valid, i.e. that node excesses are all equal to zero (we have a flow) and that residual capacities are all non-negative or zero. |
CreateFlowModel | Return type: Returns the protocol buffer representation of the current problem. |
Flow | Return type: Arguments: Returns the flow on arc using the equations given in the comment on residual_arc_capacity_. |
GenericMaxFlow | Arguments: Initialize a MaxFlow instance on the given graph. The graph does not need to be fully built yet, but its capacity reservation are used to initialize the memory of this class. source and sink must also be valid node of graph. |
~GenericMaxFlow | Return type: |
GetOptimalFlow | Return type: Returns the total flow found by the algorithm. |
GetSinkNodeIndex | Return type: Returns the index of the node corresponding to the sink of the network. |
GetSinkSideMinCut | Return type: Arguments: Returns the nodes that can reach the sink in the residual graph, the outgoing arcs of this set form a minimum cut. Note that if this is the complement of GetNodeReachableFromSource(), then the min-cut is unique. TODO(user): In the two-phases algorithm, we can get this minimum cut without doing the second phase. Add an option for this if there is a need to, note that the second phase is pretty fast so the gain will be small. |
GetSourceNodeIndex | Return type: Returns the index of the node corresponding to the source of the network. |
GetSourceSideMinCut | Return type: Arguments: Returns the nodes reachable from the source in the residual graph, the outgoing arcs of this set form a minimum cut. |
graph | Return type: Returns the graph associated to the current object. |
ProcessNodeByHeight | Return type: Arguments: |
SetArcCapacity | Return type: Arguments: Sets the capacity for arc to new_capacity. |
SetArcFlow | Return type: Arguments: Sets the flow for arc. |
SetCheckInput | Return type: Arguments: |
SetCheckResult | Return type: Arguments: |
SetUseGlobalUpdate | Return type: Arguments: Sets the different algorithm options. All default to true. See the corresponding variable declaration below for more details. |
SetUseTwoPhaseAlgorithm | Return type: Arguments: |
Solve | Return type: Returns true if a maximum flow was solved. |
status | Return type: Returns the status of last call to Solve(). NOT_SOLVED is returned if Solve() has never been called or if the problem has been modified in such a way that the previous solution becomes invalid. |