/******************************************************** Xpress-BCL Java Example Problems ================================ file xbdlvriis2iso.java ``````````````````````` Transportation problem (infeasible data). Retrieving and printing IIS. - Using Optimizer functions to retrieve detailed IIS information including isolation rows/bounds - (c) 2008 Fair Isaac Corporation author: S.Heipcke, Jan. 2008, rev. Mar. 2011 ********************************************************/ import java.io.*; import java.util.*; import java.text.DecimalFormat; import com.dashoptimization.*; public class xbdlvriis2iso { static final int NSupp = 10; /* Number of suppliers */ static final int NCust = 7; /* Number of customers */ static final int MaxArcs = 100; /* Max. num. of non-zero cost values */ static final String VANFILE = System.getProperty("XPRBDATA") + "/delivery/ifvan.dat"; static final String COSTFILE = System.getProperty("XPRBDATA") + "/delivery/cost.dat"; /****DATA****/ /* Supplier: London Luton B'ham Bristl Derby Stckpt */ static final double SUPPLY[] = {140.0, 200.0, 50.0, 10.0, 400.0, 200.0, /* Supplier: York Derby Soton Scnthp */ 20.0, 90.0, 30.0, 12}; /* Customer: London Livpol Doncst York Hull Manchr */ static final double DEMAND[] = {1230.3, 560.4, 117.1, 592.8, 310.0, 1247.0, /* Customer: Shffld */ 86}; static double[][] COST; /* Cost per supplier-customer pair */ static double[][] IFVAN; /* Non-zero if route uses vans instead of lorries */ static final double VANCAP=40; /* Capacity on routes that use vans */ static XPRB bcl; static XPRBprob p; static XPRSprob op; private static DecimalFormat form = new DecimalFormat ("####.0"); /***********************************************************************/ static void modDelivery() { XPRBexpr lobj, lc; int s,c,i; XPRBvar[][] x; XPRBctr[] CSupply, CDemand; int numv, numc, numiis, ncol, nrow; IntHolder inumv, inumc, inumiis; int[] viis, ciis; double[] duals, rdcs, bnd, rhs; byte[] ctrtype, bndtype, isolationrows, isolationbnds; java.lang.String[] cnames, vnames; java.lang.String isotype[] = {"N/A", "No ", "Yes"}; bcl = new XPRB(); /* Initialize BCL */ p = bcl.newProb("Delivery"); /* Create a new problem in BCL */ XPRS.init(); /* Initialize Xpress-Optimizer */ /****VARIABLES****/ x = new XPRBvar[NSupp][NCust]; for(s=0;s0) { /* Print all variables in the IIS */ bnd = new double[1]; for(i=0;i0) { /* Print all constraints in the IIS */ rhs = new double[1]; for(i=0;i