¾Ë°í¸®ÁòÀ» ÀÚ¹Ù·Î Ç®´Ù°¡ ¸·Çû½À´Ï´Ù.

ÇÑŵ¿   
   Á¶È¸ 5301   Ãßõ 8    

shortestPath(v, weight, n)

     // v´Â ½ÃÀÛÁ¡, weight´Â °¡ÁßÄ¡ ÀÎÁ¢ Çà·Ä, nÀº Á¤Á¡¼ö

     // create S[n], Dist[n]

   for (i¬0; i<n; i¬i+1) do {

         S[i] ¬ false;  // S¸¦ ÃʱâÈ­

         Dist[i] ¬ weight[v, i];  // Dist¸¦ ÃʱâÈ­

   }

   S[v] ¬ true;

   Dist[v] ¬ 0;

   for (i¬0; i<n-2; i¬i+1) do {  // n-2¹ø ¹Ýº¹

         select u such that  // »õ·Î¿î ÃÖ´Ü °æ·Î¸¦ ¼±Á¤

               Dist[u] = min{Dist[j] | S[j] = false and 0¡Âj<n};  

         S[u] ¬ true;

         for (w¬0; w<n; w¬w+1) do {  // È®Á¤ÀÌ ¾ÈµÈ °æ·Îµé¿¡ ´ëÇØ ´Ù½Ã °è»ê

               if (S[w] = false) then {

                     if (Dist[w] > (Dist[u] + weight[u, w])

                           then Dist[w] ¬ Dist[u] + weight[u, w];

   }}}

end shortestPath




==================================================================================

À§¿¡°É º¸°í ÀÚ¹Ù·Î º¯È¯À» Çϴµ¥

select u such that Àú ºÎºÐÀ» ¾î¶»°Ô º¯È¯ÇؾߵÉÁö ¸ð¸£°Ú½À´Ï´Ù.

¿äºÎºÐ¸¸ ÇØ°áÇÏ¸é µÉµíÇѵ¥ ÀÚ¹Ù¸¦ ´Ù ¾È¹è¿ì°í ¾Ë°í¸®ÁòÀ» ÇÏ´ÂÁö¶ó... Àß ¸ð¸£°Ú½À´Ï´Ù.

¾Ë·ÁÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.
ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.


QnA
Á¦¸ñPage 2531/5682
2014-05   4951277   Á¤ÀºÁØ1
2015-12   1487932   ¹é¸Þ°¡
2016-12   5303   Çϼ¿È£ÇÁ
2006-06   5302   ¿ì½Â¿±
2014-10   5302   ¹Ú¼º¸¸
2016-03   5302   EYESSHOT
2008-11   5302   ÇÑŵ¿
2008-01   5302   ±è½Â¿ë
2008-04   5302   °û¼øÇö
2021-05   5302   SNRPL
2008-04   5302   µµ°Ç¿ì
2011-12   5302   ¼Òõ¹éÇâ
2014-04   5302   Á¶¿î
2014-08   5302   µ¥·Ô
2005-08   5302   ÃÖÁ¾Çå
2017-02   5302   °³¹é¼ö28È£
2008-05   5302   ±è°Ç¿ì
2005-12   5302   ±è´ë¼º
2014-11   5302   »Ç»ÇÁß
2005-12   5302   °­¸í±Õ
2006-03   5302   ±ÇÈñ¼®
2006-06   5302   °­Çö¼·