int Dev = 20;// 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 = 340;//Number of shipments
extern const int SN = 20;//Number of scenarios at each stage
extern const int MBSN = 8;//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]={{{{11200,0,0,0,0,0},{11842,0,0,0,0,0},{11397,0,0,0,0,0},{11616,0,0,0,0,0},{11734,0,0,0,0,0},{11377,0,0,0,0,0},{11729,0,0,0,0,0},{11752,0,0,0,0,0},{11485,0,0,0,0,0},{11284,0,0,0,0,0},{11863,0,0,0,0,0},{11515,0,0,0,0,0},{11642,0,0,0,0,0},{11494,0,0,0,0,0},{11402,0,0,0,0,0},{11449,0,0,0,0,0},{11358,0,0,0,0,0},{11332,0,0,0,0,0},{11355,0,0,0,0,0},{11237,0,0,0,0,0}},{{11251,0,0,0,0,0},{11558,0,0,0,0,0},{11622,0,0,0,0,0},{11396,0,0,0,0,0},{11660,0,0,0,0,0},{11434,0,0,0,0,0},{11472,0,0,0,0,0},{11355,0,0,0,0,0},{11455,0,0,0,0,0},{11199,0,0,0,0,0},{11723,0,0,0,0,0},{11741,0,0,0,0,0},{11341,0,0,0,0,0},{11765,0,0,0,0,0},{11881,0,0,0,0,0},{11160,0,0,0,0,0},{11654,0,0,0,0,0},{11528,0,0,0,0,0},{11494,0,0,0,0,0},{11768,0,0,0,0,0}},{{11105,0,0,0,0,0},{11700,0,0,0,0,0},{11102,0,0,0,0,0},{11707,0,0,0,0,0},{11560,0,0,0,0,0},{11233,0,0,0,0,0},{11526,0,0,0,0,0},{11348,0,0,0,0,0},{11485,0,0,0,0,0},{11400,0,0,0,0,0},{11555,0,0,0,0,0},{11477,0,0,0,0,0},{11434,0,0,0,0,0},{11463,0,0,0,0,0},{11512,0,0,0,0,0},{11214,0,0,0,0,0},{11475,0,0,0,0,0},{11762,0,0,0,0,0},{11658,0,0,0,0,0},{11545,0,0,0,0,0}}},{{{-219,-162,-207,-191,-240,-193},{-205,-244,-229,-185,-191,-189},{-235,-229,-219,-207,-209,-227},{-211,-189,-231,-219,-166,-195},{-177,-171,-199,-207,-221,-242},{-162,-173,-240,-227,-201,-175},{-231,-183,-162,-171,-205,-189},{-162,-238,-219,-183,-185,-207},{-179,-231,-219,-215,-179,-233},{-242,-209,-244,-171,-187,-164},{-162,-240,-215,-197,-242,-221},{-191,-177,-221,-197,-207,-168},{-244,-187,-191,-193,-183,-211},{-211,-191,-217,-187,-242,-195},{-187,-233,-221,-195,-185,-193},{-223,-181,-191,-209,-193,-187},{-207,-166,-162,-242,-179,-179},{-181,-215,-173,-225,-225,-197},{-215,-193,-231,-242,-191,-205},{-177,-173,-179,-168,-211,-223}},{{-185,-171,-197,-207,-195,-187},{-187,-201,-215,-211,-213,-238},{-215,-197,-189,-240,-209,-209},{-179,-213,-189,-193,-227,-209},{-166,-175,-189,-244,-187,-238},{-225,-199,-164,-164,-189,-240},{-223,-175,-191,-162,-235,-213},{-164,-166,-242,-242,-197,-235},{-227,-203,-195,-199,-219,-221},{-231,-219,-229,-183,-213,-187},{-219,-203,-229,-227,-213,-223},{-238,-203,-201,-225,-215,-177},{-189,-177,-166,-221,-215,-213},{-213,-219,-205,-221,-227,-223},{-215,-219,-205,-238,-235,-195},{-168,-195,-195,-207,-171,-221},{-209,-209,-205,-242,-223,-219},{-242,-203,-229,-238,-213,-189},{-225,-185,-183,-201,-181,-231},{-238,-177,-166,-168,-166,-193}},{{-193,-229,-209,-177,-193,-225},{-211,-213,-209,-229,-223,-215},{-213,-242,-162,-215,-195,-187},{-235,-213,-175,-173,-227,-215},{-233,-213,-164,-219,-189,-240},{-193,-173,-242,-166,-225,-217},{-227,-187,-175,-227,-219,-227},{-191,-227,-199,-193,-227,-227},{-205,-191,-189,-231,-240,-179},{-162,-185,-240,-235,-231,-207},{-235,-207,-215,-240,-233,-175},{-231,-238,-199,-209,-185,-179},{-225,-240,-187,-173,-189,-171},{-187,-181,-199,-205,-213,-221},{-209,-227,-227,-203,-185,-185},{-199,-215,-181,-189,-166,-175},{-233,-195,-244,-166,-238,-191},{-219,-207,-238,-173,-177,-187},{-164,-207,-215,-240,-242,-171},{-211,-164,-215,-203,-233,-221}}},{{{-135,-143,-130,-175,-177,-190},{-187,-161,-163,-142,-130,-167},{-130,-166,-132,-161,-182,-179},{-158,-145,-151,-187,-153,-190},{-148,-150,-159,-187,-129,-138},{-130,-171,-190,-190,-164,-145},{-164,-193,-138,-185,-163,-148},{-177,-150,-161,-151,-174,-167},{-145,-138,-158,-184,-150,-166},{-185,-148,-182,-167,-148,-138},{-148,-142,-182,-187,-180,-158},{-143,-174,-182,-148,-147,-130},{-155,-192,-193,-179,-188,-132},{-171,-158,-171,-156,-138,-179},{-155,-140,-188,-151,-163,-188},{-184,-134,-132,-171,-151,-158},{-169,-164,-163,-142,-182,-143},{-188,-145,-155,-147,-159,-151},{-172,-151,-177,-193,-166,-145},{-179,-140,-150,-174,-148,-167}},{{-187,-148,-129,-148,-164,-140},{-171,-164,-177,-163,-151,-185},{-187,-192,-150,-130,-187,-132},{-169,-185,-130,-187,-193,-184},{-151,-188,-143,-137,-187,-156},{-145,-167,-143,-147,-192,-151},{-150,-148,-130,-129,-184,-188},{-166,-171,-143,-166,-175,-138},{-188,-140,-153,-156,-185,-151},{-164,-143,-161,-190,-161,-142},{-130,-164,-150,-193,-180,-187},{-172,-184,-185,-188,-190,-193},{-129,-166,-138,-187,-134,-174},{-182,-169,-156,-184,-135,-187},{-151,-179,-193,-151,-174,-193},{-158,-142,-166,-135,-130,-132},{-166,-164,-148,-147,-130,-153},{-171,-190,-148,-193,-142,-180},{-156,-188,-148,-166,-188,-167},{-150,-130,-175,-190,-185,-143}},{{-148,-132,-138,-132,-142,-156},{-188,-150,-163,-148,-175,-193},{-169,-190,-135,-172,-156,-163},{-156,-164,-188,-193,-145,-132},{-142,-179,-134,-148,-134,-140},{-132,-175,-135,-155,-145,-129},{-188,-166,-155,-188,-150,-151},{-143,-132,-134,-130,-161,-193},{-134,-155,-184,-129,-132,-180},{-174,-172,-164,-187,-180,-129},{-164,-192,-145,-145,-158,-147},{-140,-171,-190,-137,-187,-187},{-159,-147,-143,-172,-138,-161},{-145,-187,-185,-192,-145,-142},{-143,-140,-179,-138,-132,-151},{-148,-147,-138,-142,-171,-185},{-184,-135,-169,-140,-143,-180},{-185,-161,-145,-143,-130,-188},{-177,-179,-166,-158,-140,-174},{-147,-177,-159,-175,-185,-148}}},{{{-247,-252,-266,-238,-273,-231},{-236,-206,-270,-217,-213,-215},{-222,-273,-231,-224,-199,-236},{-215,-270,-249,-277,-213,-208},{-189,-263,-275,-236,-266,-273},{-199,-273,-185,-231,-196,-189},{-233,-273,-206,-215,-224,-266},{-266,-259,-249,-245,-252,-263},{-215,-261,-215,-240,-229,-203},{-203,-213,-256,-238,-273,-219},{-208,-224,-254,-187,-219,-189},{-194,-277,-194,-189,-254,-277},{-219,-249,-226,-268,-270,-217},{-275,-229,-231,-236,-208,-206},{-247,-254,-208,-273,-224,-217},{-243,-243,-256,-270,-238,-273},{-261,-194,-215,-203,-254,-268},{-275,-215,-203,-187,-245,-203},{-222,-238,-268,-259,-199,-231},{-270,-222,-236,-224,-213,-196}},{{-268,-187,-215,-270,-226,-263},{-219,-203,-226,-224,-273,-194},{-247,-222,-268,-206,-273,-261},{-224,-273,-187,-245,-208,-252},{-256,-277,-199,-229,-238,-252},{-238,-231,-240,-187,-196,-273},{-249,-233,-252,-201,-229,-192},{-236,-268,-259,-213,-199,-187},{-194,-199,-210,-196,-210,-243},{-238,-192,-233,-215,-203,-210},{-243,-240,-238,-243,-222,-189},{-240,-261,-243,-263,-213,-187},{-273,-224,-215,-277,-261,-252},{-263,-247,-213,-199,-213,-236},{-206,-199,-247,-245,-226,-229},{-245,-192,-229,-252,-222,-254},{-270,-249,-187,-187,-206,-256},{-187,-231,-201,-203,-247,-256},{-194,-259,-215,-275,-196,-252},{-215,-240,-252,-245,-233,-203}},{{-261,-231,-189,-185,-222,-233},{-185,-231,-199,-222,-187,-245},{-222,-277,-208,-270,-224,-208},{-261,-270,-210,-226,-203,-243},{-238,-268,-199,-252,-254,-231},{-192,-201,-231,-201,-249,-275},{-266,-226,-263,-187,-206,-187},{-240,-213,-245,-224,-213,-231},{-259,-201,-224,-213,-219,-224},{-249,-238,-243,-259,-243,-233},{-219,-277,-185,-252,-266,-236},{-245,-270,-201,-277,-215,-226},{-194,-203,-261,-192,-243,-270},{-210,-254,-226,-215,-187,-254},{-275,-266,-208,-224,-259,-210},{-270,-210,-266,-263,-268,-217},{-252,-192,-229,-275,-219,-226},{-194,-261,-275,-268,-275,-266},{-196,-266,-261,-268,-247,-210},{-226,-194,-206,-259,-222,-238}}},{{{-241,-202,-258,-193,-224,-200},{-174,-254,-260,-247,-224,-191},{-217,-234,-241,-230,-187,-221},{-204,-226,-217,-221,-224,-241},{-226,-191,-241,-224,-230,-184},{-204,-217,-176,-230,-258,-237},{-189,-202,-215,-250,-243,-208},{-189,-258,-260,-250,-243,-241},{-252,-230,-250,-189,-182,-230},{-250,-208,-221,-221,-226,-245},{-230,-243,-239,-258,-256,-260},{-189,-174,-206,-187,-224,-206},{-256,-217,-178,-258,-250,-210},{-187,-215,-232,-241,-224,-204},{-232,-217,-182,-195,-221,-206},{-187,-182,-182,-237,-228,-230},{-184,-219,-256,-250,-250,-202},{-206,-226,-184,-174,-252,-239},{-197,-252,-180,-197,-184,-204},{-184,-187,-247,-202,-210,-247}},{{-247,-204,-184,-254,-213,-247},{-245,-195,-245,-215,-219,-182},{-239,-187,-215,-174,-210,-176},{-187,-232,-176,-204,-245,-228},{-178,-195,-210,-219,-260,-224},{-234,-239,-202,-224,-252,-237},{-241,-178,-250,-204,-221,-187},{-247,-197,-224,-174,-228,-189},{-256,-184,-213,-250,-200,-180},{-193,-178,-204,-184,-210,-243},{-250,-189,-187,-197,-256,-219},{-208,-256,-245,-226,-219,-217},{-184,-210,-241,-226,-208,-260},{-224,-215,-197,-187,-252,-245},{-232,-228,-224,-228,-195,-191},{-200,-239,-182,-247,-184,-250},{-174,-247,-180,-206,-256,-258},{-254,-219,-239,-193,-174,-210},{-215,-180,-195,-174,-247,-237},{-258,-197,-200,-226,-230,-260}},{{-254,-254,-184,-195,-256,-204},{-180,-258,-247,-204,-215,-176},{-174,-252,-191,-226,-237,-224},{-224,-197,-237,-241,-178,-226},{-208,-232,-195,-193,-256,-178},{-182,-184,-224,-187,-260,-252},{-247,-189,-243,-226,-226,-197},{-234,-197,-208,-228,-195,-228},{-189,-234,-224,-230,-200,-228},{-184,-232,-219,-243,-184,-206},{-197,-195,-241,-239,-208,-176},{-176,-228,-260,-191,-250,-187},{-195,-241,-210,-213,-191,-256},{-243,-204,-224,-178,-245,-258},{-174,-195,-241,-232,-247,-241},{-195,-258,-221,-234,-258,-226},{-187,-187,-197,-182,-215,-234},{-200,-254,-217,-219,-258,-260},{-221,-176,-252,-224,-226,-260},{-221,-200,-187,-189,-224,-208}}},{{{-221,-218,-266,-293,-223,-303},{-295,-215,-269,-271,-309,-277},{-271,-314,-263,-303,-218,-237},{-261,-298,-301,-218,-253,-215},{-287,-303,-271,-218,-239,-223},{-239,-215,-301,-250,-261,-306},{-293,-218,-255,-229,-253,-261},{-303,-282,-303,-218,-245,-306},{-261,-282,-253,-237,-223,-223},{-234,-234,-269,-215,-311,-266},{-229,-309,-295,-319,-298,-245},{-298,-303,-213,-285,-213,-234},{-309,-242,-234,-242,-295,-319},{-239,-226,-303,-301,-229,-263},{-277,-290,-213,-226,-247,-266},{-314,-215,-258,-218,-218,-309},{-255,-213,-213,-319,-298,-242},{-309,-279,-298,-226,-250,-317},{-226,-298,-215,-285,-213,-261},{-319,-295,-237,-261,-237,-263}},{{-223,-287,-269,-247,-282,-221},{-245,-319,-245,-277,-242,-271},{-290,-285,-314,-301,-250,-237},{-277,-314,-258,-271,-218,-215},{-263,-221,-317,-295,-245,-226},{-226,-298,-213,-258,-295,-277},{-223,-306,-242,-309,-306,-285},{-245,-237,-239,-303,-239,-223},{-253,-271,-261,-239,-287,-271},{-266,-293,-239,-295,-223,-213},{-277,-319,-319,-279,-282,-215},{-282,-319,-282,-226,-277,-255},{-242,-279,-274,-274,-234,-242},{-309,-279,-245,-282,-301,-277},{-314,-213,-295,-266,-314,-287},{-261,-290,-269,-293,-221,-245},{-311,-314,-279,-213,-285,-293},{-213,-266,-221,-242,-247,-271},{-319,-279,-253,-282,-293,-245},{-285,-274,-269,-277,-250,-314}},{{-266,-213,-261,-231,-290,-226},{-298,-285,-309,-226,-282,-301},{-279,-261,-226,-309,-250,-229},{-263,-277,-218,-237,-303,-253},{-263,-247,-263,-279,-269,-215},{-247,-317,-301,-261,-261,-245},{-298,-237,-213,-269,-301,-295},{-282,-290,-258,-303,-263,-231},{-245,-303,-271,-301,-242,-274},{-295,-277,-319,-215,-261,-282},{-229,-314,-247,-223,-242,-309},{-317,-287,-287,-261,-277,-223},{-239,-279,-245,-290,-263,-274},{-255,-242,-255,-266,-279,-282},{-229,-253,-261,-261,-319,-226},{-242,-245,-258,-298,-242,-253},{-301,-247,-274,-226,-301,-223},{-271,-311,-303,-319,-221,-263},{-258,-215,-263,-298,-314,-282},{-293,-301,-239,-242,-229,-309}}},{{{-244,-291,-260,-291,-238,-305},{-286,-232,-333,-230,-325,-322},{-249,-246,-277,-263,-255,-249},{-232,-311,-244,-325,-297,-255},{-266,-230,-263,-330,-333,-336},{-274,-311,-260,-272,-336,-238},{-330,-328,-336,-249,-336,-249},{-325,-252,-249,-333,-302,-258},{-286,-227,-308,-252,-314,-333},{-224,-227,-235,-280,-249,-311},{-286,-269,-302,-316,-314,-319},{-308,-302,-263,-244,-319,-322},{-255,-224,-333,-322,-319,-305},{-269,-258,-286,-238,-260,-311},{-297,-269,-255,-272,-230,-300},{-288,-305,-249,-283,-272,-272},{-330,-241,-235,-252,-224,-291},{-255,-246,-291,-308,-274,-241},{-300,-286,-291,-224,-280,-314},{-272,-246,-238,-286,-277,-319}},{{-241,-305,-288,-302,-266,-235},{-319,-291,-249,-330,-246,-319},{-249,-280,-232,-274,-241,-291},{-266,-288,-302,-274,-305,-272},{-319,-314,-291,-238,-300,-263},{-319,-241,-314,-255,-333,-277},{-244,-249,-319,-258,-277,-336},{-266,-311,-294,-328,-230,-291},{-319,-258,-263,-241,-311,-244},{-241,-305,-230,-272,-319,-322},{-232,-325,-288,-224,-263,-328},{-294,-238,-305,-300,-230,-286},{-305,-269,-288,-241,-244,-227},{-330,-232,-277,-260,-316,-288},{-252,-314,-249,-272,-258,-280},{-235,-263,-258,-330,-224,-241},{-286,-325,-266,-330,-232,-308},{-300,-336,-333,-224,-302,-322},{-283,-235,-294,-280,-288,-336},{-277,-300,-300,-263,-333,-258}},{{-316,-288,-297,-277,-263,-235},{-286,-300,-300,-272,-258,-314},{-246,-266,-238,-269,-252,-224},{-305,-336,-325,-224,-286,-336},{-263,-263,-305,-274,-252,-294},{-300,-244,-294,-288,-249,-241},{-291,-244,-294,-316,-241,-302},{-286,-311,-277,-252,-280,-249},{-249,-297,-302,-322,-274,-294},{-288,-232,-252,-255,-249,-260},{-246,-235,-291,-258,-260,-336},{-297,-322,-314,-227,-288,-277},{-272,-316,-277,-272,-300,-291},{-288,-330,-252,-238,-286,-224},{-235,-316,-291,-230,-249,-227},{-230,-249,-297,-288,-308,-258},{-328,-325,-322,-227,-263,-255},{-300,-252,-263,-263,-283,-238},{-235,-241,-297,-314,-255,-227},{-235,-252,-260,-227,-328,-308}}},{{{-238,-232,-291,-230,-238,-266},{-300,-325,-277,-294,-330,-277},{-280,-235,-258,-255,-328,-263},{-277,-272,-255,-291,-288,-322},{-305,-311,-328,-328,-266,-244},{-308,-274,-294,-308,-300,-263},{-316,-330,-235,-277,-325,-266},{-244,-227,-314,-230,-311,-274},{-246,-277,-297,-224,-311,-333},{-244,-328,-252,-224,-260,-325},{-286,-224,-235,-238,-283,-314},{-322,-300,-272,-269,-328,-308},{-283,-246,-263,-224,-277,-302},{-330,-333,-272,-235,-283,-241},{-274,-314,-300,-235,-333,-272},{-241,-246,-288,-322,-252,-249},{-305,-283,-280,-300,-316,-286},{-280,-274,-244,-319,-252,-269},{-246,-224,-227,-308,-311,-286},{-314,-227,-260,-232,-263,-308}},{{-269,-244,-252,-232,-294,-249},{-283,-232,-263,-280,-283,-291},{-336,-314,-277,-277,-249,-305},{-286,-266,-280,-230,-232,-308},{-314,-325,-333,-255,-311,-280},{-266,-274,-283,-235,-283,-244},{-238,-314,-252,-297,-244,-274},{-333,-252,-224,-277,-235,-266},{-336,-325,-300,-274,-258,-325},{-291,-300,-249,-255,-232,-288},{-269,-266,-230,-319,-311,-297},{-294,-328,-241,-280,-224,-246},{-269,-252,-263,-258,-227,-230},{-330,-286,-330,-314,-308,-308},{-246,-308,-297,-280,-235,-311},{-291,-244,-297,-274,-230,-311},{-319,-252,-241,-305,-316,-286},{-336,-246,-230,-241,-336,-286},{-300,-241,-322,-258,-238,-308},{-314,-322,-252,-311,-238,-263}},{{-244,-274,-235,-319,-283,-252},{-286,-291,-241,-322,-288,-328},{-272,-330,-266,-227,-249,-305},{-277,-224,-291,-294,-319,-311},{-291,-314,-300,-244,-302,-269},{-241,-249,-272,-291,-300,-255},{-308,-241,-244,-238,-300,-308},{-272,-235,-294,-322,-241,-227},{-241,-272,-325,-286,-280,-305},{-249,-235,-269,-333,-322,-232},{-291,-283,-263,-330,-274,-283},{-314,-244,-227,-241,-224,-249},{-294,-305,-288,-235,-252,-336},{-255,-263,-291,-280,-288,-314},{-328,-302,-291,-274,-274,-308},{-227,-235,-230,-258,-333,-283},{-235,-274,-308,-252,-277,-322},{-263,-336,-255,-314,-300,-286},{-308,-311,-260,-241,-319,-305},{-322,-333,-297,-227,-297,-297}}},{{{-311,-263,-246,-244,-224,-277},{-291,-314,-330,-336,-249,-255},{-232,-274,-288,-260,-272,-316},{-305,-305,-224,-260,-333,-314},{-316,-252,-322,-263,-269,-305},{-288,-291,-252,-311,-227,-235},{-328,-260,-325,-274,-314,-286},{-244,-246,-328,-263,-291,-255},{-249,-249,-252,-330,-297,-328},{-294,-272,-266,-238,-291,-277},{-280,-260,-330,-328,-297,-246},{-269,-328,-300,-333,-266,-260},{-246,-249,-328,-230,-260,-269},{-249,-300,-260,-316,-291,-297},{-238,-269,-274,-302,-241,-333},{-286,-230,-322,-336,-330,-263},{-238,-305,-269,-235,-238,-336},{-333,-322,-224,-291,-230,-230},{-291,-330,-291,-260,-224,-252},{-241,-314,-308,-308,-227,-258}},{{-272,-300,-286,-258,-319,-274},{-235,-314,-252,-322,-260,-274},{-241,-280,-263,-300,-291,-330},{-249,-288,-249,-314,-235,-280},{-274,-286,-266,-227,-311,-288},{-283,-297,-238,-266,-286,-294},{-319,-311,-269,-277,-328,-230},{-305,-238,-280,-297,-286,-330},{-255,-308,-255,-291,-230,-308},{-246,-269,-305,-305,-288,-227},{-224,-263,-274,-328,-286,-314},{-288,-305,-244,-232,-328,-288},{-288,-308,-336,-322,-288,-241},{-283,-232,-249,-263,-224,-230},{-316,-302,-325,-336,-283,-330},{-258,-319,-255,-308,-244,-283},{-235,-314,-269,-308,-238,-238},{-230,-322,-283,-249,-252,-288},{-232,-249,-294,-255,-314,-238},{-336,-325,-305,-227,-330,-305}},{{-252,-230,-246,-330,-297,-238},{-230,-336,-314,-238,-232,-297},{-277,-246,-255,-227,-260,-227},{-302,-283,-238,-266,-316,-291},{-297,-302,-263,-319,-336,-297},{-269,-224,-280,-260,-300,-319},{-322,-291,-230,-311,-235,-274},{-330,-277,-232,-241,-322,-260},{-258,-266,-286,-235,-238,-325},{-311,-252,-246,-232,-308,-227},{-241,-300,-249,-308,-280,-316},{-328,-238,-244,-308,-230,-274},{-316,-224,-274,-249,-311,-258},{-230,-269,-314,-311,-246,-305},{-263,-230,-330,-316,-286,-322},{-224,-314,-249,-258,-252,-241},{-252,-316,-294,-314,-235,-291},{-249,-283,-308,-255,-260,-266},{-302,-269,-286,-241,-308,-269},{-280,-297,-325,-325,-230,-280}}}}; // 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,7,4,3,6,3,2,6,3,2,5,3,2,8,4,3,8,4,3,7,4,3,8,4,3,8,4,3,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,8,4,3,8,4,3,8,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}}; // set of shipments in each bid 
int SHsts[SPN]={2,4,6,8,10,12,14,1,5,9,13,2,8,14,1,3,5,7,9,11,13,1,5,9,13,1,7,13,1,3,5,7,9,11,13,0,4,8,12,0,6,12,0,2,4,6,8,10,1,5,9,0,6,1,3,5,7,9,11,2,6,10,1,7,2,4,6,8,10,1,5,9,1,7,0,2,4,6,8,10,12,14,2,6,10,14,1,7,13,1,3,5,7,9,11,13,15,1,5,9,13,1,7,13,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,1,7,13,1,3,5,7,9,11,13,15,1,5,9,13,2,8,14,1,3,5,7,9,11,13,15,1,5,9,13,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,2,6,10,14,1,7,13,2,4,6,8,10,12,14,1,5,9,13,2,8,14,1,3,5,7,9,11,13,0,4,8,12,0,6,12,1,3,5,7,9,11,13,1,5,9,13,1,7,13,1,3,5,7,9,11,13,2,6,10,14,2,8,14,0,2,4,6,8,10,12,14,1,5,9,13,0,6,12,1,3,5,7,9,11,13,15,1,5,9,13,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,1,7,13,1,3,5,7,9,11,13,15,0,4,8,12,16,0,6,12,1,3,5,7,9,11,13,15,0,4,8,12,16,1,7,13}; // set of start times of each shipment 
int SHets[SPN]={5,7,9,11,13,15,17,4,8,12,16,5,11,17,4,6,8,10,12,14,16,4,8,12,16,4,10,16,4,6,8,10,12,14,16,3,7,11,15,3,9,15,6,8,10,12,14,16,7,11,15,6,12,7,9,11,13,15,17,8,12,16,7,13,8,10,12,14,16,7,11,15,7,13,2,4,6,8,10,12,14,16,4,8,12,16,3,9,15,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,4,6,8,10,12,14,16,3,7,11,15,2,8,14,2,4,6,8,10,12,14,16,4,8,12,16,3,9,15,3,5,7,9,11,13,15,17,3,7,11,15,4,10,16,3,5,7,9,11,13,15,17,3,7,11,15,3,9,15,3,5,7,9,11,13,15,17,4,8,12,16,5,11,17,5,7,9,11,13,15,17,5,9,13,17,4,10,16,5,7,9,11,13,15,17,4,8,12,16,5,11,17,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,4,6,8,10,12,14,16,5,9,13,17,5,11,17,2,4,6,8,10,12,14,16,3,7,11,15,2,8,14,3,5,7,9,11,13,15,17,3,7,11,15,4,10,16,3,5,7,9,11,13,15,17,2,6,10,14,4,10,16,2,4,6,8,10,12,14,16,2,6,10,14,2,8,14,2,4,6,8,10,12,14,16,1,5,9,13,17,1,7,13,2,4,6,8,10,12,14,16,1,5,9,13,17,2,8,14}; // set of end times of each shipment 
