Scilab function

max_flow - maximum flow between two nodes

Calling Sequence

[v,phi,flag] = max_flow(i,j,g)

Parameters

Description

max_flow returns the value of maximum flow v from node number i to node number j if it exists, and the value of the flow on each arc as a row vector phi. All the computations are made with integer numbers. The graph must be directed. If the problem is not feasible, flag is equal to 0, otherwise it is equal to 1.

The bounds of the flow are given by the elements edge_min_cap and edge_max_cap of the graph list. The value of the maximum capacity must be greater than or equal to the value of the minimum capacity. If the value of edge_min_cap or edge_max_cap is not given (empty row vector []), it is assumed to be equal to 0 on each edge.

Examples