# C++ Reference: class GenericMinCostFlow

Note: This documentation is automatically generated.

Method | |
---|---|

`Capacity` | Return type: Arguments: Returns the capacity of the given arc. |

`CheckFeasibility` | Return type: Arguments: Checks for feasibility, i.e., that all the supplies and demands can be matched without exceeding bottlenecks in the network. If infeasible_supply_node (resp. infeasible_demand_node) are not NULL, they are populated with the indices of the nodes where the initial supplies (resp. demands) are too large. Feasible values for the supplies and demands are accessible through FeasibleSupply. Note that CheckFeasibility is called by Solve() when the flag min_cost_flow_check_feasibility is set to true (which is the default.) |

`FeasibleSupply` | Return type: Arguments: Returns the largest supply (if > 0) or largest demand in absolute value (if < 0) admissible at node. If the problem is not feasible, some of these values will be smaller (in absolute value) than the initial supplies and demand given as input. |

`Flow` | Return type: Arguments: Returns the flow on the given arc using the equations given in the comment on residual_arc_capacity_. |

`GenericMinCostFlow` | Return type: Arguments: Initialize a MinCostFlow instance on the given graph. The graph does not need to be fully built yet, but its capacity reservation is used to initialize the memory of this class. |

`GetOptimalCost` | Return type: Returns the cost of the minimum-cost flow found by the algorithm. |

`graph` | Return type: Returns the graph associated to the current object. |

`InitialSupply` | Return type: Arguments: Returns the initial supply at a given node. |

`MakeFeasible` | Return type: Makes the min-cost flow problem solvable by truncating supplies and demands to a level acceptable by the network. There may be several ways to do it. In our case, the levels are computed from the result of the max-flow algorithm run in CheckFeasibility(). MakeFeasible returns false if CheckFeasibility() was not called before. |

`SetArcCapacity` | Return type: Arguments: Sets the capacity for the given arc. |

`SetArcFlow` | Return type: Arguments: Sets the flow for the given arc. Note that new_flow must be smaller than the capacity of the arc. |

`SetArcUnitCost` | Return type: Arguments: Sets the unit cost for the given arc. |

`SetCheckFeasibility` | Return type: Arguments: Whether to check the feasibility of the problem with a max-flow, prior to solving it. This uses about twice as much memory, but detects infeasible problems (where the flow can't be satisfied) and makes Solve() return INFEASIBLE. If you disable this check, you will spare memory but you must make sure that your problem is feasible, otherwise the code can loop forever. |

`SetNodeSupply` | Return type: Arguments: Sets the supply corresponding to node. A demand is modeled as a negative supply. |

`SetUseUpdatePrices` | Return type: Arguments: Whether to use the UpdatePrices() heuristic. |

`Solve` | Return type: Solves the problem, returning true if a min-cost flow could be found. |

`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. |

`Supply` | Return type: Arguments: Returns the supply at a given node. Demands are modelled as negative supplies. |

`UnitCost` | Return type: Arguments: Returns the unscaled cost for the given arc. |