/******************************************************** BCL Example Problems ==================== file xbdlvriis.c ```````````````` Transportation problem (infeasible data). Retrieving and printing IIS. (c) 2008 Fair Isaac Corporation author: S.Heipcke, 2005, rev. Mar. 2011 ********************************************************/ #include #include #include "xprb.h" #define NSupp 10 /* Number of suppliers */ #define NCust 7 /* Number of customers */ #define MaxArcs 100 /* Max. num. of non-zero cost values */ #define VANFILE XPRBDATAPATH "/delivery/ifvan.dat" /* Van data file */ #define COSTFILE XPRBDATAPATH "/delivery/cost.dat" /* Cost data file */ /****DATA****/ /* Supplier: London Luton B'ham Bristl Derby Stckpt York */ double SUPPLY[] = {140.0, 200.0, 50.0, 10.0, 400.0, 200.0, 20.0, /* Supplier: Derby Soton Scnthp */ 90.0, 30.0, 12}; /* Customer: London Livpol Doncst York Hull Manchr Shffld */ double DEMAND[] = {1230.3, 560.4, 117.1, 592.8, 310.0, 1247.0, 86}; double COST[NSupp][NCust]; /* Cost per supplier-customer pair */ double IFVAN[NSupp][NCust]; /* Non-zero if route uses vans instead of lorries */ double VANCAP=40; /* Capacity on routes that use vans */ /***********************************************************************/ void moddelivery(XPRBprob prob) { XPRBctr ctr; int s,c,i; XPRBvar x[NSupp][NCust]; XPRBctr *iisctr; XPRBvar *iisvar; int numv, numc, numiis, ct; /****VARIABLES****/ for(s=0;s0) { /* Print all variables in the IIS */ printf(" Variables: "); for(i=0;i0) { /* Print all constraints in the IIS */ printf(" Constraints: "); for(i=0;i0) { if(ct>0) printf("IIS %d: %d variables, %d constraints\n", ct, numv, numc); ct++; XPRBgetiis(prob, NULL, &numv, NULL, &numc, ct); } /* Retrieve variables only */ for(s=1;s<=numiis;s++) { XPRBgetiis(prob, &iisvar, &numv, NULL, NULL, s); printf("IIS %d: %d variables ( ", s, numv); if (numv>0) { for(i=0;i0) { for(i=0;i