int Dev = 50;// Deviation
extern const int CNN = 4;// Case Index
extern const int P = 6;// Number of phases
extern const int PT = 6;// Number of periods in a phase
extern const int T = 36;// 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 = 744;//Number of shipments
extern const int SN = 10;//Number of scenarios at each stage
extern const int MBSN = 18;//Number of shipments in a bid
// tree parameters:
double PRO[P][SN]={{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1}}; // the probability of each scenario at each phase 
// timing parameters: 
int PTN[P]={6,6,6,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},{18,19,20,21,22,23},{24,25,26,27,28,29},{30,31,32,33,34,35}}; // set of periods in each phase 
// distribution parameters: 
int sup[I][P][SN][PT]={{{{11425,0,0,0,0,0},{11148,0,0,0,0,0},{10802,0,0,0,0,0},{10493,0,0,0,0,0},{10936,0,0,0,0,0},{10858,0,0,0,0,0},{10875,0,0,0,0,0},{10994,0,0,0,0,0},{10770,0,0,0,0,0},{10664,0,0,0,0,0}},{{11128,0,0,0,0,0},{11113,0,0,0,0,0},{10661,0,0,0,0,0},{11597,0,0,0,0,0},{11139,0,0,0,0,0},{10100,0,0,0,0,0},{11667,0,0,0,0,0},{10673,0,0,0,0,0},{10600,0,0,0,0,0},{10693,0,0,0,0,0}},{{10217,0,0,0,0,0},{10709,0,0,0,0,0},{11183,0,0,0,0,0},{10183,0,0,0,0,0},{11296,0,0,0,0,0},{10614,0,0,0,0,0},{10842,0,0,0,0,0},{12096,0,0,0,0,0},{11115,0,0,0,0,0},{11580,0,0,0,0,0}},{{11196,0,0,0,0,0},{10200,0,0,0,0,0},{10536,0,0,0,0,0},{9755,0,0,0,0,0},{11330,0,0,0,0,0},{10182,0,0,0,0,0},{12070,0,0,0,0,0},{10497,0,0,0,0,0},{10297,0,0,0,0,0},{11066,0,0,0,0,0}},{{10605,0,0,0,0,0},{12027,0,0,0,0,0},{11558,0,0,0,0,0},{10553,0,0,0,0,0},{11246,0,0,0,0,0},{11442,0,0,0,0,0},{10954,0,0,0,0,0},{10920,0,0,0,0,0},{10474,0,0,0,0,0},{10831,0,0,0,0,0}},{{10685,0,0,0,0,0},{10937,0,0,0,0,0},{11074,0,0,0,0,0},{11591,0,0,0,0,0},{10636,0,0,0,0,0},{10278,0,0,0,0,0},{11863,0,0,0,0,0},{11144,0,0,0,0,0},{10945,0,0,0,0,0},{10196,0,0,0,0,0}}},{{{-150,-332,-141,-179,-132,-316},{-224,-179,-323,-121,-291,-231},{-164,-172,-157,-116,-329,-121},{-300,-204,-190,-278,-128,-262},{-170,-121,-264,-253,-329,-202},{-291,-258,-177,-141,-264,-235},{-224,-318,-242,-197,-215,-179},{-213,-141,-217,-181,-336,-195},{-271,-206,-262,-211,-246,-130},{-157,-235,-188,-244,-206,-150}},{{-320,-164,-166,-130,-251,-130},{-244,-284,-128,-195,-119,-166},{-300,-184,-186,-309,-188,-300},{-195,-237,-235,-228,-220,-128},{-260,-208,-258,-307,-240,-112},{-170,-190,-181,-217,-220,-150},{-152,-170,-334,-150,-293,-329},{-202,-260,-186,-320,-217,-258},{-188,-175,-139,-184,-258,-291},{-184,-190,-235,-204,-172,-284}},{{-116,-271,-130,-186,-128,-197},{-202,-246,-228,-159,-184,-121},{-177,-336,-260,-249,-246,-224},{-309,-112,-175,-282,-155,-177},{-166,-217,-123,-220,-305,-251},{-215,-130,-141,-134,-125,-222},{-119,-289,-168,-130,-240,-152},{-172,-128,-329,-264,-215,-220},{-220,-175,-278,-166,-282,-226},{-220,-146,-148,-217,-211,-181}},{{-280,-336,-264,-271,-157,-309},{-305,-287,-168,-146,-264,-262},{-112,-242,-112,-269,-320,-262},{-125,-179,-231,-307,-293,-309},{-125,-226,-284,-329,-233,-181},{-228,-150,-246,-164,-280,-302},{-336,-119,-166,-291,-237,-255},{-269,-155,-217,-271,-226,-323},{-157,-215,-190,-298,-224,-237},{-164,-166,-246,-242,-179,-170}},{{-244,-237,-329,-334,-329,-170},{-316,-137,-215,-231,-300,-184},{-195,-302,-130,-302,-123,-202},{-168,-130,-164,-211,-114,-204},{-114,-168,-166,-195,-177,-199},{-164,-141,-262,-161,-197,-246},{-307,-206,-282,-244,-228,-181},{-327,-307,-231,-166,-217,-271},{-325,-309,-193,-164,-293,-157},{-284,-130,-181,-119,-175,-121}},{{-226,-264,-233,-323,-228,-204},{-222,-240,-134,-208,-273,-150},{-161,-253,-318,-278,-204,-121},{-134,-128,-177,-195,-287,-134},{-155,-168,-141,-233,-287,-199},{-177,-132,-233,-325,-208,-287},{-273,-305,-116,-271,-336,-332},{-150,-262,-264,-320,-296,-134},{-132,-258,-208,-128,-246,-139},{-287,-314,-137,-119,-237,-114}}},{{{-169,-328,-267,-290,-121,-183},{-167,-226,-328,-300,-307,-236},{-162,-138,-226,-271,-200,-357},{-252,-205,-224,-350,-217,-207},{-190,-350,-283,-228,-347,-243},{-217,-140,-209,-228,-186,-350},{-145,-214,-278,-190,-221,-195},{-124,-224,-219,-233,-338,-150},{-186,-157,-188,-352,-295,-231},{-317,-340,-288,-357,-240,-207}},{{-336,-198,-193,-288,-186,-345},{-336,-209,-298,-226,-338,-214},{-171,-162,-257,-248,-267,-162},{-181,-181,-217,-174,-198,-355},{-252,-157,-264,-121,-340,-138},{-126,-257,-186,-224,-188,-262},{-164,-195,-274,-133,-345,-276},{-131,-233,-321,-331,-238,-207},{-171,-264,-352,-226,-190,-152},{-217,-198,-357,-319,-148,-309}},{{-131,-245,-159,-126,-262,-119},{-169,-121,-281,-248,-176,-145},{-143,-152,-243,-238,-314,-257},{-140,-159,-167,-121,-269,-293},{-214,-228,-295,-245,-264,-252},{-228,-290,-221,-148,-338,-190},{-200,-295,-224,-162,-143,-157},{-328,-288,-355,-317,-333,-293},{-295,-217,-164,-295,-250,-343},{-226,-121,-307,-283,-333,-257}},{{-198,-298,-321,-298,-319,-159},{-183,-178,-136,-226,-200,-129},{-152,-129,-252,-250,-312,-283},{-169,-150,-243,-167,-155,-159},{-347,-152,-274,-186,-288,-167},{-352,-343,-302,-162,-159,-133},{-278,-219,-290,-343,-350,-133},{-119,-233,-155,-121,-188,-343},{-131,-357,-205,-252,-312,-269},{-317,-271,-331,-200,-188,-143}},{{-205,-321,-267,-345,-178,-347},{-183,-267,-193,-314,-328,-259},{-269,-290,-167,-119,-252,-181},{-207,-133,-321,-169,-164,-281},{-150,-181,-131,-331,-328,-333},{-221,-350,-167,-350,-186,-309},{-307,-336,-167,-205,-129,-355},{-309,-321,-181,-319,-129,-205},{-264,-338,-321,-231,-240,-176},{-169,-129,-290,-131,-178,-145}},{{-200,-286,-283,-324,-148,-193},{-140,-355,-276,-264,-221,-129},{-262,-162,-200,-293,-171,-293},{-333,-271,-319,-183,-283,-281},{-324,-148,-126,-267,-145,-124},{-336,-209,-333,-152,-224,-169},{-138,-328,-298,-331,-188,-167},{-221,-286,-300,-317,-271,-193},{-262,-312,-274,-267,-331,-198},{-174,-326,-207,-274,-252,-324}}},{{{-240,-183,-210,-390,-259,-355},{-238,-177,-341,-284,-401,-347},{-339,-243,-330,-248,-232,-358},{-210,-161,-221,-289,-213,-147},{-205,-352,-295,-197,-213,-407},{-235,-243,-191,-235,-328,-401},{-197,-235,-243,-180,-292,-358},{-390,-177,-257,-169,-177,-344},{-281,-210,-349,-175,-404,-139},{-308,-246,-218,-300,-336,-191}},{{-238,-207,-273,-330,-396,-207},{-218,-147,-319,-325,-248,-276},{-341,-325,-257,-183,-169,-136},{-377,-232,-341,-251,-314,-287},{-210,-339,-142,-328,-371,-390},{-339,-136,-191,-273,-292,-292},{-224,-349,-180,-161,-360,-308},{-169,-180,-377,-248,-199,-169},{-238,-265,-257,-273,-390,-197},{-248,-210,-393,-175,-284,-188}},{{-300,-216,-377,-314,-390,-136},{-349,-210,-330,-169,-156,-382},{-308,-268,-303,-257,-379,-385},{-287,-205,-278,-161,-278,-366},{-197,-363,-207,-366,-164,-396},{-303,-349,-147,-292,-328,-186},{-139,-276,-197,-289,-401,-349},{-339,-292,-369,-371,-188,-407},{-156,-344,-360,-251,-371,-150},{-284,-248,-401,-328,-308,-366}},{{-213,-300,-407,-235,-227,-180},{-139,-333,-306,-407,-136,-325},{-303,-292,-147,-333,-369,-153},{-410,-371,-295,-194,-235,-145},{-322,-153,-404,-303,-235,-363},{-344,-221,-172,-254,-295,-246},{-371,-292,-238,-360,-399,-273},{-281,-347,-360,-352,-167,-172},{-167,-298,-136,-314,-142,-218},{-221,-377,-287,-308,-136,-410}},{{-248,-210,-147,-284,-188,-251},{-158,-254,-145,-404,-374,-289},{-377,-325,-317,-388,-262,-303},{-254,-396,-300,-238,-164,-300},{-240,-347,-300,-303,-371,-180},{-205,-410,-295,-407,-289,-339},{-298,-278,-177,-169,-238,-374},{-273,-333,-221,-164,-369,-136},{-235,-311,-229,-139,-259,-224},{-139,-339,-292,-169,-319,-158}},{{-377,-183,-257,-227,-341,-300},{-224,-238,-229,-322,-199,-355},{-156,-139,-360,-156,-150,-183},{-172,-278,-399,-390,-306,-229},{-393,-243,-248,-289,-243,-205},{-224,-407,-371,-227,-180,-251},{-404,-355,-243,-246,-371,-360},{-319,-268,-164,-399,-396,-205},{-235,-328,-177,-314,-371,-322},{-136,-388,-150,-232,-175,-347}}},{{{-209,-214,-146,-137,-205,-80},{-156,-129,-196,-229,-192,-119},{-126,-116,-99,-136,-102,-156},{-102,-100,-174,-211,-206,-128},{-112,-95,-213,-102,-206,-168},{-197,-225,-188,-189,-211,-134},{-188,-208,-108,-231,-123,-111},{-199,-191,-136,-86,-177,-80},{-203,-154,-200,-156,-126,-169},{-191,-194,-106,-157,-179,-117}},{{-148,-219,-134,-189,-134,-166},{-129,-214,-128,-123,-85,-160},{-206,-102,-97,-85,-122,-196},{-91,-145,-183,-168,-202,-112},{-157,-163,-108,-179,-206,-142},{-100,-142,-154,-92,-174,-86},{-156,-220,-177,-148,-223,-169},{-125,-159,-196,-103,-231,-231},{-137,-154,-197,-111,-188,-125},{-80,-199,-194,-152,-219,-139}},{{-194,-197,-143,-154,-111,-108},{-95,-203,-217,-132,-165,-179},{-168,-220,-231,-94,-119,-139},{-117,-91,-100,-149,-95,-146},{-92,-140,-148,-183,-197,-159},{-185,-211,-197,-154,-106,-149},{-163,-189,-186,-91,-165,-92},{-92,-219,-125,-183,-140,-196},{-200,-83,-200,-103,-171,-82},{-148,-143,-105,-111,-137,-223}},{{-152,-125,-186,-89,-172,-131},{-126,-99,-142,-182,-159,-132},{-186,-225,-196,-88,-134,-169},{-139,-99,-157,-79,-114,-125},{-202,-152,-146,-108,-202,-134},{-152,-228,-131,-119,-94,-88},{-194,-165,-102,-159,-111,-160},{-182,-111,-89,-94,-209,-202},{-137,-102,-116,-226,-154,-119},{-225,-126,-197,-220,-139,-114}},{{-222,-148,-179,-143,-185,-225},{-169,-108,-214,-134,-125,-211},{-97,-200,-131,-220,-172,-89},{-160,-160,-137,-146,-82,-200},{-174,-92,-172,-171,-211,-137},{-88,-209,-199,-129,-160,-86},{-149,-99,-102,-134,-131,-112},{-79,-203,-222,-120,-160,-134},{-219,-77,-122,-140,-194,-105},{-231,-99,-154,-163,-180,-211}},{{-80,-132,-131,-88,-152,-103},{-152,-83,-99,-163,-180,-209},{-220,-176,-194,-192,-149,-192},{-217,-191,-226,-100,-222,-189},{-112,-137,-206,-191,-142,-225},{-166,-139,-191,-99,-97,-105},{-159,-172,-192,-199,-174,-120},{-80,-214,-139,-111,-122,-132},{-163,-119,-172,-226,-194,-143},{-86,-123,-146,-134,-191,-102}}},{{{-109,-177,-253,-248,-255,-144},{-204,-198,-109,-224,-93,-273},{-133,-100,-271,-180,-120,-226},{-242,-264,-271,-151,-118,-186},{-224,-193,-124,-93,-204,-257},{-189,-131,-129,-109,-136,-102},{-171,-271,-209,-244,-106,-231},{-178,-242,-167,-248,-229,-248},{-113,-264,-133,-100,-158,-186},{-107,-149,-136,-106,-187,-118}},{{-211,-215,-191,-264,-146,-258},{-268,-260,-238,-237,-269,-197},{-271,-135,-211,-111,-271,-144},{-104,-146,-266,-126,-136,-266},{-228,-142,-158,-102,-104,-197},{-169,-157,-138,-164,-118,-260},{-162,-193,-269,-228,-249,-93},{-164,-169,-217,-96,-113,-164},{-178,-211,-126,-249,-95,-195},{-106,-157,-149,-122,-228,-197}},{{-233,-175,-228,-191,-153,-133},{-124,-269,-249,-151,-222,-249},{-189,-104,-246,-142,-124,-153},{-260,-146,-215,-100,-235,-217},{-195,-211,-202,-136,-268,-178},{-138,-231,-158,-153,-122,-271},{-153,-184,-207,-231,-122,-115},{-151,-209,-249,-235,-229,-189},{-118,-248,-231,-262,-171,-211},{-200,-264,-231,-140,-269,-107}},{{-180,-195,-198,-238,-146,-118},{-126,-98,-244,-135,-204,-193},{-166,-173,-146,-116,-273,-235},{-238,-229,-151,-151,-111,-116},{-129,-115,-153,-153,-131,-113},{-211,-193,-131,-271,-193,-200},{-158,-255,-258,-149,-217,-157},{-107,-262,-127,-96,-171,-146},{-151,-116,-162,-164,-155,-235},{-142,-262,-98,-257,-100,-246}},{{-149,-207,-91,-189,-98,-100},{-173,-153,-228,-102,-248,-242},{-233,-178,-228,-217,-191,-242},{-173,-260,-169,-180,-91,-217},{-91,-184,-262,-233,-253,-151},{-209,-220,-138,-231,-177,-155},{-266,-235,-193,-153,-136,-269},{-186,-122,-211,-249,-109,-222},{-146,-95,-91,-164,-107,-113},{-249,-166,-158,-222,-164,-182}},{{-95,-120,-184,-235,-138,-136},{-253,-253,-115,-118,-229,-129},{-251,-257,-169,-220,-262,-118},{-242,-211,-162,-213,-136,-151},{-164,-100,-93,-260,-226,-178},{-171,-100,-248,-248,-173,-187},{-264,-120,-171,-191,-93,-118},{-104,-129,-96,-200,-184,-124},{-109,-164,-264,-122,-177,-255},{-266,-116,-100,-222,-98,-269}}},{{{-211,-336,-142,-247,-181,-257},{-350,-267,-250,-184,-181,-147},{-311,-316,-162,-223,-314,-360},{-318,-125,-301,-240,-311,-169},{-230,-157,-292,-157,-267,-216},{-252,-326,-125,-198,-137,-331},{-294,-262,-274,-142,-201,-140},{-238,-176,-184,-184,-252,-328},{-274,-191,-147,-186,-255,-243},{-326,-127,-257,-194,-208,-184}},{{-225,-164,-284,-186,-318,-157},{-127,-213,-306,-294,-167,-223},{-323,-157,-348,-154,-365,-213},{-336,-265,-154,-309,-257,-223},{-336,-208,-122,-318,-338,-194},{-130,-270,-137,-294,-314,-208},{-299,-365,-235,-245,-345,-198},{-162,-267,-225,-218,-198,-245},{-147,-147,-230,-122,-147,-304},{-201,-149,-220,-135,-250,-220}},{{-203,-238,-167,-267,-122,-267},{-247,-189,-140,-265,-149,-230},{-198,-267,-328,-316,-289,-147},{-316,-140,-323,-274,-176,-181},{-203,-345,-181,-247,-211,-309},{-147,-355,-331,-318,-228,-365},{-142,-289,-247,-365,-360,-326},{-255,-321,-294,-265,-201,-172},{-169,-213,-255,-272,-277,-265},{-309,-122,-365,-294,-181,-306}},{{-245,-194,-282,-189,-296,-218},{-318,-135,-140,-137,-348,-130},{-162,-172,-311,-304,-189,-132},{-122,-213,-294,-140,-130,-162},{-289,-233,-282,-203,-147,-198},{-265,-309,-186,-145,-157,-270},{-304,-345,-292,-284,-130,-333},{-164,-348,-363,-243,-172,-323},{-353,-176,-127,-169,-130,-194},{-331,-279,-262,-277,-245,-304}},{{-206,-225,-282,-149,-233,-122},{-194,-235,-306,-287,-363,-247},{-216,-277,-184,-363,-172,-257},{-140,-287,-167,-176,-169,-314},{-135,-216,-265,-203,-323,-358},{-184,-272,-358,-130,-343,-341},{-198,-174,-353,-265,-238,-184},{-135,-172,-282,-211,-174,-169},{-257,-294,-223,-198,-142,-196},{-365,-184,-309,-282,-338,-179}},{{-145,-323,-191,-272,-279,-157},{-220,-159,-314,-137,-243,-228},{-208,-284,-257,-135,-142,-272},{-130,-336,-333,-132,-350,-176},{-287,-228,-274,-220,-338,-311},{-176,-238,-211,-299,-201,-140},{-321,-203,-353,-336,-125,-265},{-274,-189,-216,-360,-243,-233},{-233,-345,-211,-240,-208,-318},{-225,-211,-309,-162,-274,-225}}},{{{-270,-291,-275,-307,-169,-344},{-150,-344,-141,-120,-155,-127},{-162,-217,-303,-196,-206,-222},{-263,-157,-155,-185,-256,-321},{-187,-226,-187,-229,-164,-328},{-173,-136,-224,-314,-282,-148},{-282,-298,-148,-240,-245,-270},{-166,-219,-337,-275,-259,-273},{-226,-240,-252,-316,-219,-326},{-323,-346,-120,-141,-148,-245}},{{-192,-245,-346,-180,-194,-219},{-127,-219,-284,-303,-173,-284},{-176,-263,-240,-125,-333,-245},{-182,-127,-263,-291,-286,-328},{-316,-243,-261,-307,-136,-178},{-125,-166,-303,-189,-326,-136},{-180,-256,-284,-148,-118,-226},{-169,-201,-333,-122,-284,-268},{-305,-282,-335,-196,-213,-208},{-298,-314,-132,-231,-280,-157}},{{-326,-270,-215,-157,-166,-129},{-122,-217,-326,-136,-275,-192},{-340,-162,-330,-173,-203,-296},{-199,-282,-231,-141,-314,-210},{-298,-314,-208,-224,-136,-173},{-273,-282,-134,-125,-182,-289},{-254,-240,-259,-148,-208,-166},{-231,-139,-240,-286,-134,-208},{-307,-254,-226,-159,-226,-303},{-328,-261,-196,-319,-284,-323}},{{-129,-231,-229,-340,-194,-256},{-136,-291,-263,-210,-254,-224},{-273,-263,-219,-231,-143,-118},{-340,-240,-132,-178,-152,-312},{-254,-219,-326,-256,-340,-286},{-127,-187,-120,-150,-185,-136},{-346,-280,-146,-261,-289,-187},{-141,-169,-152,-155,-152,-289},{-342,-178,-120,-296,-300,-243},{-215,-333,-157,-141,-243,-187}},{{-249,-245,-256,-136,-213,-284},{-280,-122,-199,-321,-326,-305},{-259,-199,-148,-293,-256,-312},{-215,-323,-333,-134,-280,-266},{-300,-222,-335,-187,-189,-314},{-247,-132,-118,-226,-164,-252},{-326,-217,-289,-178,-125,-180},{-300,-132,-185,-307,-263,-254},{-129,-268,-296,-245,-298,-231},{-203,-335,-280,-266,-129,-346}},{{-328,-261,-222,-240,-206,-245},{-335,-213,-273,-277,-240,-293},{-236,-326,-233,-166,-286,-252},{-159,-192,-226,-319,-208,-298},{-215,-157,-231,-289,-247,-238},{-259,-291,-139,-143,-270,-148},{-314,-259,-337,-240,-194,-268},{-152,-249,-268,-178,-180,-330},{-231,-148,-333,-192,-222,-118},{-189,-319,-143,-344,-127,-213}}},{{{-438,-291,-159,-379,-362,-344},{-329,-379,-291,-373,-194,-323},{-335,-329,-412,-429,-159,-218},{-241,-194,-179,-156,-335,-376},{-347,-426,-212,-165,-347,-159},{-438,-359,-388,-229,-223,-306},{-168,-288,-335,-338,-341,-285},{-229,-276,-429,-409,-294,-200},{-244,-156,-273,-241,-344,-382},{-315,-379,-329,-315,-182,-250}},{{-182,-156,-409,-297,-435,-306},{-303,-282,-373,-188,-420,-229},{-273,-194,-238,-253,-259,-406},{-332,-385,-423,-417,-341,-382},{-315,-397,-238,-197,-312,-400},{-238,-376,-326,-391,-250,-273},{-394,-391,-409,-288,-429,-173},{-218,-400,-394,-156,-373,-226},{-382,-441,-303,-215,-212,-235},{-420,-206,-323,-365,-306,-229}},{{-391,-409,-356,-191,-335,-185},{-256,-373,-435,-365,-426,-235},{-244,-194,-223,-335,-197,-273},{-159,-379,-309,-197,-182,-365},{-259,-397,-215,-432,-300,-262},{-309,-256,-338,-226,-194,-200},{-391,-288,-397,-423,-185,-326},{-373,-185,-438,-323,-359,-247},{-173,-179,-282,-147,-391,-394},{-218,-268,-247,-179,-323,-394}},{{-394,-312,-244,-256,-312,-173},{-415,-291,-291,-235,-153,-259},{-309,-259,-294,-379,-203,-176},{-250,-188,-382,-309,-200,-165},{-441,-323,-212,-253,-426,-332},{-356,-203,-173,-326,-226,-297},{-318,-162,-338,-285,-344,-391},{-385,-359,-173,-194,-279,-341},{-285,-185,-226,-335,-282,-397},{-179,-373,-394,-147,-220,-297}},{{-162,-426,-162,-173,-218,-294},{-438,-344,-432,-197,-376,-397},{-265,-288,-265,-400,-326,-376},{-171,-409,-403,-212,-320,-341},{-400,-429,-232,-235,-276,-282},{-403,-297,-191,-379,-379,-326},{-394,-165,-191,-432,-206,-379},{-391,-347,-238,-182,-362,-320},{-218,-417,-226,-279,-353,-223},{-397,-259,-265,-409,-397,-241}},{{-176,-397,-300,-176,-185,-391},{-356,-423,-176,-329,-365,-194},{-262,-397,-370,-341,-241,-406},{-188,-291,-309,-415,-344,-426},{-435,-215,-312,-244,-182,-241},{-162,-285,-206,-426,-165,-150},{-323,-335,-176,-182,-262,-335},{-276,-426,-244,-182,-315,-429},{-209,-306,-165,-344,-171,-341},{-179,-376,-353,-165,-165,-171}}}}; // supply (positive for supply and negative for demand) under different scenarios 
int iniv[I]={1841,192,221,150,198,208,315,198,294}; // initial inventory 
int ubiv[I]={2104,384,442,300,396,416,630,396,588}; // 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.32,8.46,5.6,4.24,2.89,1.51,4.53,7.74}; // 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.11,7.69,5.09,3.85,2.63,1.37,4.12,7.04}}; // 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.69,9.69,9.69,8.48,8.48,8.48,7.27,7.27,7.27,6.15,6.15,6.15,5.38,5.38,5.38,4.61,4.61,4.61,4.07,4.07,4.07,3.56,3.56,3.56,3.05,3.05,3.05,3.08,3.08,3.08,2.7,2.7,2.7,2.31,2.31,2.31,2.1,2.1,2.1,1.84,1.84,1.84,1.58,1.58,1.58,1.1,1.1,1.1,0.96,0.96,0.96,0.82,0.82,0.82,3.3,3.3,3.3,2.88,2.88,2.88,2.47,2.47,2.47,5.63,5.63,5.63,4.93,4.93,4.93,4.22,4.22,4.22}; // 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]={15,8,6,15,8,5,15,8,5,16,8,6,17,8,6,16,9,6,17,9,6,16,8,6,16,8,6,16,8,6,17,9,6,17,9,6,17,9,6,18,9,6,18,9,6,17,9,6,17,9,6,18,9,6,16,9,6,17,9,6,17,9,6,16,9,6,16,8,6,16,8,6}; // 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,351,352,353,354,355,356},{357,358,359,360,361,362},{363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379},{380,381,382,383,384,385,386,387,388},{389,390,391,392,393,394},{395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412},{413,414,415,416,417,418,419,420,421},{422,423,424,425,426,427},{428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445},{446,447,448,449,450,451,452,453,454},{455,456,457,458,459,460},{461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477},{478,479,480,481,482,483,484,485,486},{487,488,489,490,491,492},{493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509},{510,511,512,513,514,515,516,517,518},{519,520,521,522,523,524},{525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542},{543,544,545,546,547,548,549,550,551},{552,553,554,555,556,557},{558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573},{574,575,576,577,578,579,580,581,582},{583,584,585,586,587,588},{589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605},{606,607,608,609,610,611,612,613,614},{615,616,617,618,619,620},{621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637},{638,639,640,641,642,643,644,645,646},{647,648,649,650,651,652},{653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668},{669,670,671,672,673,674,675,676,677},{678,679,680,681,682,683},{684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699},{700,701,702,703,704,705,706,707},{708,709,710,711,712,713},{714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729},{730,731,732,733,734,735,736,737},{738,739,740,741,742,743}}; // set of shipments in each bid 
int SHsts[SPN]={2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,2,6,10,14,18,22,26,30,0,6,12,18,24,30,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,1,5,9,13,17,21,25,29,1,7,13,19,25,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,0,4,8,12,16,20,24,28,2,8,14,20,26,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,1,5,9,13,17,21,25,29,0,6,12,18,24,30,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,1,5,9,13,17,21,25,29,2,8,14,20,26,32,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,0,4,8,12,16,20,24,28,32,0,6,12,18,24,30,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,0,4,8,12,16,20,24,28,32,2,8,14,20,26,32,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,2,6,10,14,18,22,26,30,1,7,13,19,25,31,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,2,6,10,14,18,22,26,30,2,8,14,20,26,32,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,2,6,10,14,18,22,26,30,1,7,13,19,25,31,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,1,5,9,13,17,21,25,29,33,0,6,12,18,24,30,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,1,5,9,13,17,21,25,29,33,1,7,13,19,25,31,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,2,6,10,14,18,22,26,30,34,2,8,14,20,26,32,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,1,5,9,13,17,21,25,29,33,1,7,13,19,25,31,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,0,4,8,12,16,20,24,28,32,2,8,14,20,26,32,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,2,6,10,14,18,22,26,30,34,0,6,12,18,24,30,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,2,6,10,14,18,22,26,30,34,1,7,13,19,25,31,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,0,4,8,12,16,20,24,28,32,2,8,14,20,26,32,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,4,8,12,16,20,24,28,32,2,8,14,20,26,32,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,4,8,12,16,20,24,28,32,1,7,13,19,25,31,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,4,8,12,16,20,24,28,32,0,6,12,18,24,30,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,0,4,8,12,16,20,24,28,32,1,7,13,19,25,31,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,1,5,9,13,17,21,25,29,2,8,14,20,26,32,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,1,5,9,13,17,21,25,29,2,8,14,20,26,32}; // set of start times of each shipment 
int SHets[SPN]={7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,7,11,15,19,23,27,31,35,5,11,17,23,29,35,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,6,10,14,18,22,26,30,34,6,12,18,24,30,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,5,9,13,17,21,25,29,33,7,13,19,25,31,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,4,8,12,16,20,24,28,32,3,9,15,21,27,33,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,4,8,12,16,20,24,28,32,5,11,17,23,29,35,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3,7,11,15,19,23,27,31,35,3,9,15,21,27,33,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,2,6,10,14,18,22,26,30,34,4,10,16,22,28,34,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,4,8,12,16,20,24,28,32,3,9,15,21,27,33,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,4,8,12,16,20,24,28,32,4,10,16,22,28,34,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,4,8,12,16,20,24,28,32,3,9,15,21,27,33,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,3,7,11,15,19,23,27,31,35,2,8,14,20,26,32,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,3,7,11,15,19,23,27,31,35,3,9,15,21,27,33,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3,7,11,15,19,23,27,31,35,3,9,15,21,27,33,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,2,6,10,14,18,22,26,30,34,2,8,14,20,26,32,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,1,5,9,13,17,21,25,29,33,3,9,15,21,27,33,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,3,7,11,15,19,23,27,31,35,1,7,13,19,25,31,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3,7,11,15,19,23,27,31,35,2,8,14,20,26,32,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,1,5,9,13,17,21,25,29,33,3,9,15,21,27,33,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,2,6,10,14,18,22,26,30,34,4,10,16,22,28,34,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,2,6,10,14,18,22,26,30,34,3,9,15,21,27,33,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,2,6,10,14,18,22,26,30,34,2,8,14,20,26,32,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3,7,11,15,19,23,27,31,35,4,10,16,22,28,34,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,4,8,12,16,20,24,28,32,5,11,17,23,29,35,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,4,8,12,16,20,24,28,32,5,11,17,23,29,35}; // set of end times of each shipment 
