object
piecewise_costs(Dictionary)
Dictionary- Dictionary object used by the expanded flow network (e.g.,avltree).
Builds ordinary flow networks that model convex piecewise-linear integer arc costs by expanding each cost segment into a linear-cost arc. The returned mapping is opaque and records the public vertices and arcs of the expanded network.
logtalk_load(flow_networks(loader))static, context_switching_callsPublic predicates
build/4
Expands convex cost arcs arc(From, To, Lower, Segments) where each segment is segment(Width, MarginalCost). Widths are positive integers and marginal costs are nondecreasing integers; the original cost at flow amount X is the sum of the marginal costs of its first X units, with cost zero at amount zero. Each expanded arc receives the lower-bound portion of the original flow in segment order. The opaque mapping records a ground public network snapshot (vertices and arcs), and preserves original arc and segment order.
staticbuild(Vertices,CostArcs,Network,Mapping)build(+list(ground),+list(compound),-compound,-compound) - one_or_errorinstantiation_errortype_error(list,Input)arc/4 term:domain_error(piecewise_cost_arc,Arc)segment/2 term:domain_error(piecewise_cost_segment,Segment)type_error(integer,Lower)domain_error(non_negative_integer,Lower)consistency_error(piecewise_lower_bound_and_capacity,Lower,Capacity)type_error(integer,Width)domain_error(positive_integer,Width)type_error(integer,MarginalCost)domain_error(non_decreasing_marginal_costs,Segments)domain_error(non_empty_list,Segments)collapse_flow/4
Projects a capacity-valid flow on the expanded network to original flow(ArcId, From, To, Amount) entries, omitting zero flows. Rejects a noncanonical segment allocation when a more expensive segment carries optional flow while a cheaper segment has unused capacity. Arbitrary distribution across equal-cost segments is accepted. The original convex arcs are not themselves a core flow network.
staticcollapse_flow(Network,Mapping,ExpandedFlow,Flow)collapse_flow(+compound,+compound,+list(compound),-list(compound)) - one_or_errorinstantiation_errordomain_error(piecewise_cost_mapping,Mapping)consistency_error(piecewise_mapping_network,Snapshot,MappedSnapshot)instantiation_errortype_error(list,ExpandedFlow)domain_error(flow,Term)type_error(integer,Value)domain_error(positive_integer,Value)existence_error(arc,ArcId)domain_error(flow_arc_endpoints,Term)domain_error(capacity_valid_flow,ExpandedFlow)domain_error(canonical_piecewise_flow,ExpandedFlow)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)