int Dev = 30;// Deviation
extern const int CNN = 5;// Case Index
extern const int P = 3;// Number of phases
extern const int PT = 6;// Number of periods in a phase
extern const int T = 18;// Number of periods
extern const int I1 =1;// Number of suppliers
extern const int I2 = 8;// Number of customers
extern const int I = 9;// Number of sites
extern const int BN = 72;//Number of bids
extern const int LBN = 9;//Number of bids on each arc
extern const int SPN = 345;//Number of shipments
extern const int SN = 20;//Number of scenarios at each stage
extern const int MBSN = 9;//Number of shipments in a bid
// tree parameters:
double PRO[P][SN]={{0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05},{0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05},{0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05}}; // the probability of each scenario at each phase 
// timing parameters: 
int PTN[P]={6,6,6}; // number of periods in each phase 
int PTset[P][PT]={{0,1,2,3,4,5},{6,7,8,9,10,11},{12,13,14,15,16,17}}; // set of periods in each phase 
// distribution parameters: 
int sup[I][P][SN][PT]={{{{12581,0,0,0,0,0},{12032,0,0,0,0,0},{13152,0,0,0,0,0},{12646,0,0,0,0,0},{12464,0,0,0,0,0},{12907,0,0,0,0,0},{12187,0,0,0,0,0},{12365,0,0,0,0,0},{12565,0,0,0,0,0},{11986,0,0,0,0,0},{12313,0,0,0,0,0},{12460,0,0,0,0,0},{13083,0,0,0,0,0},{12373,0,0,0,0,0},{12606,0,0,0,0,0},{12795,0,0,0,0,0},{13084,0,0,0,0,0},{12128,0,0,0,0,0},{12956,0,0,0,0,0},{12628,0,0,0,0,0}},{{12531,0,0,0,0,0},{11995,0,0,0,0,0},{12610,0,0,0,0,0},{12603,0,0,0,0,0},{12392,0,0,0,0,0},{11910,0,0,0,0,0},{12104,0,0,0,0,0},{12665,0,0,0,0,0},{12687,0,0,0,0,0},{12285,0,0,0,0,0},{12449,0,0,0,0,0},{12178,0,0,0,0,0},{12113,0,0,0,0,0},{13079,0,0,0,0,0},{12461,0,0,0,0,0},{12519,0,0,0,0,0},{12449,0,0,0,0,0},{11890,0,0,0,0,0},{12556,0,0,0,0,0},{12450,0,0,0,0,0}},{{12012,0,0,0,0,0},{11853,0,0,0,0,0},{11278,0,0,0,0,0},{10977,0,0,0,0,0},{11334,0,0,0,0,0},{11730,0,0,0,0,0},{11184,0,0,0,0,0},{12021,0,0,0,0,0},{11815,0,0,0,0,0},{11967,0,0,0,0,0},{11632,0,0,0,0,0},{11544,0,0,0,0,0},{11936,0,0,0,0,0},{11566,0,0,0,0,0},{11719,0,0,0,0,0},{12028,0,0,0,0,0},{11839,0,0,0,0,0},{11810,0,0,0,0,0},{11595,0,0,0,0,0},{11737,0,0,0,0,0}}},{{{-356,-250,-341,-212,-353,-344},{-244,-356,-335,-232,-359,-303},{-379,-288,-356,-309,-244,-320},{-270,-244,-315,-265,-344,-262},{-276,-320,-306,-279,-273,-206},{-262,-218,-341,-282,-344,-282},{-338,-353,-265,-382,-209,-265},{-279,-368,-215,-259,-356,-353},{-353,-347,-276,-238,-226,-344},{-291,-306,-332,-259,-259,-309},{-368,-244,-344,-323,-312,-253},{-279,-370,-300,-323,-303,-338},{-376,-323,-318,-300,-344,-220},{-212,-223,-309,-303,-232,-368},{-326,-232,-276,-320,-294,-226},{-250,-379,-282,-373,-312,-312},{-329,-329,-288,-291,-344,-209},{-359,-218,-335,-232,-244,-347},{-212,-323,-329,-350,-356,-347},{-270,-250,-373,-215,-315,-338}},{{-264,-220,-277,-332,-198,-308},{-212,-323,-342,-293,-208,-303},{-209,-326,-361,-332,-206,-202},{-316,-214,-353,-195,-219,-295},{-348,-300,-266,-345,-254,-223},{-302,-252,-230,-249,-275,-277},{-316,-352,-260,-271,-334,-225},{-313,-289,-364,-219,-190,-249},{-345,-295,-319,-249,-328,-272},{-212,-343,-314,-326,-334,-210},{-377,-232,-274,-249,-203,-228},{-362,-289,-213,-203,-198,-238},{-296,-232,-286,-195,-334,-306},{-278,-249,-311,-356,-310,-316},{-296,-252,-210,-279,-203,-236},{-252,-255,-244,-222,-291,-246},{-307,-283,-252,-348,-254,-189},{-270,-372,-358,-233,-243,-277},{-252,-372,-328,-195,-310,-311},{-284,-317,-311,-312,-230,-275}},{{-178,-310,-266,-195,-270,-237},{-290,-237,-210,-280,-165,-235},{-302,-227,-170,-269,-248,-198},{-192,-174,-249,-179,-214,-157},{-178,-244,-247,-190,-276,-218},{-248,-269,-256,-175,-240,-245},{-262,-235,-184,-204,-171,-214},{-240,-223,-221,-260,-265,-154},{-200,-225,-238,-240,-255,-181},{-275,-242,-291,-278,-227,-181},{-295,-302,-193,-170,-235,-161},{-305,-201,-207,-188,-197,-262},{-240,-254,-284,-206,-201,-229},{-238,-269,-235,-204,-246,-163},{-255,-315,-287,-175,-229,-179},{-235,-264,-298,-170,-208,-208},{-278,-257,-296,-186,-229,-204},{-325,-237,-168,-267,-169,-144},{-208,-312,-296,-177,-227,-200},{-285,-300,-301,-172,-250,-229}}},{{{-175,-159,-180,-141,-131,-212},{-121,-145,-147,-181,-156,-168},{-143,-188,-200,-159,-169,-199},{-141,-206,-193,-202,-153,-235},{-212,-152,-196,-132,-136,-183},{-213,-213,-138,-186,-237,-189},{-165,-137,-186,-195,-175,-223},{-213,-210,-164,-145,-208,-162},{-215,-220,-172,-136,-166,-160},{-181,-193,-189,-206,-230,-187},{-124,-208,-186,-192,-166,-204},{-148,-130,-203,-125,-226,-204},{-171,-189,-219,-211,-173,-164},{-213,-194,-215,-197,-184,-136},{-185,-201,-144,-147,-204,-246},{-143,-120,-152,-209,-144,-180},{-205,-179,-189,-165,-237,-212},{-218,-198,-131,-170,-236,-201},{-151,-213,-136,-177,-236,-187},{-165,-150,-182,-233,-144,-193}},{{-255,-180,-262,-177,-179,-178},{-228,-170,-253,-214,-211,-307},{-147,-176,-271,-241,-240,-274},{-218,-260,-166,-278,-247,-198},{-212,-156,-219,-267,-254,-257},{-139,-164,-153,-210,-199,-302},{-160,-178,-215,-179,-234,-181},{-240,-234,-232,-201,-282,-278},{-220,-187,-251,-263,-218,-267},{-178,-262,-194,-265,-190,-217},{-180,-260,-170,-263,-256,-240},{-190,-148,-230,-265,-268,-257},{-141,-219,-202,-265,-295,-214},{-176,-238,-204,-219,-284,-174},{-244,-189,-262,-272,-172,-176},{-198,-154,-164,-265,-284,-288},{-232,-260,-275,-217,-222,-171},{-164,-176,-164,-203,-165,-176},{-170,-250,-198,-212,-261,-236},{-143,-178,-273,-283,-192,-205}},{{-188,-196,-241,-346,-280,-345},{-200,-219,-309,-232,-296,-218},{-321,-235,-322,-265,-208,-314},{-207,-204,-254,-324,-271,-226},{-225,-201,-338,-265,-302,-207},{-180,-212,-207,-308,-197,-300},{-262,-186,-257,-230,-274,-345},{-185,-204,-296,-335,-219,-348},{-173,-321,-301,-278,-197,-328},{-222,-324,-286,-251,-305,-280},{-287,-245,-322,-246,-355,-359},{-262,-296,-301,-308,-258,-291},{-267,-181,-288,-324,-319,-238},{-321,-217,-212,-335,-277,-308},{-272,-258,-325,-232,-294,-351},{-185,-260,-280,-308,-249,-283},{-291,-260,-338,-340,-288,-331},{-200,-207,-223,-230,-310,-362},{-232,-204,-241,-192,-310,-229},{-311,-207,-304,-265,-352,-232}}},{{{-299,-382,-428,-365,-234,-362},{-283,-257,-411,-388,-411,-405},{-250,-336,-401,-290,-349,-424},{-243,-359,-385,-362,-359,-247},{-368,-306,-415,-266,-286,-230},{-382,-415,-322,-405,-342,-240},{-352,-286,-250,-230,-266,-329},{-260,-345,-237,-395,-313,-418},{-349,-352,-332,-250,-428,-365},{-273,-322,-257,-280,-355,-260},{-280,-322,-329,-309,-336,-263},{-368,-243,-273,-424,-408,-322},{-408,-368,-326,-408,-388,-319},{-398,-260,-332,-316,-388,-332},{-283,-408,-342,-411,-415,-392},{-332,-342,-316,-257,-401,-283},{-290,-411,-421,-326,-382,-382},{-313,-260,-257,-316,-378,-290},{-266,-296,-306,-270,-411,-398},{-372,-237,-415,-237,-332,-316}},{{-400,-419,-300,-342,-296,-391},{-236,-322,-284,-254,-391,-247},{-371,-274,-293,-226,-354,-325},{-295,-380,-297,-273,-348,-262},{-328,-367,-338,-232,-370,-262},{-384,-402,-341,-257,-293,-268},{-387,-322,-293,-295,-286,-313},{-394,-351,-332,-349,-268,-265},{-259,-325,-258,-371,-249,-382},{-233,-293,-233,-374,-299,-289},{-236,-242,-338,-358,-216,-277},{-348,-242,-360,-283,-330,-367},{-407,-367,-223,-349,-283,-316},{-413,-390,-309,-380,-400,-340},{-394,-283,-293,-270,-222,-277},{-318,-351,-242,-283,-367,-274},{-266,-419,-284,-295,-243,-274},{-390,-361,-271,-226,-228,-241},{-367,-419,-364,-305,-391,-379},{-312,-419,-338,-408,-286,-313}},{{-384,-300,-311,-207,-313,-249},{-283,-351,-283,-310,-292,-319},{-230,-222,-333,-351,-313,-249},{-274,-276,-274,-223,-193,-182},{-230,-262,-280,-294,-220,-231},{-342,-256,-202,-348,-223,-311},{-327,-245,-235,-310,-302,-213},{-268,-305,-269,-345,-339,-278},{-233,-271,-344,-264,-207,-311},{-292,-239,-347,-253,-217,-290},{-327,-259,-244,-321,-209,-270},{-292,-354,-336,-310,-191,-236},{-363,-374,-263,-239,-307,-252},{-218,-210,-235,-231,-289,-311},{-221,-331,-350,-310,-236,-221},{-245,-302,-333,-324,-188,-321},{-327,-253,-196,-302,-207,-298},{-345,-366,-207,-267,-193,-308},{-245,-216,-272,-207,-307,-252},{-206,-251,-216,-234,-215,-180}}},{{{-123,-107,-106,-106,-94,-128},{-135,-108,-108,-99,-98,-106},{-125,-105,-116,-92,-106,-132},{-88,-90,-120,-149,-123,-93},{-96,-136,-105,-111,-146,-150},{-116,-83,-123,-103,-115,-156},{-128,-94,-112,-152,-154,-160},{-128,-82,-111,-152,-104,-106},{-113,-102,-86,-113,-102,-151},{-105,-96,-110,-103,-120,-101},{-74,-103,-134,-111,-106,-110},{-110,-88,-134,-105,-99,-163},{-124,-130,-124,-124,-92,-136},{-130,-89,-108,-87,-105,-116},{-108,-121,-134,-145,-118,-95},{-105,-105,-97,-108,-111,-102},{-84,-110,-108,-104,-157,-156},{-98,-84,-131,-118,-145,-125},{-136,-75,-124,-139,-144,-132},{-125,-134,-133,-136,-148,-124}},{{-171,-125,-104,-136,-127,-133},{-111,-103,-126,-157,-118,-123},{-163,-140,-172,-197,-192,-128},{-101,-169,-135,-143,-138,-156},{-101,-104,-152,-138,-161,-198},{-135,-103,-170,-147,-132,-139},{-162,-155,-184,-121,-182,-173},{-154,-102,-133,-155,-143,-186},{-161,-158,-151,-160,-138,-160},{-146,-141,-133,-147,-201,-173},{-148,-173,-172,-186,-196,-133},{-101,-178,-151,-127,-129,-161},{-119,-172,-110,-122,-118,-129},{-116,-127,-127,-153,-114,-150},{-171,-161,-163,-136,-184,-124},{-161,-179,-149,-192,-137,-129},{-157,-131,-129,-135,-132,-161},{-115,-100,-141,-194,-134,-133},{-165,-162,-154,-191,-145,-171},{-158,-131,-135,-122,-179,-131}},{{-168,-167,-232,-162,-194,-226},{-228,-164,-219,-205,-243,-249},{-145,-200,-232,-190,-190,-160},{-228,-160,-195,-217,-239,-190},{-220,-146,-208,-201,-190,-178},{-210,-137,-143,-217,-214,-198},{-186,-187,-143,-211,-178,-194},{-205,-178,-132,-133,-141,-246},{-184,-198,-225,-245,-225,-166},{-200,-220,-156,-142,-202,-248},{-168,-178,-216,-152,-161,-228},{-205,-194,-143,-139,-149,-234},{-147,-214,-184,-241,-141,-162},{-147,-148,-182,-241,-194,-194},{-177,-146,-212,-192,-225,-212},{-186,-220,-227,-205,-229,-232},{-212,-223,-216,-188,-227,-154},{-226,-225,-225,-186,-221,-249},{-186,-184,-208,-141,-247,-202},{-142,-234,-177,-184,-176,-154}}},{{{-268,-259,-205,-264,-167,-195},{-289,-231,-205,-233,-302,-202},{-235,-188,-267,-264,-233,-298},{-289,-267,-309,-267,-228,-200},{-273,-309,-300,-281,-288,-252},{-200,-269,-295,-286,-255,-309},{-186,-264,-286,-231,-257,-269},{-163,-224,-278,-226,-219,-255},{-210,-288,-212,-305,-290,-248},{-221,-221,-200,-252,-250,-186},{-233,-209,-264,-293,-169,-171},{-214,-286,-224,-174,-240,-181},{-296,-176,-269,-240,-243,-233},{-214,-245,-300,-252,-205,-290},{-280,-307,-228,-293,-238,-305},{-233,-200,-171,-290,-300,-300},{-280,-257,-286,-183,-236,-198},{-186,-271,-169,-205,-236,-228},{-196,-276,-257,-250,-264,-174},{-226,-309,-240,-190,-288,-257}},{{-181,-195,-195,-254,-289,-254},{-200,-250,-301,-286,-219,-192},{-193,-195,-270,-173,-258,-256},{-276,-269,-235,-280,-226,-170},{-207,-288,-181,-254,-219,-223},{-219,-202,-176,-231,-262,-170},{-209,-188,-193,-284,-287,-212},{-255,-219,-261,-277,-276,-252},{-255,-193,-230,-266,-253,-250},{-264,-295,-207,-171,-260,-243},{-302,-178,-254,-194,-221,-166},{-224,-183,-167,-208,-292,-203},{-236,-198,-256,-217,-188,-155},{-286,-228,-251,-289,-197,-239},{-238,-174,-277,-208,-240,-186},{-207,-259,-242,-164,-188,-170},{-188,-274,-200,-231,-273,-161},{-283,-190,-303,-291,-260,-214},{-257,-217,-195,-291,-185,-199},{-183,-283,-301,-203,-179,-192}},{{-221,-171,-220,-209,-193,-148},{-176,-219,-252,-248,-133,-191},{-166,-228,-220,-183,-206,-202},{-280,-194,-208,-226,-228,-157},{-234,-245,-257,-179,-217,-193},{-213,-265,-164,-211,-232,-220},{-273,-270,-216,-187,-221,-153},{-217,-253,-198,-218,-215,-216},{-198,-251,-208,-238,-215,-200},{-211,-261,-158,-185,-217,-194},{-228,-153,-154,-164,-243,-167},{-191,-171,-255,-248,-193,-155},{-219,-159,-145,-177,-200,-202},{-226,-226,-170,-172,-234,-155},{-273,-232,-178,-230,-191,-130},{-191,-180,-210,-177,-223,-209},{-237,-159,-174,-224,-170,-128},{-273,-203,-210,-201,-178,-223},{-211,-245,-240,-234,-137,-157},{-247,-251,-240,-191,-193,-189}}},{{{-338,-298,-330,-242,-250,-229},{-277,-261,-186,-287,-346,-229},{-314,-231,-317,-293,-332,-335},{-213,-271,-311,-202,-221,-239},{-200,-277,-322,-221,-247,-239},{-263,-327,-229,-311,-282,-282},{-194,-263,-194,-319,-250,-210},{-327,-194,-303,-215,-330,-327},{-229,-213,-253,-279,-192,-277},{-215,-332,-229,-234,-290,-298},{-309,-298,-197,-215,-277,-197},{-279,-200,-269,-192,-221,-282},{-282,-231,-266,-186,-327,-293},{-258,-332,-301,-253,-255,-295},{-218,-205,-189,-277,-303,-269},{-306,-309,-301,-306,-335,-266},{-285,-343,-215,-200,-245,-295},{-250,-290,-309,-192,-327,-311},{-269,-314,-343,-319,-239,-330},{-226,-266,-271,-269,-303,-205}},{{-317,-317,-269,-202,-236,-189},{-239,-207,-205,-226,-241,-262},{-205,-223,-327,-237,-335,-277},{-234,-237,-255,-303,-236,-303},{-200,-330,-242,-205,-199,-285},{-197,-346,-277,-325,-320,-300},{-335,-231,-269,-255,-204,-218},{-192,-325,-301,-229,-228,-186},{-306,-218,-239,-287,-288,-223},{-231,-218,-274,-261,-238,-269},{-325,-229,-229,-340,-191,-321},{-277,-298,-306,-282,-265,-243},{-261,-314,-229,-290,-212,-186},{-306,-282,-200,-207,-244,-334},{-277,-282,-319,-327,-257,-332},{-309,-247,-335,-287,-288,-332},{-242,-343,-340,-189,-225,-332},{-223,-282,-215,-285,-191,-189},{-207,-218,-213,-335,-183,-243},{-226,-186,-338,-255,-265,-220}},{{-254,-316,-282,-310,-238,-296},{-220,-316,-212,-184,-257,-284},{-225,-205,-249,-188,-272,-253},{-220,-223,-189,-228,-230,-231},{-238,-215,-204,-176,-314,-277},{-184,-296,-328,-278,-289,-265},{-181,-291,-295,-203,-203,-222},{-332,-253,-325,-193,-247,-296},{-215,-281,-305,-298,-282,-260},{-184,-316,-325,-184,-301,-202},{-334,-202,-312,-265,-265,-219},{-199,-283,-292,-236,-174,-275},{-303,-180,-207,-253,-292,-243},{-192,-316,-280,-303,-233,-212},{-210,-291,-302,-179,-265,-258},{-313,-200,-325,-181,-279,-294},{-293,-248,-214,-253,-196,-229},{-306,-263,-255,-191,-223,-224},{-238,-326,-318,-315,-243,-234},{-306,-324,-310,-322,-194,-241}}},{{{-319,-370,-235,-322,-217,-349},{-253,-274,-307,-223,-214,-207},{-223,-346,-223,-388,-226,-337},{-349,-370,-355,-340,-280,-367},{-247,-304,-262,-382,-277,-361},{-223,-232,-274,-226,-370,-358},{-367,-322,-349,-211,-229,-367},{-229,-319,-250,-391,-280,-275},{-373,-301,-319,-274,-346,-275},{-352,-367,-211,-262,-268,-343},{-373,-379,-304,-322,-283,-228},{-256,-268,-355,-385,-310,-379},{-211,-349,-298,-352,-289,-326},{-286,-262,-235,-331,-232,-343},{-295,-280,-238,-211,-337,-326},{-292,-379,-340,-268,-325,-317},{-385,-352,-334,-235,-376,-290},{-211,-283,-250,-220,-223,-299},{-232,-304,-298,-361,-373,-228},{-262,-388,-361,-253,-280,-346}},{{-372,-244,-241,-317,-315,-229},{-284,-221,-319,-235,-236,-316},{-231,-316,-333,-268,-323,-226},{-366,-333,-353,-265,-209,-247},{-275,-321,-364,-322,-238,-254},{-322,-218,-207,-314,-305,-242},{-208,-342,-224,-322,-193,-278},{-258,-244,-274,-311,-249,-193},{-231,-247,-263,-341,-278,-188},{-270,-273,-263,-347,-321,-298},{-240,-290,-274,-344,-302,-290},{-278,-204,-199,-281,-276,-326},{-287,-267,-230,-289,-196,-290},{-366,-321,-350,-347,-265,-242},{-223,-321,-230,-317,-246,-278},{-319,-298,-316,-330,-329,-275},{-340,-201,-291,-235,-201,-324},{-270,-250,-297,-311,-265,-298},{-308,-221,-221,-349,-323,-180},{-208,-284,-328,-221,-252,-234}},{{-315,-185,-185,-186,-161,-263},{-221,-300,-227,-177,-214,-180},{-198,-182,-163,-192,-261,-156},{-317,-254,-236,-219,-184,-210},{-275,-197,-218,-272,-189,-164},{-300,-262,-229,-254,-223,-147},{-298,-216,-291,-199,-157,-206},{-265,-226,-295,-214,-189,-158},{-263,-204,-266,-283,-210,-222},{-248,-293,-234,-259,-248,-214},{-198,-209,-206,-208,-180,-238},{-322,-293,-218,-221,-151,-166},{-317,-281,-227,-245,-218,-244},{-320,-242,-163,-221,-189,-226},{-290,-276,-181,-265,-212,-250},{-258,-262,-252,-281,-248,-182},{-213,-221,-286,-232,-246,-162},{-176,-242,-195,-248,-269,-202},{-322,-187,-268,-194,-240,-172},{-203,-295,-172,-254,-191,-174}}},{{{-357,-455,-326,-371,-259,-368},{-424,-266,-259,-420,-308,-273},{-455,-413,-434,-399,-389,-332},{-252,-416,-262,-441,-399,-350},{-357,-438,-290,-326,-424,-301},{-357,-410,-444,-385,-245,-368},{-357,-420,-389,-266,-308,-273},{-329,-413,-245,-385,-332,-273},{-368,-276,-360,-392,-343,-346},{-378,-304,-273,-374,-322,-280},{-346,-395,-410,-392,-326,-322},{-340,-399,-329,-322,-280,-389},{-294,-420,-427,-346,-420,-354},{-332,-315,-262,-284,-455,-389},{-270,-406,-298,-266,-430,-364},{-374,-438,-336,-287,-343,-364},{-336,-326,-276,-371,-420,-452},{-434,-329,-343,-444,-287,-427},{-318,-399,-378,-444,-270,-406},{-340,-455,-245,-368,-354,-389}},{{-400,-346,-237,-404,-384,-370},{-432,-257,-386,-397,-236,-312},{-414,-326,-414,-354,-256,-380},{-358,-401,-315,-421,-259,-396},{-452,-432,-308,-267,-239,-235},{-369,-261,-346,-287,-243,-248},{-362,-374,-285,-314,-269,-270},{-407,-353,-437,-264,-361,-390},{-407,-261,-417,-387,-338,-335},{-303,-340,-342,-364,-233,-293},{-261,-360,-397,-377,-367,-390},{-428,-295,-373,-291,-377,-264},{-313,-285,-383,-364,-358,-409},{-428,-292,-302,-391,-269,-309},{-435,-439,-322,-261,-420,-383},{-407,-295,-376,-271,-321,-309},{-428,-394,-261,-357,-390,-393},{-400,-254,-376,-317,-230,-361},{-264,-295,-258,-347,-394,-345},{-341,-374,-410,-394,-390,-248}},{{-387,-357,-351,-334,-234,-231},{-296,-333,-375,-255,-296,-250},{-252,-376,-306,-214,-242,-245},{-321,-271,-306,-252,-294,-197},{-343,-342,-312,-252,-242,-228},{-343,-286,-294,-337,-202,-270},{-249,-246,-234,-284,-331,-203},{-328,-367,-249,-337,-302,-339},{-224,-345,-222,-331,-217,-267},{-299,-249,-288,-328,-348,-253},{-296,-388,-309,-243,-251,-297},{-343,-228,-264,-226,-228,-353},{-340,-259,-312,-314,-342,-339},{-224,-391,-213,-363,-311,-359},{-230,-256,-240,-243,-282,-250},{-369,-302,-273,-381,-217,-261},{-328,-373,-237,-287,-325,-303},{-287,-326,-354,-328,-242,-331},{-365,-373,-297,-319,-262,-203},{-296,-388,-252,-346,-356,-225}}}}; // supply (positive for supply and negative for demand) under different scenarios 
int iniv[I]={1052,192,238,253,176,234,280,264,252}; // initial inventory 
int ubiv[I]={2104,384,476,507,352,468,350,495,504}; // the upper bounds of inventory 
int len[I1][I2]={{5,3,2,2,1,1,2,3}}; // the traveling time between two sites 
// cost parameters: 
double c1[I]={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; // inventory holding cost 
double c2[I]={0.05,13.35,8.59,5.57,4.52,2.83,1.94,4.81,7.57}; // cost of leftover and unmet 
double c3[BN]={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; // transportation cost for capacity contracts 
double c4[I1][I2]={{12.14,7.81,5.06,4.11,2.57,1.76,4.37,6.88}}; // cost of spot market 
// bid parameters: 
int RLBN[I1][I2]={{9,9,9,9,9,9,9,9}}; // number of bids on each arc 
int LBset[I1][I2][LBN]={{{0,1,2,3,4,5,6,7,8},{9,10,11,12,13,14,15,16,17},{18,19,20,21,22,23,24,25,26},{27,28,29,30,31,32,33,34,35},{36,37,38,39,40,41,42,43,44},{45,46,47,48,49,50,51,52,53},{54,55,56,57,58,59,60,61,62},{63,64,65,66,67,68,69,70,71}}}; // set of bids on each arc 
double frt[BN]={9.71,9.71,9.71,8.5,8.5,8.5,7.28,7.28,7.28,6.25,6.25,6.25,5.47,5.47,5.47,4.69,4.69,4.69,4.05,4.05,4.05,3.54,3.54,3.54,3.04,3.04,3.04,3.29,3.29,3.29,2.88,2.88,2.88,2.47,2.47,2.47,2.06,2.06,2.06,1.8,1.8,1.8,1.54,1.54,1.54,1.41,1.41,1.41,1.23,1.23,1.23,1.06,1.06,1.06,3.5,3.5,3.5,3.06,3.06,3.06,2.62,2.62,2.62,5.5,5.5,5.5,4.82,4.82,4.82,4.13,4.13,4.13}; // freight rate of each bid 
int lbcap[BN]={75,75,75,1,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226,75,75,75,301,151,151,151,226,226}; // capacity lower bound of each bid 
int ubcap[BN]={150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300,150,150,150,225,225,225,300,300,300}; // capacity upper bound of each bid 
// shipment parameters: 
int SHN[BN]={6,3,2,7,3,2,6,3,2,8,4,3,8,4,3,7,4,3,7,4,3,7,4,3,7,4,3,7,4,3,8,4,3,8,4,3,9,4,3,9,4,3,8,5,3,8,4,3,9,4,3,9,4,3,8,4,3,8,4,3,7,4,3,7,4,3,7,4,3,7,4,3}; // number of shipment for each bid 
int SHset[BN][MBSN]={{0,1,2,3,4,5},{6,7,8},{9,10},{11,12,13,14,15,16,17},{18,19,20},{21,22},{23,24,25,26,27,28},{29,30,31},{32,33},{34,35,36,37,38,39,40,41},{42,43,44,45},{46,47,48},{49,50,51,52,53,54,55,56},{57,58,59,60},{61,62,63},{64,65,66,67,68,69,70},{71,72,73,74},{75,76,77},{78,79,80,81,82,83,84},{85,86,87,88},{89,90,91},{92,93,94,95,96,97,98},{99,100,101,102},{103,104,105},{106,107,108,109,110,111,112},{113,114,115,116},{117,118,119},{120,121,122,123,124,125,126},{127,128,129,130},{131,132,133},{134,135,136,137,138,139,140,141},{142,143,144,145},{146,147,148},{149,150,151,152,153,154,155,156},{157,158,159,160},{161,162,163},{164,165,166,167,168,169,170,171,172},{173,174,175,176},{177,178,179},{180,181,182,183,184,185,186,187,188},{189,190,191,192},{193,194,195},{196,197,198,199,200,201,202,203},{204,205,206,207,208},{209,210,211},{212,213,214,215,216,217,218,219},{220,221,222,223},{224,225,226},{227,228,229,230,231,232,233,234,235},{236,237,238,239},{240,241,242},{243,244,245,246,247,248,249,250,251},{252,253,254,255},{256,257,258},{259,260,261,262,263,264,265,266},{267,268,269,270},{271,272,273},{274,275,276,277,278,279,280,281},{282,283,284,285},{286,287,288},{289,290,291,292,293,294,295},{296,297,298,299},{300,301,302},{303,304,305,306,307,308,309},{310,311,312,313},{314,315,316},{317,318,319,320,321,322,323},{324,325,326,327},{328,329,330},{331,332,333,334,335,336,337},{338,339,340,341},{342,343,344}}; // set of shipments in each bid 
int SHsts[SPN]={2,4,6,8,10,12,1,5,9,2,8,0,2,4,6,8,10,12,2,6,10,1,7,1,3,5,7,9,11,1,5,9,2,8,0,2,4,6,8,10,12,14,1,5,9,13,0,6,12,0,2,4,6,8,10,12,14,2,6,10,14,0,6,12,2,4,6,8,10,12,14,1,5,9,13,1,7,13,2,4,6,8,10,12,14,2,6,10,14,1,7,13,2,4,6,8,10,12,14,1,5,9,13,2,8,14,2,4,6,8,10,12,14,0,4,8,12,1,7,13,2,4,6,8,10,12,14,2,6,10,14,0,6,12,1,3,5,7,9,11,13,15,0,4,8,12,0,6,12,0,2,4,6,8,10,12,14,2,6,10,14,2,8,14,0,2,4,6,8,10,12,14,16,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,16,2,6,10,14,2,8,14,2,4,6,8,10,12,14,16,0,4,8,12,16,0,6,12,2,4,6,8,10,12,14,16,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,16,1,5,9,13,2,8,14,0,2,4,6,8,10,12,14,16,2,6,10,14,2,8,14,0,2,4,6,8,10,12,14,2,6,10,14,2,8,14,1,3,5,7,9,11,13,15,2,6,10,14,0,6,12,2,4,6,8,10,12,14,0,4,8,12,1,7,13,1,3,5,7,9,11,13,0,4,8,12,1,7,13,1,3,5,7,9,11,13,0,4,8,12,2,8,14,2,4,6,8,10,12,14,0,4,8,12,1,7,13}; // set of start times of each shipment 
int SHets[SPN]={7,9,11,13,15,17,6,10,14,7,13,5,7,9,11,13,15,17,7,11,15,6,12,6,8,10,12,14,16,6,10,14,7,13,3,5,7,9,11,13,15,17,4,8,12,16,3,9,15,3,5,7,9,11,13,15,17,5,9,13,17,3,9,15,5,7,9,11,13,15,17,4,8,12,16,4,10,16,4,6,8,10,12,14,16,4,8,12,16,3,9,15,4,6,8,10,12,14,16,3,7,11,15,4,10,16,4,6,8,10,12,14,16,2,6,10,14,3,9,15,4,6,8,10,12,14,16,4,8,12,16,2,8,14,3,5,7,9,11,13,15,17,2,6,10,14,2,8,14,2,4,6,8,10,12,14,16,4,8,12,16,4,10,16,1,3,5,7,9,11,13,15,17,3,7,11,15,2,8,14,1,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,3,5,7,9,11,13,15,17,1,5,9,13,17,1,7,13,3,5,7,9,11,13,15,17,3,7,11,15,2,8,14,1,3,5,7,9,11,13,15,17,2,6,10,14,3,9,15,1,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,2,4,6,8,10,12,14,16,4,8,12,16,4,10,16,3,5,7,9,11,13,15,17,4,8,12,16,2,8,14,4,6,8,10,12,14,16,2,6,10,14,3,9,15,4,6,8,10,12,14,16,3,7,11,15,4,10,16,4,6,8,10,12,14,16,3,7,11,15,5,11,17,5,7,9,11,13,15,17,3,7,11,15,4,10,16}; // set of end times of each shipment 
