This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: (a) (5) Explain what constitutes a valid input for the traveling salesman problem. An Mimi“ (mi5i: (sf at. m4
and Cu“ 41% “n, J’seuﬁlp‘ ““4 ammgf/‘V 0", 014150) ﬁx“ (.twrmi,3 o4 nmHJSWHH ”WM (2(1ij pLHan’lﬂl'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‘mﬂm sea {ﬂair “f7“ ta fﬁmmi +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, cCﬂM,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 afterhaving 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 speciﬁcally, 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 modiﬁed problem. How can you convert an input to this modiﬁed 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 modiﬁed 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 signiﬁcant partial, but not full, credit. '71 ) GWWl S—L+ {,4} .C bcHw C(Hct'wo Q43. AAA (3. Wm (3'3 n+1
CEC‘WHil—J = cC¢,gﬂx, 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 construcﬁon doés yield the correct solution. (WHOLM «M Isa/5‘90, 30(4me 710%!“ ‘Ith4 1“, ﬂw anwx'wm‘l' I ”h, ' J :5 Law
Iv. JFactgvjﬁ HA 4W I“H~o\& W raw HELJHCL j ‘ m’v/ : f1
ﬁve1'1 . CWfMCf 63W ﬂea/HM" 7” “CW!“W (”1 “HVI’J WEE j t M ﬂ 11 J gnu. rid/{43w (11H)$) hov (I, VH1) am 0W4wa‘w
MS “(k  ..
{HM +nm "+LL W m4 (/2 wmkmgwt L3 HM) (Ami/c. 7104.1 M ‘ ' _. ”(W
”ﬂu, cy‘ﬂkuJ 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 (LNS 916*" “{{{d “(Li I n+4
JmLny‘rwﬁ‘ 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 (WAF “(4 («4wa ‘
4 1o m «J .5 atomtm ‘93 ' “’1’” (mi u 0‘? ...
View
Full Document
 Fall '09
 TROTTER

Click to edit the document details