| 457 | // C. Test CapacityScaling |
| 458 | { |
| 459 | CapacityScaling<Digraph> mcf(gr); |
| 460 | |
| 461 | // Check the equality form |
| 462 | mcf.upperMap(u).costMap(c); |
| 463 | checkMcf(mcf, mcf.supplyMap(s1).run(), |
| 464 | gr, l1, u, c, s1, mcf.OPTIMAL, true, 5240, "#C1"); |
| 465 | checkMcf(mcf, mcf.stSupply(v, w, 27).run(), |
| 466 | gr, l1, u, c, s2, mcf.OPTIMAL, true, 7620, "#C2"); |
| 467 | mcf.lowerMap(l2); |
| 468 | checkMcf(mcf, mcf.supplyMap(s1).run(), |
| 469 | gr, l2, u, c, s1, mcf.OPTIMAL, true, 5970, "#C3"); |
| 470 | checkMcf(mcf, mcf.stSupply(v, w, 27).run(), |
| 471 | gr, l2, u, c, s2, mcf.OPTIMAL, true, 8010, "#C4"); |
| 472 | mcf.reset(); |
| 473 | checkMcf(mcf, mcf.supplyMap(s1).run(), |
| 474 | gr, l1, cu, cc, s1, mcf.OPTIMAL, true, 74, "#C5"); |
| 475 | |
| 476 | checkMcf(mcf, mcf.lowerMap(l2).stSupply(v, w, 27).run(), |
| 477 | gr, l2, cu, cc, s2, mcf.OPTIMAL, true, 94, "#C6"); |
| 478 | mcf.reset(); |
| 479 | checkMcf(mcf, mcf.run(), |
| 480 | gr, l1, cu, cc, s3, mcf.OPTIMAL, true, 0, "#C7"); |
| 481 | checkMcf(mcf, mcf.lowerMap(l2).upperMap(u).run(), |
| 482 | gr, l2, u, cc, s3, mcf.INFEASIBLE, false, 0, "#C8"); |
| 483 | mcf.reset().lowerMap(l3).upperMap(u).costMap(c).supplyMap(s4); |
| 484 | checkMcf(mcf, mcf.run(), |
| 485 | gr, l3, u, c, s4, mcf.OPTIMAL, true, 6360, "#C9"); |
| 486 | mcf.reset(); |
| 487 | checkMcf(mcf, mcf.run(false), |
| 488 | gr, l1, cu, cc, s3, mcf.OPTIMAL, true, 0, "#C10"); |
| 489 | checkMcf(mcf, mcf.lowerMap(l2).upperMap(u).run(false), |
| 490 | gr, l2, u, cc, s3, mcf.INFEASIBLE, false, 0, "#C11"); |
| 491 | mcf.reset().lowerMap(l3).upperMap(u).costMap(c).supplyMap(s4); |
| 492 | checkMcf(mcf, mcf.run(false), |
| 493 | gr, l3, u, c, s4, mcf.OPTIMAL, true, 6360, "#C12"); |
| 494 | |
| 495 | // Check the GEQ form |
| 496 | mcf.reset().upperMap(u).costMap(c).supplyMap(s5); |
| 497 | checkMcf(mcf, mcf.run(), |
| 498 | gr, l1, u, c, s5, mcf.OPTIMAL, true, 3530, "#C13", GEQ); |
| 499 | checkMcf(mcf, mcf.lowerMap(l2).run(), |
| 500 | gr, l2, u, c, s5, mcf.OPTIMAL, true, 4540, "#C14", GEQ); |
| 501 | mcf.supplyMap(s6); |
| 502 | checkMcf(mcf, mcf.run(), |
| 503 | gr, l2, u, c, s6, mcf.INFEASIBLE, false, 0, "#C15", GEQ); |
| 504 | } |
| 505 | |