CS524 Problem Set #6
ISyE/CS524 – Problem Set #6
Due Date: Monday October 31, 2022. 09.00AM.
Formulate the following problems in GAMS and solve them. Please follow the instruc- tions given in the problems closely. Submit this assignment electronically to the drop box in oneziparchivecontainingexactly7fileswiththefollowingnames:hw6-1.gms, hw6-2.gms, hw6-3.gms, hw6-1.lst, hw6-2.lst, hw6-3.lst, grandsons.txt
Copyright By PowCoder代写 加微信 powcoder
1 Dragon Transport
Given your great Optimization Wizard training, the Ministry of Magic has asked that you transport 20 dragons from Romania to Hogwarts for the Triwizard tournament. The dragons will be transported on a route through five cities, with a choice of three different modes of transport between each of the pairs of cities on the route. The route to be followed is exactly:
1. Romania
2. Transylvania 3. Egypt
4. Godric’s Hollow 5. Hogwarts
On each leg of the route, the dragons are to all be transported by Hogwarts Express (Train), Portkey, or Thestral. In any of the intermediate cities, it is possible to change the mode of transport, but you must use a single mode of transport for all the dragons between two consecutive cities. Table 1 lists the cost of transport in galleons per dragon between the pairs of cities.
Table 1: Transportation Costs Between Locations on Route Pairs of cities
1-2 2-3 3-4 4-5 Train 30 25 40 60 Portkey 25 40 45 50 Thestral 40 20 50 45
Table 2 shows the cost of changing the mode of transport in galleons/dragon. (This cost is independent of the location at which the change is made).
1.1 Problem
How should the transport be organized to minimize the cost? What is the minimum cost for transporting the 20 dragons?
Problem 2 Page 1
CS524 Problem Set #6
2 Subcontracts
Table 2: Mode Change Costs
From/To Train Train 0 5 12 Portkey 8 0 10
Thestral 15 10 0
The public works division in a region has the responsibility to subcontract work to private contractors. The work is of several types, and is carried out by teams, each of which is capable of doing all types of work.
The region is divided into 16 districts and estimates of the amount of work to be done in each district are available. There are 28 contractors of which the first 10 are experienced contractors. We have the following data:
• i are indices representing contractors.
• j are indices representing the various districts.
• a(i) number of teams contractor i can provide.
• b(j) number of teams required by district j.
• e(j) (value 2 or 3) is the specified minimum number of contractors allotted to district j (to prevent overdependence on any one contractor).
• c(i,j) expected yearly cost of a team from contractor i allotted to district j.
2.1 Problem
At least one experienced contractor must be appointed in each district, a precaution in case some difficult work arises. Enough teams must be allotted to meet the estimated demand in each district, and no contractor can be asked to provide more teams than it has available. Formulate the problem of determining the number of teams from each contractor to allot to each district, so as to satisfy the above constraints at minimum cost. Utilize the data in contract.gdx:
set i, exper(i), inexp(i), j;
parameter a(i), b(j), e(j), c(i,j);
$gdxin contract.gdx
$load i exper inexp j
$load a b e c
Use the following lines to print out the solution values of teams at the end of your listing file.
option teams:0:0:1;
display teams.l;
Problem 3 Page 2
CS524 Problem Set #6 Prof. ‘
3 Integer Programming is Smarter than a Fourth Grader?
This was my son’s homework assignment. I tried to make him use integer programming to figure out the answer. He told me to buzz off, but since you hopefully have more respect for your professor than my son does for me, you will be happy to use integer programming to solve the following mind-bender:
Maxine, Mabel, Mavis, Millie, and Martha were grandmothers. Their daughters were named Carla, Carol, Cindy, Cathy, and Caren, and the daugthers were married to John, Jake, Jack, Joe, and Jason. Each of the couples had one son. The names of the grandsons were Tom, Tex, Tim, Tip, and Tab.
1. Maxine’s Daughter was not Carla
2. Mavis’ son-in-law was not named Jack, and Catchy was married to Joe, but their son was not named Tab
3. Tim’s mother was not named either Carol or Carla, because Tim’s mother was Jake’s wife Cindy
4. Mabel, Millie, and Martha did not have daughters named Carla or Carol, and Martha’s son-in-law was not John because John was married to Caren, and their son was named Tom
5. Millie was terrible with names, but she knew that her son-in-law was named either Joe or Jason, and her grandson was named either Tip or Tab.
6. Tab did not have a grandmother named Mavis.
Who was Maxine’s grandson? In fact, we can determine everyone’s grandson. Assuming that we have the following sets
set G Grandmas / Maxine, Mabel, Mavis, Millie, Martha / ;
set D Daughters / Carla, Carol, Cindy, Cathy, Caren / ;
set H Husbands / John, Jake, Jack, Joe, Jason / ;
set S Grandsons / Tom, Tex, Tim, Tip, Tab / ;
and that you have a variable xS(G,S) that takes value 1 if grandma G has grandson S. Include the following code at the bottom of your gams file. This will produce a text file “grandsons.txt” that lists which grandma has which grandson.
file results /grandsons.txt/ ;
put results
loop(S$(xS.L(G,S) > 0.5),
put G.tl, ” has grandson “, S.tl /
); putclose;
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com