callrelax: Solve Network Flow Problem using External Solver

callrelaxR Documentation

Solve Network Flow Problem using External Solver

Description

Solves network flow optimization problems by calling an external solver, either the Lemon Optimization library or the RELAX-IV algorithm, as implemented in FORTRAN by Dimitri Bertsekas and Paul Tseng.

IMPORTANT NOTE 1: the RELAX-IV code is bound by an academic license; as a result the rrelaxiv package implementing it is not available on CRAN and must be downloaded separately.

Usage

callrelax(net, solver = 'rlemon')

Arguments

net

a network flow problem, formatted as a list with the following arguments (where the network contains nnode nodes, numbered 1 through nnode and narc arcs):

  • startn: a vector of length narc containing the node numbers of the start nodes of each arc in the network.

  • endn: a vector of length narc containing the node numbers of the end nodes of each arc in the network.

  • ucap: a vector of length narc containing the (integer) upper capacity of each arc in the network.

  • cost: a vector of length narc containing the (integer) cost of each arc in the network.

  • b: a vector of length nnode containing the (integer) supply or demand of each node in the network. Supplies are given as positive numbers and demands as negative numbers.

solver

the name of the package used to solve the network flow optimization problem underlying the match, one of 'rlemon' (which uses the Lemon Optimization Library) and 'rrelaxiv' (which uses the RELAX-IV algorithm).

Value

A list with the following elements:

crash

an integer equal to zero (included in order to support legacy versions of code).

feasible

an integer, equal to zero if the problem is infeasible and equal to 1 if it is feasible. A network with a supply/demand vector of all zeroes may also be flagged as infeasible.

x

a vector equal in length to the number of arcs in argument problem net, giving in each coordinate the number of units of flow passing across the corresponding edge in the optimal network flow.

Author(s)

Samuel D. Pimentel


rcbalance documentation built on March 26, 2022, 1:07 a.m.