43 parameters 44 degreeit

Info icon This preview shows pages 1–2. Sign up to view the full content.

43 Parameters MST_INDEX(I,IP,IPP),MST_dist(i,ip),TSP_dist(t),TrianL(i,ip,t),Trig(i,j,ip,t) 44 Degree(i,t) 45 TrigL(i,j,ip,t) 46 Adlink(j,k,t) 47 fold(i,ip,t) folded minimum spanning trees 48 MinLink2(i,k,t) 49 Lmin(i,t) 50 ; 51 52 53 54 MST_INDEX(I,IP,IPP)$mst(i,ip,ipp)=1; 55 fold(i,ip,'t1')$(ord(i) lt ord(ip)) = MST_INDEX(I,IP,'1') + MST_INDEX(Ip,i,'1'); 56 fold2(i,ip) = MST_INDEX(I,IP,'1') + MST_INDEX(Ip,i,'1'); 57 58 59 MST_dist(i,ip)= fold(i,ip,'t1')* uarc(i,ip); 60 *Get the minimum MST start from any points have the same total distance;
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

C:\Users\Jia\Dropbox\Courses\2nd year\CEE 512\mst_HandOUT2.gms Saturday, October 15, 2016 1:04:37 PM Page 2 61 *Double the MST 62 63 64 TSP_dist('t1')=sum((i,ip),MST_dist(i,ip))*2; 65 66 Parameters AdLinkL(t), MinLink2L(t),sLmin(t); 67 fold(i,ip,'t1')=fold(i,ip,'t1')*2; 68 Degree(i,'t1')=sum(ip,fold(i,ip,'t1'))+sum(iP,fold(ip,i,'t1')); 69 70 loop (t, 71 TrianL(i,ip,t+1)=fold(i,ip,t)* uarc(i,ip)$(Degree(i,t) ge 3 and Degree(ip,t) gt 1 ); 72 Trig(i,j,k,t+1)$(TrianL(i,j,t+1) and TrianL(i,k,t+1))=1; 73 Trig(i,j,k,t+1)$(ord(j) eq ord(k))=0; 74 TrigL(i,J,K,t+1)= Trig(i,j,k,t+1)* uarc(j,k)- Trig(i,j,k,t+1)*uarc(i,j)-Trig(i,j,k,t+1)*uarc(» i,k); 75 Lmin(i,t+1)=smin((k,j),TrigL(i,J,K,t+1))+0.0001; 76 *Update the link with the largest distance change 77 Trig(i,j,k,t+1)$(degree(i,t) ge 3)=Trig(i,j,k,t+1)$(TrigL(i,J,K,t+1) le Lmin(i,t+1)); 78 loop(i, 79 AdLink(j,k,t+1)$(Trig(i,j,k,t+1) and ord(j) lt ord(k))=1; 80 ); 81 loop(j, 82 MinLink2(i,k,t+1)$(Trig(i,j,k,t+1))=1; 83 ); 84 85 86 AdLinkL(t+1)=sum((j,k), AdLink(j,k,t+1)*uarc(j,k)); 87 MinLink2L(t+1)= sum((i,k), MinLink2(i,k,t+1)*uarc(i,k)); 88 sLmin(t+1)= sum(i,Lmin(i,t+1)); 89 90 *Upadate the link of TSP 91 fold(j,k,t+1)=fold(j,k,t)+AdLink(j,k,t+1)-MinLink2(j,k,t+1); 92 TSP_dist(t+1)=sum((i,ip),fold(i,ip,t+1)*uarc(i,ip)); 93 Degree(i,t+1)=sum(ip,fold(i,ip,t+1))+sum(iP,fold(ip,i,t+1)); 94 95 ); 96 97 execute_unload 'Handout_mst'; 98
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '16
  • Prime number, t iteration of operation

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern