int Dev = 10;// 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 = 351;//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]={{{{12296,0,0,0,0,0},{12402,0,0,0,0,0},{12451,0,0,0,0,0},{12315,0,0,0,0,0},{12252,0,0,0,0,0},{12397,0,0,0,0,0},{12512,0,0,0,0,0},{12521,0,0,0,0,0},{12409,0,0,0,0,0},{12333,0,0,0,0,0},{12215,0,0,0,0,0},{12386,0,0,0,0,0},{12570,0,0,0,0,0},{12535,0,0,0,0,0},{12490,0,0,0,0,0},{12417,0,0,0,0,0},{12483,0,0,0,0,0},{12416,0,0,0,0,0},{12482,0,0,0,0,0},{12327,0,0,0,0,0}},{{12221,0,0,0,0,0},{12305,0,0,0,0,0},{12190,0,0,0,0,0},{12244,0,0,0,0,0},{12510,0,0,0,0,0},{12540,0,0,0,0,0},{12295,0,0,0,0,0},{12388,0,0,0,0,0},{12598,0,0,0,0,0},{12442,0,0,0,0,0},{12431,0,0,0,0,0},{12558,0,0,0,0,0},{12435,0,0,0,0,0},{12219,0,0,0,0,0},{12461,0,0,0,0,0},{12445,0,0,0,0,0},{12345,0,0,0,0,0},{12411,0,0,0,0,0},{12273,0,0,0,0,0},{12486,0,0,0,0,0}},{{11684,0,0,0,0,0},{11443,0,0,0,0,0},{11772,0,0,0,0,0},{11569,0,0,0,0,0},{11652,0,0,0,0,0},{11463,0,0,0,0,0},{11390,0,0,0,0,0},{11736,0,0,0,0,0},{11697,0,0,0,0,0},{11645,0,0,0,0,0},{11536,0,0,0,0,0},{11600,0,0,0,0,0},{11556,0,0,0,0,0},{11680,0,0,0,0,0},{11673,0,0,0,0,0},{11614,0,0,0,0,0},{11561,0,0,0,0,0},{11611,0,0,0,0,0},{11484,0,0,0,0,0},{11616,0,0,0,0,0}}},{{{-294,-306,-297,-276,-315,-309},{-318,-279,-323,-315,-312,-268},{-320,-294,-273,-288,-291,-291},{-306,-315,-303,-276,-285,-270},{-273,-282,-285,-288,-279,-323},{-270,-288,-318,-282,-303,-270},{-306,-273,-297,-303,-323,-309},{-306,-282,-282,-276,-323,-268},{-270,-300,-273,-279,-306,-288},{-273,-270,-320,-320,-273,-300},{-282,-291,-309,-282,-268,-320},{-309,-270,-300,-270,-285,-291},{-323,-315,-309,-268,-315,-306},{-291,-282,-291,-300,-312,-303},{-285,-318,-291,-268,-306,-294},{-282,-279,-279,-273,-297,-273},{-297,-300,-297,-279,-300,-320},{-297,-288,-273,-268,-285,-315},{-282,-323,-320,-312,-265,-323},{-306,-312,-279,-294,-288,-318}},{{-299,-283,-291,-252,-259,-254},{-299,-263,-263,-255,-291,-264},{-313,-257,-258,-255,-294,-249},{-287,-269,-258,-279,-240,-233},{-278,-263,-255,-269,-243,-254},{-307,-280,-280,-266,-291,-259},{-270,-257,-255,-277,-254,-243},{-278,-272,-300,-266,-291,-282},{-293,-283,-283,-266,-243,-264},{-302,-312,-255,-279,-246,-233},{-296,-269,-305,-277,-283,-275},{-270,-297,-294,-285,-280,-259},{-293,-289,-283,-263,-280,-243},{-267,-315,-255,-271,-294,-262},{-299,-315,-305,-252,-283,-262},{-307,-306,-269,-290,-275,-272},{-261,-257,-294,-252,-278,-285},{-299,-315,-286,-288,-267,-249},{-276,-295,-288,-288,-270,-254},{-284,-283,-308,-249,-291,-238}},{{-270,-249,-226,-240,-233,-187},{-245,-259,-219,-222,-205,-187},{-225,-264,-256,-244,-203,-214},{-250,-230,-254,-224,-203,-200},{-250,-254,-217,-233,-220,-225},{-268,-235,-210,-235,-210,-185},{-228,-254,-247,-206,-195,-212},{-240,-244,-228,-206,-235,-222},{-268,-230,-224,-228,-197,-212},{-275,-240,-235,-213,-216,-214},{-255,-227,-212,-215,-235,-216},{-265,-218,-219,-244,-227,-225},{-258,-257,-238,-224,-233,-227},{-228,-220,-254,-206,-214,-200},{-248,-225,-235,-246,-225,-227},{-248,-249,-238,-242,-235,-196},{-270,-254,-235,-215,-235,-202},{-235,-252,-231,-242,-201,-214},{-268,-220,-254,-213,-233,-190},{-272,-237,-247,-228,-218,-222}}},{{{-176,-162,-163,-168,-166,-187},{-153,-179,-163,-175,-201,-199},{-163,-164,-187,-184,-177,-208},{-171,-155,-161,-183,-184,-187},{-151,-162,-184,-161,-186,-187},{-181,-159,-170,-197,-190,-183},{-156,-167,-161,-193,-193,-197},{-168,-169,-189,-161,-178,-191},{-178,-154,-182,-175,-166,-193},{-175,-164,-180,-163,-186,-183},{-183,-172,-159,-165,-191,-202},{-153,-177,-170,-172,-191,-178},{-173,-159,-161,-184,-201,-208},{-161,-162,-178,-197,-182,-199},{-160,-162,-178,-166,-177,-195},{-176,-181,-172,-186,-171,-180},{-153,-183,-170,-170,-199,-210},{-175,-161,-158,-165,-190,-197},{-183,-152,-177,-184,-202,-197},{-173,-155,-189,-190,-177,-195}},{{-188,-207,-209,-199,-245,-240},{-184,-226,-207,-234,-250,-255},{-196,-213,-202,-203,-231,-224},{-192,-226,-219,-201,-243,-257},{-210,-203,-202,-214,-211,-236},{-200,-203,-200,-214,-220,-219},{-192,-197,-230,-230,-218,-248},{-208,-187,-215,-225,-250,-228},{-212,-187,-224,-236,-231,-214},{-210,-187,-230,-232,-227,-257},{-198,-197,-224,-234,-215,-224},{-214,-217,-202,-221,-224,-245},{-216,-209,-194,-199,-240,-217},{-186,-184,-204,-208,-238,-236},{-212,-195,-192,-203,-247,-233},{-212,-187,-202,-210,-243,-259},{-216,-187,-234,-214,-240,-217},{-202,-213,-194,-221,-250,-228},{-188,-203,-211,-234,-236,-233},{-186,-184,-226,-214,-245,-252}},{{-237,-260,-275,-278,-296,-300},{-254,-232,-262,-297,-249,-291},{-259,-273,-257,-292,-288,-272},{-245,-250,-259,-286,-249,-289},{-269,-240,-286,-289,-271,-294},{-235,-275,-280,-294,-302,-266},{-232,-242,-275,-254,-271,-297},{-249,-270,-288,-270,-269,-255},{-272,-240,-270,-273,-305,-277},{-242,-252,-275,-243,-305,-308},{-235,-232,-236,-262,-294,-306},{-252,-252,-265,-243,-258,-272},{-235,-258,-238,-265,-283,-306},{-232,-250,-246,-289,-283,-291},{-257,-255,-288,-254,-294,-303},{-264,-250,-254,-284,-288,-263},{-235,-255,-246,-251,-288,-269},{-252,-252,-262,-246,-283,-255},{-235,-268,-257,-294,-263,-272},{-235,-242,-259,-265,-255,-294}}},{{{-349,-322,-339,-355,-332,-313},{-322,-326,-316,-296,-303,-326},{-352,-316,-339,-326,-339,-355},{-306,-332,-309,-332,-313,-313},{-319,-355,-313,-303,-306,-362},{-326,-352,-326,-349,-329,-336},{-332,-319,-355,-329,-296,-299},{-299,-345,-359,-316,-352,-309},{-316,-339,-332,-362,-326,-309},{-352,-342,-332,-326,-299,-339},{-319,-299,-303,-319,-299,-306},{-303,-329,-299,-319,-313,-336},{-319,-303,-342,-345,-352,-329},{-319,-332,-316,-316,-349,-326},{-349,-326,-332,-303,-326,-319},{-299,-322,-352,-345,-306,-316},{-326,-306,-306,-309,-329,-352},{-359,-322,-316,-296,-345,-355},{-329,-362,-352,-336,-355,-336},{-336,-355,-319,-313,-306,-313}},{{-361,-335,-335,-320,-277,-289},{-325,-316,-338,-345,-330,-295},{-321,-335,-287,-311,-308,-310},{-325,-319,-300,-339,-280,-280},{-325,-348,-335,-286,-320,-307},{-315,-312,-309,-342,-320,-313},{-318,-345,-345,-339,-277,-277},{-358,-306,-306,-283,-286,-301},{-295,-345,-316,-286,-326,-283},{-312,-299,-351,-283,-305,-319},{-335,-306,-329,-323,-314,-298},{-331,-299,-316,-323,-336,-319},{-315,-351,-316,-342,-314,-277},{-308,-312,-287,-289,-277,-271},{-354,-325,-322,-286,-333,-319},{-354,-348,-293,-308,-336,-313},{-328,-345,-313,-305,-330,-283},{-318,-293,-329,-311,-311,-271},{-335,-296,-309,-314,-277,-328},{-351,-332,-297,-317,-283,-310}},{{-280,-305,-260,-286,-260,-283},{-277,-259,-302,-269,-252,-249},{-319,-265,-288,-296,-246,-270},{-277,-300,-255,-269,-254,-252},{-324,-302,-297,-248,-241,-231},{-298,-262,-255,-258,-278,-280},{-301,-268,-308,-256,-244,-257},{-298,-294,-305,-296,-268,-280},{-292,-259,-260,-258,-292,-265},{-289,-285,-263,-294,-281,-231},{-266,-291,-302,-277,-268,-270},{-283,-311,-308,-294,-254,-252},{-266,-259,-269,-256,-286,-239},{-319,-259,-280,-277,-241,-257},{-322,-311,-288,-261,-284,-262},{-310,-271,-277,-267,-286,-257},{-292,-282,-280,-272,-244,-270},{-316,-308,-297,-264,-260,-252},{-283,-268,-255,-275,-292,-280},{-313,-274,-291,-250,-244,-283}}},{{{-109,-117,-116,-112,-118,-124},{-116,-112,-114,-110,-134,-141},{-102,-104,-106,-125,-131,-122},{-111,-105,-119,-128,-128,-128},{-112,-106,-110,-112,-122,-124},{-97,-96,-112,-125,-118,-141},{-114,-95,-103,-113,-124,-129},{-103,-110,-115,-125,-129,-137},{-99,-104,-102,-113,-129,-141},{-94,-101,-109,-129,-134,-115},{-114,-96,-111,-106,-110,-122},{-100,-95,-106,-113,-111,-141},{-102,-98,-101,-109,-126,-123},{-104,-95,-103,-109,-129,-119},{-106,-105,-102,-124,-124,-116},{-105,-108,-116,-109,-132,-129},{-96,-113,-105,-110,-121,-120},{-96,-111,-118,-122,-111,-122},{-96,-110,-102,-129,-117,-141},{-97,-112,-116,-111,-126,-125}},{{-131,-148,-148,-140,-161,-163},{-140,-137,-147,-167,-148,-170},{-135,-151,-160,-143,-159,-170},{-126,-148,-145,-143,-174,-151},{-134,-154,-148,-169,-161,-183},{-136,-154,-161,-144,-171,-161},{-138,-134,-151,-152,-155,-161},{-144,-144,-142,-144,-150,-171},{-142,-148,-151,-147,-153,-185},{-123,-151,-133,-152,-163,-153},{-131,-144,-163,-169,-163,-151},{-134,-130,-145,-164,-158,-161},{-122,-127,-136,-140,-174,-175},{-147,-147,-141,-158,-161,-173},{-132,-138,-163,-155,-147,-153},{-127,-135,-149,-149,-174,-183},{-136,-141,-142,-166,-161,-153},{-122,-152,-152,-155,-164,-155},{-146,-130,-161,-161,-155,-175},{-130,-154,-145,-163,-172,-180}},{{-189,-162,-192,-188,-214,-210},{-182,-184,-173,-171,-212,-180},{-186,-182,-179,-201,-178,-218},{-182,-167,-175,-190,-212,-216},{-187,-166,-173,-177,-202,-212},{-161,-182,-184,-182,-188,-188},{-173,-173,-179,-180,-208,-192},{-180,-167,-186,-203,-204,-216},{-164,-191,-199,-192,-204,-216},{-187,-180,-195,-184,-216,-212},{-168,-194,-177,-194,-190,-180},{-182,-175,-182,-173,-204,-186},{-193,-185,-193,-203,-202,-190},{-184,-184,-192,-209,-198,-186},{-164,-169,-190,-190,-192,-198},{-161,-180,-186,-179,-214,-214},{-170,-182,-186,-192,-176,-206},{-178,-180,-195,-192,-204,-200},{-168,-178,-188,-198,-198,-184},{-184,-178,-177,-179,-194,-206}}},{{{-210,-221,-248,-219,-217,-262},{-224,-214,-252,-231,-238,-236},{-235,-259,-217,-262,-250,-214},{-249,-233,-233,-228,-240,-255},{-238,-243,-214,-217,-236,-259},{-238,-238,-259,-219,-238,-259},{-228,-243,-248,-262,-228,-228},{-254,-226,-224,-219,-224,-252},{-249,-214,-214,-224,-252,-228},{-231,-219,-262,-255,-233,-259},{-247,-250,-243,-228,-236,-226},{-210,-255,-252,-255,-252,-221},{-252,-214,-240,-255,-245,-233},{-219,-252,-238,-226,-221,-245},{-228,-259,-224,-255,-224,-248},{-238,-221,-259,-238,-252,-233},{-256,-231,-238,-259,-231,-214},{-224,-214,-231,-224,-221,-214},{-247,-236,-226,-243,-252,-221},{-238,-245,-228,-259,-252,-228}},{{-236,-252,-216,-238,-219,-232},{-217,-228,-233,-215,-208,-236},{-262,-214,-228,-226,-208,-232},{-259,-240,-235,-226,-246,-234},{-262,-238,-251,-233,-242,-236},{-245,-240,-251,-243,-244,-223},{-224,-243,-254,-217,-212,-228},{-219,-221,-235,-247,-244,-206},{-262,-257,-256,-222,-237,-241},{-233,-231,-233,-238,-237,-217},{-221,-233,-226,-210,-242,-219},{-255,-219,-256,-217,-221,-234},{-257,-248,-256,-226,-228,-230},{-219,-240,-251,-233,-215,-206},{-226,-231,-251,-217,-240,-212},{-217,-245,-258,-222,-203,-241},{-255,-221,-240,-222,-203,-239},{-243,-248,-254,-226,-226,-199},{-214,-236,-226,-247,-249,-206},{-238,-236,-251,-243,-224,-223}},{{-202,-192,-188,-183,-174,-198},{-209,-209,-190,-177,-196,-184},{-215,-222,-190,-203,-194,-193},{-217,-213,-220,-177,-202,-180},{-217,-228,-218,-207,-174,-184},{-211,-211,-208,-176,-196,-191},{-234,-196,-190,-193,-168,-169},{-230,-211,-216,-197,-189,-171},{-213,-209,-196,-215,-191,-189},{-211,-226,-188,-205,-200,-198},{-230,-213,-206,-211,-196,-176},{-211,-217,-208,-215,-200,-171},{-228,-207,-210,-177,-172,-178},{-202,-230,-196,-215,-185,-164},{-219,-190,-196,-189,-170,-164},{-206,-199,-198,-187,-193,-187},{-194,-211,-210,-205,-187,-164},{-206,-217,-204,-205,-202,-167},{-196,-224,-216,-191,-174,-167},{-226,-192,-192,-205,-198,-180}}},{{{-250,-293,-255,-266,-285,-261},{-239,-263,-255,-290,-255,-274},{-287,-239,-271,-245,-242,-269},{-263,-239,-263,-293,-274,-255},{-245,-266,-277,-263,-261,-253},{-253,-261,-266,-239,-242,-290},{-253,-269,-261,-269,-271,-261},{-258,-261,-279,-245,-271,-293},{-287,-242,-255,-293,-293,-263},{-271,-269,-282,-255,-242,-271},{-250,-261,-266,-250,-266,-253},{-274,-245,-277,-253,-253,-290},{-285,-269,-274,-258,-285,-287},{-269,-263,-287,-263,-258,-253},{-287,-239,-253,-242,-287,-290},{-250,-293,-279,-269,-245,-285},{-242,-290,-271,-245,-293,-266},{-282,-274,-274,-279,-274,-255},{-263,-269,-253,-266,-255,-266},{-271,-266,-253,-274,-258,-239}},{{-255,-245,-247,-274,-238,-262},{-261,-242,-239,-269,-272,-269},{-245,-250,-253,-269,-254,-267},{-285,-250,-255,-247,-246,-243},{-293,-277,-285,-266,-278,-269},{-258,-293,-285,-269,-280,-238},{-287,-282,-261,-255,-259,-256},{-266,-263,-250,-258,-265,-280},{-239,-287,-293,-263,-275,-272},{-277,-279,-277,-255,-262,-269},{-245,-282,-258,-285,-262,-264},{-277,-266,-258,-271,-252,-285},{-247,-277,-266,-263,-275,-249},{-277,-266,-258,-293,-249,-233},{-247,-263,-253,-277,-257,-269},{-247,-250,-258,-269,-249,-262},{-258,-261,-258,-255,-265,-267},{-285,-250,-282,-279,-246,-251},{-258,-263,-239,-261,-257,-259},{-250,-261,-258,-263,-278,-256}},{{-269,-250,-262,-273,-240,-263},{-246,-261,-275,-270,-225,-234},{-277,-256,-239,-246,-220,-246},{-251,-235,-272,-236,-257,-251},{-259,-278,-262,-265,-243,-265},{-256,-238,-237,-255,-260,-251},{-275,-228,-270,-241,-228,-255},{-233,-253,-249,-253,-252,-222},{-256,-271,-262,-231,-223,-258},{-251,-233,-255,-253,-220,-231},{-243,-235,-242,-241,-230,-241},{-269,-238,-227,-260,-265,-246},{-269,-258,-265,-226,-228,-234},{-275,-233,-275,-223,-233,-265},{-277,-263,-277,-238,-225,-265},{-282,-278,-277,-228,-230,-243},{-256,-228,-249,-268,-267,-229},{-246,-256,-239,-255,-235,-265},{-238,-261,-247,-228,-243,-234},{-256,-266,-252,-255,-238,-255}}},{{{-316,-292,-271,-325,-280,-284},{-283,-271,-331,-319,-274,-275},{-313,-319,-277,-328,-277,-272},{-325,-322,-277,-286,-280,-284},{-271,-325,-328,-271,-295,-296},{-328,-289,-301,-295,-310,-272},{-298,-298,-310,-316,-283,-299},{-274,-307,-319,-310,-304,-323},{-313,-295,-298,-319,-325,-275},{-280,-271,-292,-283,-322,-281},{-316,-316,-301,-280,-319,-320},{-307,-280,-304,-283,-292,-326},{-304,-313,-304,-310,-301,-305},{-316,-313,-304,-313,-319,-317},{-325,-277,-304,-301,-298,-320},{-316,-310,-316,-307,-295,-308},{-310,-328,-331,-292,-331,-266},{-328,-277,-328,-328,-328,-302},{-283,-274,-271,-283,-307,-326},{-298,-286,-322,-286,-298,-266}},{{-319,-264,-255,-259,-292,-247},{-296,-270,-286,-257,-241,-247},{-290,-290,-277,-246,-276,-236},{-299,-273,-286,-251,-246,-249},{-311,-313,-252,-295,-252,-247},{-264,-270,-263,-257,-278,-267},{-270,-287,-266,-257,-286,-283},{-316,-264,-288,-268,-262,-283},{-311,-307,-302,-262,-268,-283},{-278,-307,-288,-276,-281,-234},{-293,-273,-274,-262,-241,-247},{-302,-313,-252,-298,-265,-257},{-278,-301,-297,-251,-273,-247},{-272,-310,-291,-262,-238,-249},{-264,-293,-266,-278,-278,-244},{-267,-276,-308,-265,-270,-254},{-284,-290,-263,-257,-241,-280},{-264,-258,-297,-273,-238,-283},{-296,-290,-280,-281,-252,-242},{-322,-258,-294,-300,-260,-252}},{{-226,-264,-236,-230,-197,-210},{-273,-238,-208,-225,-201,-216},{-265,-259,-224,-219,-212,-218},{-253,-218,-245,-234,-210,-184},{-231,-242,-208,-206,-201,-196},{-223,-216,-222,-219,-199,-210},{-268,-223,-229,-210,-214,-194},{-241,-218,-247,-206,-227,-212},{-268,-262,-236,-210,-223,-218},{-250,-230,-247,-232,-218,-200},{-246,-228,-247,-212,-216,-208},{-223,-254,-247,-208,-229,-218},{-238,-226,-243,-228,-220,-192},{-263,-247,-236,-230,-218,-208},{-241,-228,-250,-212,-201,-206},{-226,-226,-252,-208,-216,-204},{-265,-223,-208,-239,-231,-200},{-260,-259,-218,-223,-233,-208},{-238,-216,-234,-203,-233,-220},{-265,-235,-229,-232,-214,-184}}},{{{-354,-343,-357,-318,-318,-326},{-350,-385,-360,-371,-329,-382},{-326,-346,-371,-336,-385,-354},{-371,-318,-354,-346,-329,-378},{-326,-357,-374,-364,-346,-322},{-318,-368,-332,-368,-378,-318},{-368,-364,-385,-374,-332,-378},{-378,-371,-360,-346,-346,-385},{-346,-378,-332,-364,-332,-382},{-326,-354,-329,-346,-378,-343},{-354,-326,-332,-315,-368,-364},{-368,-374,-378,-371,-357,-378},{-343,-336,-336,-360,-350,-340},{-329,-371,-368,-371,-371,-374},{-385,-364,-374,-340,-360,-374},{-329,-378,-364,-326,-350,-368},{-371,-318,-357,-368,-382,-322},{-315,-371,-350,-378,-329,-371},{-378,-382,-322,-326,-322,-326},{-329,-354,-354,-315,-385,-318}},{{-355,-319,-332,-314,-305,-312},{-369,-374,-308,-324,-302,-293},{-355,-353,-359,-301,-308,-306},{-327,-322,-373,-361,-335,-322},{-362,-333,-319,-341,-302,-345},{-383,-346,-356,-344,-321,-345},{-358,-336,-359,-361,-298,-293},{-362,-364,-342,-301,-331,-316},{-324,-367,-366,-311,-358,-322},{-365,-322,-370,-337,-321,-341},{-334,-364,-329,-351,-361,-332},{-313,-364,-346,-334,-341,-338},{-369,-367,-342,-301,-321,-351},{-369,-357,-356,-337,-315,-332},{-372,-350,-312,-364,-344,-328},{-317,-360,-322,-311,-325,-348},{-324,-329,-373,-314,-354,-354},{-362,-346,-373,-307,-351,-325},{-345,-322,-322,-361,-308,-296},{-313,-357,-346,-347,-308,-354}},{{-321,-280,-270,-296,-291,-289},{-306,-293,-276,-314,-285,-300},{-331,-277,-306,-319,-294,-272},{-334,-280,-330,-316,-285,-281},{-293,-290,-285,-284,-311,-297},{-284,-320,-306,-308,-305,-250},{-324,-283,-288,-290,-279,-289},{-287,-323,-330,-322,-282,-292},{-296,-293,-330,-299,-288,-272},{-309,-305,-324,-272,-282,-270},{-324,-317,-285,-287,-311,-289},{-293,-302,-324,-305,-276,-250},{-290,-330,-306,-319,-268,-281},{-343,-305,-330,-322,-294,-289},{-302,-323,-306,-319,-271,-253},{-321,-296,-297,-319,-256,-272},{-343,-305,-285,-287,-314,-286},{-315,-320,-297,-278,-265,-267},{-312,-280,-309,-322,-294,-270},{-340,-305,-315,-272,-274,-289}}}}; // 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,3,6,3,3,7,3,2,8,4,3,7,4,3,7,4,3,8,4,3,7,4,3,8,4,3,7,4,3,8,4,3,8,4,3,9,5,3,8,4,3,9,4,3,8,4,3,9,5,3,9,5,3,8,4,3,8,4,3,8,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,345,346,347},{348,349,350}}; // set of shipments in each bid 
int SHsts[SPN]={2,4,6,8,10,12,1,5,9,0,6,12,1,3,5,7,9,11,2,6,10,0,6,12,0,2,4,6,8,10,12,2,6,10,1,7,0,2,4,6,8,10,12,14,2,6,10,14,1,7,13,2,4,6,8,10,12,14,0,4,8,12,2,8,14,2,4,6,8,10,12,14,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,0,4,8,12,2,8,14,2,4,6,8,10,12,14,1,5,9,13,2,8,14,1,3,5,7,9,11,13,15,1,5,9,13,1,7,13,2,4,6,8,10,12,14,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,0,4,8,12,2,8,14,1,3,5,7,9,11,13,15,0,4,8,12,2,8,14,0,2,4,6,8,10,12,14,16,0,4,8,12,16,2,8,14,2,4,6,8,10,12,14,16,1,5,9,13,1,7,13,0,2,4,6,8,10,12,14,16,1,5,9,13,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,0,4,8,12,16,0,6,12,0,2,4,6,8,10,12,14,16,0,4,8,12,16,0,6,12,0,2,4,6,8,10,12,14,1,5,9,13,0,6,12,1,3,5,7,9,11,13,15,2,6,10,14,2,8,14,0,2,4,6,8,10,12,14,1,5,9,13,1,7,13,1,3,5,7,9,11,13,2,6,10,14,0,6,12,1,3,5,7,9,11,13,1,5,9,13,1,7,13,2,4,6,8,10,12,14,1,5,9,13,1,7,13}; // set of start times of each shipment 
int SHets[SPN]={7,9,11,13,15,17,6,10,14,5,11,17,6,8,10,12,14,16,7,11,15,5,11,17,5,7,9,11,13,15,17,7,11,15,6,12,3,5,7,9,11,13,15,17,5,9,13,17,4,10,16,5,7,9,11,13,15,17,3,7,11,15,5,11,17,5,7,9,11,13,15,17,5,9,13,17,4,10,16,2,4,6,8,10,12,14,16,2,6,10,14,4,10,16,4,6,8,10,12,14,16,3,7,11,15,4,10,16,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,4,6,8,10,12,14,16,4,8,12,16,3,9,15,2,4,6,8,10,12,14,16,2,6,10,14,4,10,16,3,5,7,9,11,13,15,17,2,6,10,14,4,10,16,1,3,5,7,9,11,13,15,17,1,5,9,13,17,3,9,15,3,5,7,9,11,13,15,17,2,6,10,14,2,8,14,1,3,5,7,9,11,13,15,17,2,6,10,14,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,1,5,9,13,17,1,7,13,1,3,5,7,9,11,13,15,17,1,5,9,13,17,1,7,13,2,4,6,8,10,12,14,16,3,7,11,15,2,8,14,3,5,7,9,11,13,15,17,4,8,12,16,4,10,16,2,4,6,8,10,12,14,16,3,7,11,15,3,9,15,4,6,8,10,12,14,16,5,9,13,17,3,9,15,4,6,8,10,12,14,16,4,8,12,16,4,10,16,5,7,9,11,13,15,17,4,8,12,16,4,10,16}; // set of end times of each shipment 
