MCFI: Minimum Cost Flow Interpolation

Class Description

class paminco.algo.mcfi.MCFI(net: paminco.net.network.Network, name=None, callback=None, use_simple_timer: bool = True, optim=None, kw_optim=None, **kwargs)[source]

Minimum Cost Flow Interpolation.

Computes min costs flows for breakpoints. For parameters in-between the breakpoints, a min cost flow is then interpolated.

Parameters
netNetwork

Network to find min cost flows for. A min cost flow f for some param is found by:

minimize net.cost(f)
s.t. net.Gamma.dot(f) = net.demand(param).
namestr, optional

Name of solver.

callbackcallable, or list of callable, optional

Callbacks called during initialization and run method. Can be used for debugging and timing.

use_simple_timerbool, default=True

Whether to time MCFI. If True, timestamps for intializtion and every iteration will be saved to attribute timer.

kw_optimkeyword arguments, optional

Further arguments passed to min cost flow optimizer.

kwargskeyword arguments, optional

Further parameters for MCFI, see MCFIConfig.

See also

MCFIConfig

All settings for MCFI.

paminco.optim.fw_net.NetworkFW

Optimizer to find min cost flows for a given parameter.

Examples

Find user equilibrium (UE) for various specified demand factors:

>>> import paminco
>>> net = paminco.net.load_sioux()
>>> net.integrate_cost()  # integrate to calc UE
>>> mcfi = MCFI(net)
>>> demand_fac = [0.2, 0.5, 0.6]
>>> mcfi.run(param=demand_fac)
>>> mcfi.cost_at(demand_fac).round(2)
array([ 638722.63, 1673514.68, 2062773.13])
Attributes
configMCFIConfig

Settings of MCFI.

networkNetwork

Get network obj.

namestr

Get name of object.

param_solutionParametricSolution

Get ParametricSolution object.

Settings

MCFIConfig(**kw)

Settings for the Marginal Cost Flow Interpolator.

AdaptiveMethod(value)

Enum defining the step rule used in the MCFI algorithm.

Attributes

MCFI.network

Get network obj.

MCFI.name

Get name of object.

MCFI.config

Settings of MCFI.

MCFI.param_solution

Get ParametricSolution object.

Methods

MCFI.run([param, callback, kw_optim])

Run MCFI.