{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

problem 2 - (a(5 Explain what constitutes a valid input for...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) (5) Explain what constitutes a valid input for the traveling salesman problem. An Mimi“ (mi-5i: (sf at. m4- and Cu“ 41% “n, J’seufilp‘ ““4 ammgf/‘V 0", 014150) fix“ (.twrmi,3 o4 nm-HJSWHH ”WM (2(1ij pLHan’lfll'n’ WW ‘ch datajimul Mml‘mio 602,2“) W4 hvi- lav/L 3!WM‘~ ,I\ ‘=‘)‘ __’-’r\) (b) (5) Explain what constitutes a feasible solution for the traveling salesman problem. A ffbmb’b SQKJW, m 0» ’l‘uw ll'xk‘l vaSH I cow!“ “‘3 word‘s) W”- . Raw“, h cm a Lug-.40. in «W M waltz}! in, a ”Madam Th) . Lurql'n "a. ulmd" mar 3“»-~~.,’e cantata WM v‘mflm sea {flair “f7“ ta ffimmi +6) TTCL") $er (c) (5) What is meant by an optimal solution for the traveling salesman problem? jtbo a (manila/(4 S‘lwl'w rf Mmm/WM 4‘.th Carl — sI- ’h-\ E cErrmgTu/HUD .4, cCflM,TFE1’D =\ (d) (10) You have spent a year developing fantastic code to solve the traveling salesman problem for your boss. Unfortunately, she comes to you now, and says that the situtation has changed, and there is a new requirement that states that there is one special city that must be Visited twice (that is, visited, and then visited again after-having been somewhere else in between). So, for example, if there are 4 cities, and city 2 is the special city, a feasible solution is the tour 1—>2——>3->2—>4—>1 butthetour 2—>3—>4—+1-—>2 is no longer feasible, nor is 1—)2—+2——>3—>4——>1 (since the two occurrances of city 2 are right after each other). More specifically, if the input is actually, —~ 1 100 100 1 — — 100 100 100 100 —— 1 100 100 1 — — and 2 is the special city, then it is not hardato see that 1—>2—>3—>4—>2——>1 is the optimal tour for the modified problem. How can you convert an input to this modified problem into an input for the ordinary traveling salesman problem so that when it is given to your code for the ordinary traveling salesman problem, (that is, the code that you already developed) the answer returned can be used to deduce the answer for the modified problem? Hint: you will need to add one extra city to your input. As before, if you explain how to convert the input above, but not in general, that will be good for significant partial, but not full, credit. '71 ) GWWl S—L+ {,4} .C bc-Hw C(Hct'wo Q43. AAA (3. Wm (3'3 n+1 CEC‘WHil—J = cC¢,gflx, 41”.“th (a \J..~,mh, was 5,- CL'VH'MKLE : CELL 3 316+ aCs’wlj = LYM+1,5’5 = (7“?) C , h h 1; wk»). C‘tm‘wcumm C633) 3=‘)w;h ‘ u A. ‘43 A” 64% (U745 Mmmn UUAL anJ (e) (10) Justify your answer that this construcfion doés yield the correct solution. (WHOLM «M Isa/5‘90, 30(4me 710%!“ ‘Ith4 1“, flw anwx'wm‘l' I ”h, -' J :5 Law Iv. JFactgvjfi HA 4W I“H~o\& W raw HELJ-HCL j ‘ m’v/ : f1 five-1'1 . CWfMCf 63W flea/HM" 7-” “CW!“W (”1 “HVI’J WEE j t M fl 11 J gnu. rid/{43w (11H)$) hov (I, VH1) am 0W4wa‘w MS “(k - .. {HM +nm "+L-L W m4 (/2 wmkmgwt L3 HM) (Ami/c. 7104.1 M ‘ ' _. ”(W ”flu, cy‘flkuJ Vé'L‘kmir‘ 4‘; ‘f‘u‘. T3? \H‘Ou“ (A (.4 W?! M “14!de n; FAW V K‘M O‘Hubk WA , WNW ‘ (RNA) mix A Any 4mm “x4 M «4 (~04, {1%th (SIM Mm’r (N135. Th” C. was sud "LL“! 6"" “in“ 0‘3"“ (ML) ‘AM‘V (LN-S 916*" “{{{d “(Li I n+4 JmLny-‘rwfi‘ 5 4:” ’ l, h‘ (mg! + ‘j\€‘(‘£0 6.. 1W1 + m ,2»? M W‘MJ TY? Vauw« Wt we, . ~ t/W VWML b") 5w 5') MW) W 6 b 7’ a, a . 0»: 3M W4 0.7 (0 ‘ a“ P (WA-F “(4 («4wa ‘ 4 1o m «J .5 atomtm ‘93 ' “’1’” (mi u 0‘? ...
View Full Document

{[ snackBarMessage ]}