Changeset 1081:f1398882a928 in lemon for test/min_cost_flow_test.cc

Ignore:
Timestamp:
08/08/11 12:36:16 (9 years ago)
Branch:
1.1
Phase:
public
Tags:
r1.1.4
Message:

Unify sources

File:
1 edited

Unmodified
Removed
• test/min_cost_flow_test.cc

 r716 * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2009 * Copyright (C) 2003-2011 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). "   11     0    0    0    0  -10    0\n" "   12   -20  -27    0  -30  -30  -20\n" "\n" "\n" "@arcs\n" "       cost  cap low1 low2 low3\n" void constraints() { checkConcept(); const Constraints& me = *this; typedef concepts::WriteMap FlowMap; typedef concepts::WriteMap PotMap; GR g; VAM lower; typename CM, typename SM, typename FM, typename PM > bool checkPotential( const GR& gr, const LM& lower, const UM& upper, const CM& cost, const SM& supply, const FM& flow, const CM& cost, const SM& supply, const FM& flow, const PM& pi, SupplyType type ) { (red_cost < 0 && flow[e] == upper[e]); } for (NodeIt n(gr); opt && n != INVALID; ++n) { typename SM::Value sum = 0; } } return opt; } } } for (NodeIt n(gr); n != INVALID; ++n) { dual_cost -= red_supply[n] * pi[n]; dual_cost -= (upper[a] - lower[a]) * std::max(-red_cost, 0); } return dual_cost == total; } .node("target", w) .run(); // Build test digraphs with negative costs Digraph neg_gr; Node n6 = neg_gr.addNode(); Node n7 = neg_gr.addNode(); Arc a1 = neg_gr.addArc(n1, n2); Arc a2 = neg_gr.addArc(n1, n3); Arc a8 = neg_gr.addArc(n6, n7); Arc a9 = neg_gr.addArc(n7, n5); Digraph::ArcMap neg_c(neg_gr), neg_l1(neg_gr, 0), neg_l2(neg_gr, 0); ConstMap neg_u1(std::numeric_limits::max()), neg_u2(5000); Digraph::NodeMap neg_s(neg_gr, 0); neg_l2[a7] =  1000; neg_l2[a8] = -1000; neg_s[n1] =  100; neg_s[n4] = -100; neg_c[a1] =  100; neg_c[a2] =   30; checkMcf(neg_mcf, neg_mcf.run(), neg_gr, neg_l2, neg_u1, neg_c, neg_s, neg_mcf.UNBOUNDED, false,    0, "#A18"); NetworkSimplex negs_mcf(negs_gr); negs_mcf.costMap(negs_c).supplyMap(negs_s);
Note: See TracChangeset for help on using the changeset viewer.