A3 ×î´óÁãÊÛÁ¿ 14 9 ¡Ì 8 ¡Ì 10 12
9.22ij²úÆ·´Ó²Ö¿âÔËÍùÊг¡ÏúÊÛ¡£ÒÑÖª¸÷²Ö¿âµÄ¿É¹©Á¿¡¢¸÷Êг¡ÐèÇóÁ¿¼°´ÓAi²Ö¿âµ½BjÊг¡µÄÔËÊäÄÜÁ¦Èç±í9-6Ëùʾ£¨±íÖС°¡ª¡±±íʾÎÞ·¿Éͨ£©£¬ÊÔÇó´Ó²Ö¿â¿ÉÔËÍùÊг¡µÄ×î´óÁ÷Á¿£¬¸÷Êг¡ÐèÇóÄÜ·ñÂú×㣿
±í9-6
ÊÐ²Ö ¿â ³¡ B1 30 ¡ª 20 20 B2 10 ¡ª 10 20 B3 ¡ª 10 40 60 B4 40 50 5 20 ´æ»õÁ¿ A1 A2 A3 ×î´óÁãÊÛÁ¿ 20 20 100
9.23 ijµ¥Î»ÕÐÊÕ¶®¶í¡¢Ó¢¡¢ÈÕ¡¢µÂ¡¢·¨ÎĵķÒë¸÷Ò»ÈË£¬ÏÖÓÐÎåÈËӦƸ£¬ÒÑÖªÒÒ¶®¶íÎÄ£¬¼×¡¢ÒÒ¡¢±û¡¢¶¡¶®Ó¢ÎÄ£¬¼×¡¢±û¡¢¶¡¶®ÈÕÎÄ£¬ÒÒ¡¢Î춮µÂÎÄ£¬Î춮·¨ÎÄ£¬ÎÊÕâÎå¸öÈËÊÇ·ñ¶¼Äܱ»Ó¦Æ¸£¿×î¶à¼¸¸öµÃµ½ÕÐƸ£¬ÕÐƸºóÿÈË´ÓÊÂÄÄÒ»·½ÃæµÄ·Ò빤×÷£¿
9.24 ÓÃFloydËã·¨·Ö±ðÇóͼ9-32ËùͼÖÐÈÎÒâÁ½µã¼äµÄ×î¶Ì·¾¶¼°³¤¶È¡£
v11275261142-58v4v1v3-252-2
v4v24-4v3 (a) (b)
ͼ9-32
9.25 ij¹«Ë¾ÔÚÁù¸ö³ÇÊÐc1,c2,?,c6ÖÐÓзֹ«Ë¾£¬´Óciµ½cjµÄÖ±½Óº½³ÌƱ¼ÛÈçÏÂÊö¾ØÕóÖеÄ(i,j)λÖÃÉÏ£¨?±íʾÎÞÖ±½Óº½Â·£©¡£ÇëÄãÉè¼ÆÒ»ÕÅÈÎÒâÁ½³ÇÊмäƱ¼Û×î±ãÒ˵Ä·Ïß±í¡£
?0?50?????40?25??10
402510?01520?25??150102020??
201001025??2010055??25?25550?33
50?¡ì9.4Ï°Ìâ½â´ð
9.1 ½â£º(1)´í¡£Í¼ÂÛÖеÄͼֻ·´Ó³Á˵ã±ßÖ®¼äµÄ¹ØÁª¹Øϵ£¬¶øÓëµãµÄλÖᢱߵÄÐÎ×´ºÍ´óСÎ޹ء£
(2)¶Ô¡£ÔÚÊ÷ͼÖУ¬Èôɾ³ýÆäÖÐÈÎÒ»±ß£¬Ôò²»Á¬Í¨£¬Òò´ËÊ÷ͼÊÇGÖбßÊý×îÉÙµÄÁ¬Í¨×Óͼ¡£
(3)´í¡£Ê×ÏÈ£¬ÓÉÓÚv1ÖÁ¸÷µã¶¼ÓÐ×î¶Ì·£¬´Ë×ÓͼΪÁ¬Í¨µÄ£»Æä´Î£¬ÓÉÓÚ×î¶Ì·µÄΨһÐÔ£¬´Ë×ÓͼÎÞȦ£¬¼´ÎªÖ§³ÅÊ÷¡£µ«´Ë×Óͼ²»Ò»¶¨ÊÇ×îС֧³ÅÊ÷¡£ÀýÈ磺
v2(v3,5)v1(?,0)v3(v1,1)v5(v6,9)v7(v5,13)v4(v3,3)v6(v3,6)v8(v6,14)
(a)
v244v2v11v32v5334v7v11v32v5334v768v4v6v8
v4v6v8
(b) (c)
ͼ9-33
ÔÚͼ9-33(a)ÖУ¬ÓÃDijkstra±êºÅ·¨¿ÉÇóµÃv1ÖÁÆäÓà¸÷µãµÄ×î¶Ì·£¬¿ÉµÃÖ§³ÅÊ÷Èçͼ9-33 (b)Ëùʾ£¬È¨ÊýºÍΪ25£¬¶øÔÚͼ(a)ÖÐÓÃÆÆȦ·¨¿ÉÇóµÃ×îС֧³ÅÊ÷Èçͼ9-33 (c)Ëùʾ£¬È¨ÊýºÍΪ23¡£ËùÒÔ£¬Í¼9-33 (b)²»ÊÇ×îС֧³ÅÊ÷¡£
(4)¶Ô¡£
9.2Ö¤Ã÷£ºÓÉÓÚGΪһ¸ö¼òµ¥Í¼£¬Òò´ËGÖв»´æÔÚƽÐбߡ£Èç¹ûGÖдæÔÚÒ»
2¸ö¹ÂÁ¢µã£¬ÔòÆäÓàn?1¸ö¶¥µãÖ®¼ä×î¶àÓÐCn?1?(n?1)(n?2)Ìõ±ß£¬ÓÉÓÚGÖбß2Êým?(n?1)(n?2)£¬¹ÊGÖв»´æÔÚ¹ÂÁ¢µã¡£
29.3Ö¤Ã÷£º½«Ã¿¸öÆóÒµÊÓΪÎÞÏòͼÖеÄÒ»¸ö¶¥µã£¬Á½¸öÆóÒµÖ®¼äÓÐÒµÎñÍùÀ´ÊÓΪ¸ÃͼÖеÄÒ»Ìõ±ß£¬ÏÔÈ»Õâ¸öͼÊÇÒ»¸ö¼òµ¥Í¼¡£
34
(1)¼ÙÉèÿ¸öÆóÒµ¶¼Ö»ÓëÆæÊý¸öÆóÒµÓÐÒµÎñÍùÀ´£¬Òò´Ë£¬Óëÿ¸ö¶¥µã¹ØÁªµÄ±ßµÄÊýÁ¿¾ùΪÆæÊý£¬¶ÔÓ¦µÄÁÚ½Ó¾ØÕóBΪһ¸öÆæÊý½×µÄ¶Ô½ÇԪΪ0µÄ¶Ô³Æ¾ØÕó£¬ÇÒÿһÐУ¨ÁУ©Ö»ÓÐÆæÊý¸öÔªËØΪ1£¬Òò´ËÁÚ½Ó¾ØÕóBµÄΪ1µÄÔªËØÊýÁ¿Ò²±ØȻΪÆæÊý£¬ÓëBΪ¶Ô³Æ¾ØÕóì¶Ü£¬Òò´ËÖÁÉÙÓÐÒ»¸öÆóÒµÓëÆäËûżÊý¸öÆóÒµÓÐÒµÎñÍùÀ´¡£
(2)ͬÑù£¬Èç¹ûÓÐżÊý¸öÆóÒµÓëÆäËûżÊý¸öÆóÒµÓÐÒµÎñÍùÀ´£¬ÆäËûÆæÊý¸öÆóÒµÖ»ÄÜÓëÆæÊý¸öÆóÒµÍùÀ´£¬ÄÇôÁÚ½Ó¾ØÕóBÖÐÒÀȻֻÓÐÆæÊý¸öÔªËØΪ1£¬ÓëBΪ¶Ô³Æ¾ØÕóì¶Ü¡£²»¿ÉÄÜÓÐżÊý¸öÆóÒµÓëÆäËûżÊý¸öÆóÒµÓÐÒµÎñÍùÀ´¡£
9.4 Ö¤Ã÷£º(1) ÔÚ¼òµ¥Í¼ÖУ¬²»´æÔÚÖ»ÓëÒ»¸ö¶¥µã¹ØÁªµÄ±ß£¬Ã¿Ìõ±ß¶¼Ç¡ÓëÁ½¸ö²»Í¬µÄ¶¥µã¹ØÁª¡£ÏÔÈ»ÓëËùÓб߹ØÁªµÄ¶¥µãµÄÊýÁ¿¾ÍÊǸÃͼÖÐËùÓж¥µã´ÎµÄºÍ£¬Òò´Ë¼òµ¥Í¼ÖÐËùÓж¥µã´ÎµÄºÍÒ»¶¨ÎªÅ¼Êý£¬ÇÒΪͼÖбߵÄÊýÁ¿µÄÁ½±¶¡£
(2) Èç¹ûÔÚ¼òµ¥Í¼ÖдæÔÚÆæµã£¬ÇÒÖ»ÓÐÆæÊý¸öÆæµã£¬ÄÇôËùÓж¥µã´ÎµÄºÍ¾ÍÊÇÆæÊý£¬Ã¬¶Ü£¬Òò´Ë¼òµ¥Í¼ÖÐÆæµãµÄ¸öÊýÒ»¶¨ÎªÅ¼Êý¡£
9.5Ö¤Ã÷£º(1)G?(V,E)ÊÇÒ»¸ö¼òµ¥Í¼£¬¼´¸ÃͼÖÐÎÞ»·£¬ÎÞƽÐбߡ£ÒÑÖª
?(G)?2£¬¼ÙÉèGÖÐÎÞȦ£¬ÔòG¿ÉÄÜΪÊ÷»ò·ÇÁ¬Í¨Í¼£¬¸ÃÁ½ÖÖÇé¿öϾù´æÔÚÐü¹Òµã£¬¼´?(G)?min{d(v)}?1£¬ÕâÓëÒÑ֪ì¶Ü¡£¹Ê¼ÙÉè²»³ÉÁ¢£¬G±ØÓÐȦ¡£
v?V(2)Èô?(G)?2£¬ÉèÓë?(G)¶ÔÓ¦µÄµãΪvk£¬¼´vk±ØÓë?(G)¸ö¶ËµãÏàÁ¬¡£¸ù¾Ý(1)µÄ½áÂÛ£¬GÖбØÓÐȦ£¨ÓÉÓÚ¶ÔȦÖеÄÁ¬Í¨Í¼¶øÑÔ£¬vkÖÁÉÙÓëÕâ?(G)¸ö¶Ëµã¹¹³ÉȦ£©¡£vi(i?1,2,?,?(G))µÄ´ÎÖÁÉÙΪ?(G)£¬Ò²ÖÁÉÙÓë?(G)¸ö¶ËµãÏàÁ¬¡£ÈçvkÓë
viÕâ?(G)?1¸ö¶Ëµã²»¹¹³ÉȦ£¬ÔòÔڶ˵㴦±ØÏòÍâÑÓÉ죨Òò´ÎÖÁÉÙΪ?(G)£¬²»Óë
ÆäÖÐijµãÏàÁ¬£¬±ØÓëÆäÍâijµãÏàÁ¬£©¾Á¬Í¨Á´¶øµ½ÁíÒ»¶Ëµã£¬¶Ô¸Ãͼ¶øÑÔ£¬±ßÊý´óÓÚ?(G)?1Ìõ£¬¹ÊGÖбØÓаüº¬ÖÁÉÙ?(G)?1Ìõ±ßµÄȦ¡£
9.6 Ö¤Ã÷£ºÒòΪGÁ¬Í¨ÇÒ²»º¬Ææµã£¬Ôòd(v)?2n£¬ÎÞÐü¹Òµã£¬¸ù¾ÝÏ°Ìâ9.5ÖеĽáÂÛ£¬G±ØÓÐȦ£»ÓÖÒòΪGÊÇÁ¬Í¨µÄ£¬ËùÒÔ´ÓGÖÐÈ¥µôÈÎÒ»Ìõ±ß£¬ÀýÈçÔÚijһȦÖУ¬´ÓȦÖÐÈ¥µôÈÎÒ»Ìõ±ß£¬ËùµÃÈÔÊÇÁ¬Í¨Í¼¡£
9.7 Ö¤Ã÷£º¸ù¾ÝÑ°Çó×î´óÁ÷µÄ±êºÅ·¨£¬³õʼfij?0¡£
ÒòΪ¶Ô»¡(vi,vj)£¬vj±êºÅ£¬l(vj)?min{¡£¶Ô»¡(vj,vi)£¬vj±êºÅ£¬l(vci),ij?fij}l(vj)?min{l(vi),fij¡£}ÒÀ´ÎÀàÍÆ£¬ÒòΪcij¾ùΪÕûÊý£¬ËùÒÔ×îÖյõ½µ÷ÕûÁ¿??l(ci)ҲΪÕûÊý¡£
35
?fij???fij'??fij???f?ij(vi,vj)???(vi,vj)??? (vi,vj)??±êºÅ×îÖÕ½á¹û£¬µÃ×î´óÁ÷f±ØΪÕûÊý¡£
9.8 ½â£º¸ÃͼµÄ¹ØÁª¾ØÕóΪ
e1A?1B??1C?0A??D?0E?0?F?0G??0e2e3e4e5e6e7e8e9e10e111010000000?1100000000??0101101000??0011010000?0000110001??0000001110?0000000011??
¸ÃͼµÄÁÚ½Ó¾ØÕóΪ
BCDEFGA201000?B010000??C101110?B??D010100?E011001??F010011?G000110??
9.9 ½â£º¸ÃÓÐÏòͼµÄ¹ØÁª¾ØÕóΪ
A?0?2??0??1?0??0?0?e1v1?1?A?v2?-1v3?0?v4?0v1v1?0?B?v2?0v3?1?v4?1e2-1010v21010v30000e3-1001e40-110e5010-1e60?0??1??-1?
¸ÃÓÐÏòͼµÄÁÚ½Ó¾ØÕóΪ
v40?1??1??0?
9.10 ½â£ºÕâÏÔÈ»ÊÇÒ»¸ö×îС֧³ÅÊ÷ÎÊÌâ¡£ÎÒÃDzÉÓÃÆÆȦ·¨Çó½â£¬Öð²½½«Íø
36