Delivery - Data input from file; infeasibility analysis
|
|
Type: | Network flow |
Rating: | 2 |
Description: | A simple supply and demand network example showing data input from file and the use of "views": incremental definition of arrays of variables. Also uses constraint templates with the arrays of variables. A second version of this model (file xbdlvriis) has modified data making the problem infeasible. This example shows how to analyze infeasibility with the help of IIS (irreducible infeasible sets), it retrieves the IIS and prints out their contents. It is possible to retrieve more detailed information on the IIS, such as isolation rows or bounds, using Xpress Optimizer functions (file xbdlvriis2iso) or to use the infeasibility repair functionality of the Optimizer (file xbdlvriis2rep) with models defined in BCL. |
File(s): | xbdelvr.cs |
Data file(s): | ifvan.dat, cost.dat |
|
xbdelvr.cs |
/******************************************************** Xpress-BCL C# Example Problems ============================== file xbdelvr.cs ```````````````` Transportation problem. (c) 2008 Fair Isaac Corporation authors: S.Heipcke, D.Brett. ********************************************************/ using System; using System.Text; using System.IO; using BCL; namespace Examples { public class TestIntroDelivery { const int NSupp = 10; /* Number of suppliers */ const int NCust = 7; /* Number of customers */ const int MaxArcs = 100; /* Max. num. of non-zero cost values */ //Define XPRBDATAPATH to point where you wish. const string XPRBDATAPATH = "../../data"; const string VANFILE = XPRBDATAPATH + "/delivery/ifvan.dat"; /* Van data file */ const string COSTFILE = XPRBDATAPATH + "/delivery/cost.dat"; /* Cost data file */ /****DATA****/ /* Supplier: London Luton B'ham Bristl Derby Stckpt York */ double[] SUPPLY = {140.0, 600.0, 50.0, 10.0, 400.0, 200.0, 20.0, /* Supplier: Derby Soton Scnthp */ 90.0, 30.0, 12.0}; /* Customer: London Livpol Doncst York Hull Manchr Shffld */ double[] DEMAND = {123.3, 56.4, 17.1, 192.8, 310.0, 47.0, 86.0}; double[,] COST = new double[NSupp,NCust]; /* Cost per supplier-customer pair */ double[,] IFVAN = new double[NSupp,NCust]; /* Non-zero if route uses vans instead of lorries */ double VANCAP=40.0; /* Capacity on routes that use vans */ XPRBprob p = new XPRBprob("Delivery"); /* Initialize a new problem in BCL */ /***********************************************************************/ void modDelivery() { XPRBexpr lobj, lc; int s,c; XPRBvar[,] x = new XPRBvar[NSupp,NCust]; /****VARIABLES****/ for(s=0;s |