int Dev = 30;// Deviation
extern const int CNN = 1;// 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 = 344;//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]={{{{11441,0,0,0,0,0},{11023,0,0,0,0,0},{11268,0,0,0,0,0},{11245,0,0,0,0,0},{11293,0,0,0,0,0},{11682,0,0,0,0,0},{11958,0,0,0,0,0},{11378,0,0,0,0,0},{11221,0,0,0,0,0},{11508,0,0,0,0,0},{11215,0,0,0,0,0},{11536,0,0,0,0,0},{11434,0,0,0,0,0},{11683,0,0,0,0,0},{11365,0,0,0,0,0},{11026,0,0,0,0,0},{11553,0,0,0,0,0},{11286,0,0,0,0,0},{12373,0,0,0,0,0},{11526,0,0,0,0,0}},{{11275,0,0,0,0,0},{11392,0,0,0,0,0},{11429,0,0,0,0,0},{11911,0,0,0,0,0},{11761,0,0,0,0,0},{11578,0,0,0,0,0},{11524,0,0,0,0,0},{11286,0,0,0,0,0},{10826,0,0,0,0,0},{11441,0,0,0,0,0},{11920,0,0,0,0,0},{11390,0,0,0,0,0},{11175,0,0,0,0,0},{11105,0,0,0,0,0},{11233,0,0,0,0,0},{11869,0,0,0,0,0},{11903,0,0,0,0,0},{11577,0,0,0,0,0},{11833,0,0,0,0,0},{11357,0,0,0,0,0}},{{11610,0,0,0,0,0},{11316,0,0,0,0,0},{11673,0,0,0,0,0},{11423,0,0,0,0,0},{11718,0,0,0,0,0},{11286,0,0,0,0,0},{11687,0,0,0,0,0},{11378,0,0,0,0,0},{10755,0,0,0,0,0},{11278,0,0,0,0,0},{11738,0,0,0,0,0},{11356,0,0,0,0,0},{11873,0,0,0,0,0},{10994,0,0,0,0,0},{11524,0,0,0,0,0},{11876,0,0,0,0,0},{11534,0,0,0,0,0},{10909,0,0,0,0,0},{11222,0,0,0,0,0},{11454,0,0,0,0,0}}},{{{-148,-203,-201,-142,-193,-148},{-223,-146,-189,-146,-158,-197},{-235,-193,-205,-219,-189,-209},{-260,-154,-205,-148,-203,-175},{-164,-158,-144,-242,-219,-168},{-250,-256,-191,-142,-164,-168},{-189,-246,-160,-199,-203,-191},{-154,-227,-205,-152,-252,-166},{-154,-213,-168,-181,-256,-148},{-238,-231,-205,-240,-229,-252},{-201,-223,-148,-193,-154,-181},{-185,-242,-146,-213,-203,-242},{-150,-166,-189,-207,-242,-154},{-250,-154,-217,-199,-248,-189},{-152,-160,-221,-201,-183,-211},{-156,-150,-227,-248,-187,-160},{-244,-154,-246,-250,-250,-240},{-164,-244,-221,-199,-181,-213},{-250,-152,-264,-238,-252,-260},{-250,-225,-158,-254,-250,-164}},{{-179,-160,-240,-152,-256,-233},{-193,-225,-171,-166,-248,-248},{-235,-171,-238,-254,-187,-173},{-231,-264,-260,-195,-156,-231},{-240,-260,-179,-238,-168,-164},{-219,-254,-187,-246,-189,-207},{-229,-152,-195,-260,-146,-233},{-187,-154,-183,-179,-150,-254},{-173,-154,-219,-227,-231,-219},{-240,-229,-235,-193,-209,-142},{-160,-171,-183,-215,-229,-248},{-162,-205,-156,-250,-221,-211},{-160,-189,-156,-217,-264,-258},{-193,-160,-189,-252,-240,-244},{-156,-185,-164,-187,-179,-225},{-233,-235,-215,-219,-205,-264},{-191,-193,-217,-246,-185,-142},{-211,-229,-158,-152,-197,-227},{-229,-246,-225,-246,-211,-191},{-195,-238,-189,-223,-150,-191}},{{-162,-197,-207,-254,-217,-225},{-189,-207,-262,-173,-175,-219},{-252,-197,-223,-242,-166,-166},{-199,-201,-154,-248,-150,-144},{-183,-183,-244,-154,-158,-203},{-221,-152,-142,-229,-217,-254},{-175,-223,-254,-227,-156,-242},{-223,-225,-227,-233,-209,-233},{-219,-209,-193,-246,-144,-189},{-164,-242,-142,-231,-201,-142},{-205,-238,-264,-154,-203,-258},{-203,-201,-215,-229,-195,-246},{-240,-156,-158,-173,-240,-207},{-250,-156,-225,-187,-152,-199},{-173,-225,-213,-179,-242,-246},{-201,-238,-229,-258,-175,-213},{-197,-205,-264,-142,-152,-173},{-187,-146,-219,-233,-171,-181},{-146,-150,-189,-215,-215,-240},{-223,-252,-260,-252,-152,-158}}},{{{-192,-122,-196,-113,-147,-126},{-184,-209,-126,-118,-177,-155},{-129,-134,-206,-130,-184,-145},{-185,-204,-164,-124,-164,-169},{-161,-182,-151,-182,-193,-143},{-171,-164,-209,-163,-113,-129},{-124,-177,-200,-147,-122,-147},{-190,-195,-130,-201,-145,-153},{-155,-124,-126,-124,-193,-114},{-158,-195,-171,-151,-203,-195},{-116,-114,-200,-132,-164,-126},{-166,-190,-126,-209,-126,-193},{-184,-159,-198,-163,-206,-166},{-126,-150,-163,-190,-142,-164},{-200,-151,-145,-208,-206,-208},{-159,-119,-198,-161,-129,-138},{-137,-155,-192,-198,-163,-116},{-155,-137,-116,-130,-169,-179},{-203,-145,-198,-132,-195,-163},{-116,-137,-204,-208,-193,-200}},{{-175,-204,-122,-130,-192,-179},{-175,-116,-175,-161,-174,-135},{-163,-203,-127,-129,-161,-175},{-190,-137,-124,-166,-116,-129},{-180,-121,-188,-169,-190,-134},{-192,-150,-129,-196,-164,-145},{-118,-180,-198,-145,-132,-192},{-164,-195,-172,-148,-174,-193},{-193,-209,-208,-169,-114,-138},{-182,-156,-145,-177,-147,-127},{-198,-180,-192,-185,-204,-130},{-147,-200,-196,-161,-158,-140},{-119,-159,-187,-163,-159,-192},{-134,-192,-147,-134,-190,-172},{-143,-169,-137,-174,-138,-196},{-209,-177,-184,-203,-188,-145},{-187,-206,-188,-126,-155,-142},{-192,-156,-201,-166,-156,-208},{-121,-190,-171,-177,-190,-155},{-127,-159,-153,-150,-204,-175}},{{-114,-179,-174,-195,-200,-185},{-158,-127,-190,-142,-137,-156},{-177,-159,-116,-166,-137,-180},{-156,-118,-182,-182,-201,-193},{-140,-177,-140,-126,-156,-142},{-177,-184,-148,-150,-177,-119},{-196,-118,-143,-188,-209,-159},{-145,-188,-188,-118,-122,-147},{-113,-163,-119,-114,-209,-127},{-182,-142,-122,-121,-127,-190},{-204,-134,-114,-124,-208,-190},{-188,-184,-127,-127,-193,-167},{-137,-171,-155,-182,-163,-172},{-148,-206,-137,-142,-161,-142},{-135,-203,-116,-124,-130,-193},{-198,-209,-134,-159,-151,-164},{-161,-150,-195,-206,-171,-195},{-158,-124,-116,-134,-185,-140},{-142,-179,-182,-137,-135,-155},{-121,-192,-164,-134,-167,-163}}},{{{-222,-229,-169,-171,-266,-252},{-178,-298,-293,-273,-263,-284},{-282,-219,-233,-273,-210,-243},{-169,-298,-217,-289,-298,-189},{-203,-166,-199,-236,-210,-229},{-256,-217,-296,-259,-217,-231},{-280,-282,-284,-176,-233,-176},{-270,-266,-293,-166,-164,-231},{-259,-185,-176,-277,-296,-178},{-196,-252,-282,-178,-171,-182},{-261,-166,-162,-238,-243,-203},{-240,-210,-199,-182,-194,-182},{-284,-231,-173,-291,-259,-261},{-231,-189,-169,-224,-277,-249},{-176,-210,-215,-178,-217,-206},{-277,-247,-180,-178,-169,-296},{-284,-219,-182,-203,-226,-298},{-289,-166,-293,-247,-233,-282},{-233,-252,-275,-291,-185,-261},{-171,-192,-178,-203,-256,-247}},{{-229,-256,-291,-296,-187,-180},{-229,-219,-217,-298,-173,-293},{-219,-208,-180,-192,-222,-289},{-291,-296,-300,-300,-254,-229},{-217,-261,-252,-280,-282,-284},{-192,-215,-277,-296,-210,-217},{-185,-185,-240,-249,-266,-208},{-270,-222,-286,-171,-240,-229},{-247,-169,-169,-162,-256,-236},{-224,-249,-243,-229,-261,-270},{-231,-259,-270,-215,-282,-171},{-298,-277,-280,-185,-245,-208},{-213,-162,-162,-162,-268,-182},{-296,-199,-233,-229,-293,-243},{-282,-266,-247,-261,-166,-273},{-298,-273,-289,-182,-282,-243},{-199,-289,-243,-254,-231,-249},{-256,-194,-268,-194,-245,-245},{-282,-219,-240,-215,-268,-238},{-266,-231,-240,-166,-296,-164}},{{-291,-166,-289,-245,-173,-171},{-189,-180,-194,-192,-261,-224},{-173,-247,-286,-243,-176,-280},{-173,-293,-224,-196,-280,-270},{-247,-282,-169,-208,-259,-263},{-164,-215,-296,-300,-203,-247},{-215,-266,-298,-176,-217,-263},{-240,-217,-185,-261,-173,-247},{-166,-254,-289,-169,-256,-273},{-275,-185,-226,-252,-236,-178},{-236,-236,-215,-270,-222,-247},{-164,-231,-277,-236,-259,-187},{-229,-236,-282,-229,-268,-286},{-270,-300,-162,-266,-268,-217},{-189,-182,-238,-196,-261,-176},{-245,-298,-180,-263,-266,-236},{-266,-273,-256,-236,-268,-210},{-213,-164,-182,-217,-173,-300},{-171,-298,-256,-247,-185,-293},{-286,-189,-201,-293,-166,-176}}},{{{-163,-282,-202,-200,-243,-176},{-171,-230,-204,-176,-169,-171},{-269,-180,-171,-241,-239,-206},{-156,-152,-193,-178,-228,-250},{-187,-269,-276,-163,-197,-176},{-278,-239,-184,-202,-221,-271},{-258,-169,-241,-189,-260,-282},{-278,-180,-178,-174,-254,-217},{-213,-206,-234,-182,-273,-171},{-263,-202,-221,-200,-189,-269},{-191,-180,-230,-234,-273,-273},{-161,-278,-234,-167,-210,-232},{-224,-167,-232,-161,-208,-265},{-208,-217,-187,-158,-176,-273},{-245,-182,-215,-202,-254,-154},{-163,-158,-176,-213,-187,-154},{-171,-204,-276,-204,-250,-267},{-197,-182,-167,-247,-202,-217},{-197,-215,-278,-263,-250,-184},{-206,-202,-176,-276,-176,-280}},{{-208,-152,-156,-245,-267,-276},{-252,-271,-245,-152,-237,-158},{-197,-228,-237,-152,-243,-161},{-167,-182,-269,-193,-271,-247},{-271,-232,-171,-263,-258,-252},{-204,-161,-267,-152,-271,-276},{-208,-252,-280,-169,-182,-250},{-206,-158,-197,-267,-169,-178},{-202,-161,-228,-215,-184,-269},{-226,-213,-206,-208,-224,-234},{-247,-280,-245,-269,-204,-204},{-158,-208,-174,-161,-269,-234},{-254,-161,-156,-208,-180,-217},{-243,-254,-156,-180,-213,-178},{-189,-195,-228,-178,-250,-217},{-171,-219,-221,-197,-167,-230},{-273,-278,-260,-258,-256,-232},{-267,-187,-182,-195,-241,-237},{-161,-202,-161,-252,-187,-178},{-267,-167,-197,-165,-228,-210}},{{-191,-180,-189,-258,-252,-232},{-202,-267,-165,-169,-217,-271},{-217,-206,-269,-232,-226,-195},{-232,-178,-263,-224,-258,-263},{-256,-243,-169,-241,-228,-161},{-252,-152,-217,-163,-280,-195},{-260,-245,-210,-213,-156,-260},{-219,-245,-204,-254,-182,-213},{-208,-182,-158,-161,-219,-178},{-195,-237,-256,-260,-252,-193},{-154,-158,-193,-202,-267,-237},{-232,-197,-154,-213,-165,-237},{-197,-217,-230,-184,-237,-210},{-169,-200,-195,-169,-163,-180},{-191,-224,-176,-267,-273,-237},{-169,-267,-156,-278,-247,-215},{-165,-280,-250,-165,-215,-269},{-252,-269,-250,-193,-230,-197},{-265,-163,-195,-213,-167,-237},{-174,-174,-245,-184,-217,-191}}},{{{-247,-231,-207,-287,-218,-311},{-239,-223,-338,-210,-194,-247},{-239,-205,-269,-207,-258,-317},{-197,-192,-293,-197,-271,-207},{-285,-200,-303,-229,-325,-221},{-263,-255,-335,-189,-343,-226},{-269,-229,-213,-245,-231,-247},{-327,-247,-200,-186,-269,-293},{-306,-253,-285,-242,-338,-218},{-221,-263,-231,-205,-322,-231},{-189,-231,-223,-255,-290,-338},{-263,-311,-295,-245,-335,-301},{-207,-218,-221,-319,-221,-234},{-322,-210,-202,-266,-274,-340},{-285,-290,-234,-186,-194,-231},{-253,-213,-200,-309,-306,-343},{-194,-298,-194,-253,-258,-261},{-207,-271,-317,-210,-263,-290},{-309,-263,-207,-319,-200,-205},{-242,-247,-194,-269,-253,-271}},{{-245,-322,-279,-261,-279,-274},{-237,-325,-340,-269,-186,-231},{-303,-274,-317,-213,-325,-332},{-266,-295,-274,-277,-346,-298},{-242,-197,-186,-221,-261,-202},{-226,-218,-200,-311,-218,-229},{-335,-239,-335,-314,-285,-255},{-287,-271,-287,-223,-234,-200},{-205,-186,-325,-223,-261,-189},{-285,-253,-255,-189,-231,-340},{-301,-306,-229,-303,-295,-261},{-335,-319,-200,-237,-197,-322},{-290,-231,-306,-340,-242,-258},{-218,-194,-279,-247,-197,-234},{-346,-229,-218,-200,-186,-266},{-261,-229,-271,-346,-325,-346},{-330,-237,-197,-271,-290,-207},{-215,-242,-263,-322,-285,-346},{-293,-279,-274,-340,-269,-301},{-213,-210,-303,-293,-317,-239}},{{-261,-298,-325,-340,-245,-189},{-295,-322,-306,-218,-234,-306},{-245,-325,-234,-202,-215,-335},{-200,-213,-282,-242,-343,-285},{-319,-218,-319,-205,-314,-231},{-293,-242,-245,-205,-282,-234},{-295,-295,-314,-314,-229,-200},{-245,-279,-200,-338,-200,-335},{-250,-213,-200,-282,-197,-282},{-271,-346,-266,-277,-189,-327},{-231,-266,-226,-247,-301,-293},{-330,-210,-327,-205,-207,-186},{-303,-325,-277,-346,-335,-330},{-239,-309,-295,-269,-330,-242},{-189,-271,-226,-269,-317,-338},{-261,-282,-239,-338,-194,-325},{-277,-205,-205,-200,-250,-234},{-263,-253,-226,-274,-200,-290},{-263,-239,-266,-340,-277,-293},{-338,-335,-218,-340,-279,-221}}},{{{-300,-305,-241,-344,-330,-311},{-235,-347,-291,-238,-300,-221},{-232,-246,-230,-347,-221,-263},{-350,-207,-258,-356,-339,-291},{-342,-339,-328,-280,-246,-288},{-311,-246,-221,-224,-305,-302},{-266,-258,-266,-319,-300,-314},{-361,-272,-347,-291,-210,-347},{-235,-207,-230,-311,-249,-336},{-221,-230,-336,-277,-277,-199},{-255,-297,-316,-333,-269,-230},{-353,-249,-258,-227,-361,-266},{-358,-347,-283,-342,-199,-280},{-302,-302,-328,-356,-294,-328},{-283,-328,-308,-316,-258,-280},{-358,-319,-302,-258,-224,-221},{-196,-202,-241,-238,-204,-230},{-291,-274,-241,-277,-319,-361},{-361,-288,-297,-302,-336,-336},{-283,-258,-308,-204,-297,-319}},{{-291,-199,-218,-199,-196,-260},{-328,-221,-244,-308,-288,-216},{-305,-280,-244,-347,-227,-249},{-361,-210,-255,-308,-311,-252},{-288,-249,-246,-202,-356,-342},{-269,-235,-288,-361,-277,-260},{-216,-280,-196,-294,-241,-328},{-266,-210,-230,-255,-364,-328},{-258,-266,-272,-196,-202,-302},{-207,-347,-344,-358,-210,-218},{-356,-269,-230,-216,-272,-316},{-210,-328,-244,-218,-202,-227},{-283,-241,-277,-294,-300,-336},{-266,-269,-258,-241,-342,-238},{-328,-353,-263,-218,-207,-336},{-344,-291,-246,-263,-207,-347},{-358,-364,-294,-364,-330,-218},{-274,-297,-216,-246,-297,-252},{-277,-358,-272,-308,-246,-241},{-263,-316,-266,-238,-364,-353}},{{-224,-311,-216,-336,-342,-272},{-350,-322,-297,-199,-336,-263},{-350,-308,-344,-238,-266,-308},{-333,-255,-308,-280,-216,-216},{-294,-347,-302,-356,-294,-316},{-227,-277,-358,-302,-339,-241},{-322,-255,-322,-199,-199,-364},{-260,-350,-283,-216,-244,-311},{-263,-274,-288,-277,-210,-302},{-249,-274,-244,-330,-235,-347},{-266,-344,-252,-199,-297,-252},{-210,-207,-350,-272,-361,-291},{-333,-347,-291,-252,-344,-330},{-218,-272,-263,-232,-221,-235},{-202,-241,-246,-302,-342,-311},{-283,-291,-241,-322,-286,-364},{-364,-252,-314,-288,-311,-249},{-218,-277,-258,-330,-339,-286},{-353,-227,-356,-210,-221,-353},{-224,-333,-196,-316,-339,-269}}},{{{-316,-361,-260,-344,-311,-297},{-288,-333,-224,-255,-213,-330},{-244,-288,-241,-336,-244,-255},{-263,-218,-269,-213,-272,-339},{-297,-252,-218,-204,-288,-333},{-291,-342,-342,-246,-294,-252},{-322,-361,-333,-347,-266,-344},{-274,-308,-210,-230,-230,-199},{-297,-252,-272,-316,-353,-330},{-350,-238,-202,-350,-221,-322},{-361,-272,-207,-325,-353,-255},{-260,-263,-325,-213,-316,-218},{-238,-202,-249,-269,-356,-216},{-344,-272,-328,-238,-325,-227},{-213,-364,-350,-322,-266,-280},{-356,-207,-210,-277,-269,-199},{-300,-356,-342,-350,-297,-221},{-204,-210,-319,-207,-241,-325},{-288,-260,-350,-339,-347,-213},{-280,-364,-342,-353,-336,-272}},{{-199,-350,-344,-297,-277,-207},{-294,-316,-350,-342,-258,-235},{-230,-199,-364,-274,-294,-196},{-213,-325,-238,-291,-300,-344},{-305,-238,-238,-319,-325,-204},{-272,-300,-294,-266,-322,-319},{-333,-232,-300,-308,-199,-283},{-319,-314,-330,-202,-204,-350},{-196,-199,-316,-356,-230,-204},{-316,-344,-232,-319,-202,-280},{-300,-224,-218,-328,-207,-356},{-339,-302,-258,-328,-196,-305},{-204,-266,-216,-230,-196,-344},{-238,-291,-199,-235,-246,-249},{-196,-244,-277,-252,-241,-199},{-361,-199,-199,-263,-325,-224},{-342,-319,-232,-221,-210,-328},{-358,-263,-314,-361,-258,-210},{-274,-322,-353,-311,-216,-308},{-196,-286,-263,-255,-227,-333}},{{-202,-221,-288,-216,-347,-358},{-353,-227,-230,-196,-342,-297},{-330,-302,-249,-196,-339,-246},{-246,-291,-300,-347,-224,-286},{-274,-238,-269,-314,-238,-336},{-241,-277,-353,-294,-280,-249},{-316,-269,-207,-272,-330,-227},{-232,-263,-328,-260,-238,-316},{-269,-213,-210,-364,-297,-235},{-277,-280,-263,-216,-333,-328},{-328,-322,-255,-272,-277,-358},{-249,-330,-364,-344,-232,-274},{-311,-244,-344,-227,-216,-204},{-252,-218,-260,-199,-213,-227},{-283,-319,-216,-347,-227,-277},{-246,-196,-308,-333,-241,-213},{-361,-204,-213,-213,-330,-218},{-252,-241,-263,-202,-322,-333},{-316,-314,-339,-241,-218,-269},{-221,-319,-255,-322,-353,-213}}},{{{-311,-227,-319,-263,-266,-328},{-235,-277,-218,-297,-246,-286},{-274,-258,-350,-246,-333,-221},{-336,-305,-218,-333,-291,-258},{-227,-302,-311,-227,-314,-316},{-263,-221,-333,-308,-218,-361},{-224,-350,-361,-314,-311,-333},{-347,-322,-347,-286,-221,-213},{-207,-241,-258,-263,-353,-263},{-235,-308,-244,-316,-314,-322},{-308,-269,-252,-207,-238,-336},{-294,-277,-330,-330,-230,-286},{-291,-361,-218,-213,-364,-288},{-358,-230,-202,-300,-232,-353},{-280,-291,-230,-232,-297,-347},{-342,-333,-221,-358,-252,-266},{-294,-347,-319,-364,-235,-230},{-246,-336,-353,-207,-280,-207},{-260,-325,-297,-294,-330,-311},{-207,-294,-322,-230,-196,-263}},{{-204,-300,-213,-339,-269,-288},{-241,-199,-300,-199,-232,-302},{-266,-328,-241,-342,-196,-339},{-218,-202,-280,-249,-342,-258},{-277,-328,-232,-344,-358,-347},{-325,-353,-227,-235,-344,-213},{-232,-280,-232,-244,-353,-356},{-216,-330,-207,-319,-356,-238},{-210,-330,-218,-294,-308,-328},{-260,-316,-252,-196,-216,-302},{-213,-353,-241,-358,-358,-238},{-260,-227,-325,-336,-283,-288},{-283,-280,-356,-258,-263,-333},{-330,-241,-202,-336,-305,-286},{-358,-358,-330,-230,-319,-274},{-204,-308,-272,-241,-330,-218},{-347,-255,-314,-238,-210,-227},{-305,-210,-339,-258,-269,-213},{-202,-244,-358,-199,-336,-297},{-221,-339,-196,-325,-330,-260}},{{-311,-213,-286,-255,-339,-269},{-202,-266,-218,-336,-286,-249},{-196,-316,-330,-350,-207,-311},{-218,-300,-255,-339,-204,-258},{-308,-356,-244,-230,-339,-325},{-328,-288,-202,-255,-207,-213},{-300,-218,-294,-342,-221,-314},{-277,-213,-342,-308,-196,-246},{-204,-199,-356,-232,-258,-322},{-199,-235,-263,-302,-255,-221},{-319,-221,-344,-280,-330,-325},{-210,-221,-353,-336,-216,-244},{-216,-364,-202,-196,-336,-241},{-316,-252,-361,-342,-288,-277},{-339,-364,-288,-322,-255,-244},{-316,-336,-252,-258,-249,-353},{-291,-232,-333,-288,-291,-347},{-213,-221,-269,-232,-244,-269},{-204,-204,-230,-202,-224,-288},{-330,-260,-230,-266,-210,-333}}}}; // supply (positive for supply and negative for demand) under different scenarios 
int iniv[I]={2070,261,23,150,170,304,400,300,160}; // initial inventory 
int ubiv[I]={2740,522,414,300,341,608,800,600,320}; // the upper bounds of inventory 
int len[I1][I2]={{3,6,2,2,3,3,2,1}}; // 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,7.19,13.32,4.32,2.64,5.16,6.85,4.63,1.82}; // 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]={{6.54,12.11,3.93,2.4,4.69,6.23,4.21,1.65}}; // 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]={5.23,5.23,5.23,4.58,4.58,4.58,3.92,3.92,3.92,9.69,9.69,9.69,8.48,8.48,8.48,7.27,7.27,7.27,3.14,3.14,3.14,2.75,2.75,2.75,2.36,2.36,2.36,1.92,1.92,1.92,1.68,1.68,1.68,1.44,1.44,1.44,3.75,3.75,3.75,3.28,3.28,3.28,2.81,2.81,2.81,4.98,4.98,4.98,4.36,4.36,4.36,3.74,3.74,3.74,3.37,3.37,3.37,2.95,2.95,2.95,2.53,2.53,2.53,1.32,1.32,1.32,1.16,1.16,1.16,0.99,0.99,0.99}; // 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]={7,4,3,7,4,3,8,4,3,6,3,2,5,3,2,6,3,2,8,4,3,8,4,3,8,4,3,7,4,3,8,4,3,8,4,3,8,4,3,7,4,3,7,4,3,8,4,3,7,4,3,7,4,3,8,4,3,8,4,3,8,4,3,9,4,3,9,5,3,8,5,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}}; // set of shipments in each bid 
int SHsts[SPN]={2,4,6,8,10,12,14,1,5,9,13,0,6,12,1,3,5,7,9,11,13,1,5,9,13,1,7,13,0,2,4,6,8,10,12,14,0,4,8,12,2,8,14,1,3,5,7,9,11,2,6,10,2,8,2,4,6,8,10,2,6,10,0,6,1,3,5,7,9,11,1,5,9,1,7,0,2,4,6,8,10,12,14,0,4,8,12,0,6,12,0,2,4,6,8,10,12,14,1,5,9,13,1,7,13,0,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,2,8,14,1,3,5,7,9,11,13,15,0,4,8,12,2,8,14,1,3,5,7,9,11,13,15,1,5,9,13,0,6,12,0,2,4,6,8,10,12,14,1,5,9,13,1,7,13,2,4,6,8,10,12,14,1,5,9,13,0,6,12,1,3,5,7,9,11,13,0,4,8,12,1,7,13,0,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,1,7,13,1,3,5,7,9,11,13,15,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,2,6,10,14,1,7,13,1,3,5,7,9,11,13,15,2,6,10,14,1,7,13,0,2,4,6,8,10,12,14,16,2,6,10,14,2,8,14,0,2,4,6,8,10,12,14,16,0,4,8,12,16,1,7,13,2,4,6,8,10,12,14,16,0,4,8,12,16,2,8,14}; // set of start times of each shipment 
int SHets[SPN]={5,7,9,11,13,15,17,4,8,12,16,3,9,15,4,6,8,10,12,14,16,4,8,12,16,4,10,16,3,5,7,9,11,13,15,17,3,7,11,15,5,11,17,7,9,11,13,15,17,8,12,16,8,14,8,10,12,14,16,8,12,16,6,12,7,9,11,13,15,17,7,11,15,7,13,2,4,6,8,10,12,14,16,2,6,10,14,2,8,14,2,4,6,8,10,12,14,16,3,7,11,15,3,9,15,2,4,6,8,10,12,14,16,3,7,11,15,3,9,15,4,6,8,10,12,14,16,4,8,12,16,4,10,16,3,5,7,9,11,13,15,17,2,6,10,14,4,10,16,3,5,7,9,11,13,15,17,3,7,11,15,2,8,14,3,5,7,9,11,13,15,17,4,8,12,16,4,10,16,5,7,9,11,13,15,17,4,8,12,16,3,9,15,4,6,8,10,12,14,16,3,7,11,15,4,10,16,3,5,7,9,11,13,15,17,4,8,12,16,5,11,17,5,7,9,11,13,15,17,3,7,11,15,4,10,16,5,7,9,11,13,15,17,5,9,13,17,4,10,16,3,5,7,9,11,13,15,17,4,8,12,16,3,9,15,2,4,6,8,10,12,14,16,4,8,12,16,3,9,15,3,5,7,9,11,13,15,17,4,8,12,16,3,9,15,1,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,1,3,5,7,9,11,13,15,17,1,5,9,13,17,2,8,14,3,5,7,9,11,13,15,17,1,5,9,13,17,3,9,15}; // set of end times of each shipment 
