-
Notifications
You must be signed in to change notification settings - Fork 167
Description
In both message_ix and ixmp, we use a linear programming (LP) problem from Dantzig (1963) for a simple test case. In the course of working on #451 (comment), I found that our implementation is not faithful to the original.
Specifically:
- The original report is available at https://www.rand.org/pubs/reports/R366.html. See Chapter 3 "Formulating a Linear Programming Model", Section 3-3 "A Transportation Problem", pp.35–41 (PDF pages 50–56).
- The text reads, in part:
Cases available: 350 at Cannery I, 650 at Cannery II = 1000 total available
Cases demanded: 300 at Warehouse A, 300 at Warehouse B, 300 at Warehouse C = 900 total required
The excess production (100 cases) should be stored without shipment.
- We have the following numbers which do not match:
message_ix/message_ix/testing/__init__.py
Lines 410 to 426 in 9fb0b97
par["demand"] = make_df( "demand", **common, node=["new-york", "chicago", "topeka"], level="consumption", value=[325, 300, 275], unit="case", ) par["bound_activity_up"] = make_df( "bound_activity_up", **common, node_loc=["seattle", "san-diego"], mode="production", technology="canning_plant", value=[350, 600], unit="case", )
andmessage_ix/message_ix/tests/test_feature_bound_activity_shares.py
Lines 46 to 53 in 9fb0b97
["seattle", "production", 350.0, 350.0], ["seattle", "to_new-york", 50.0, 0.0], ["seattle", "to_chicago", 300.0, 300.0], ["seattle", "to_topeka", 0.0, 0.0], ["san-diego", "production", 600.0, 600.0], ["san-diego", "to_new-york", 275.0, 325.0], ["san-diego", "to_chicago", 0.0, 0.0], ["san-diego", "to_topeka", 275.0, 275.0],
One consequence of this—as described in the linked comment—is that the problem does not have a unique solution. In #451 (possibly other PRs that change the GAMS code) this causes difficulty because the solver chooses a different solution with the same objective function value.
IMO there is no reason we can't adjust make_dantzig() to (a) align with the original statement of the problem and (b) have a single, unique solution. However, to do this may also require adjustments to expectations wherever this is used across our test suite (many places). #451 will contain adjustments narrowly focused on that PR, but I open this issue towards a general fix.