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

ÇÑŵ¿   
   Á¶È¸ 5341   Ãßõ 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 2542/5688
2015-12   1540320   ¹é¸Þ°¡
2014-05   5004542   Á¤ÀºÁØ1
2005-11   5341   õ±â¼®
2012-03   5341   ¸¶ÀÌÄÚÄÚ
2017-01   5341   Áú¹®Çлý
2006-08   5341   ¾ÈâÁØ
2017-02   5341   EPKO
2017-09   5341   ±èȲÁß
2015-04   5341   ±¸¸í¼­
2007-05   5341   °­ÇѸð
2012-06   5341   ¿ÕÃʺ¸½´·º
2007-05   5341   ÀÓöÇõ
2006-03   5341   ±è¹Îö
2017-01   5341   °ÉÀνÅȫö
2005-09   5341   Áø¿øÀç
2006-06   5340   ¿ì½Â¿±
2015-09   5340   ¼­µ¿±¹
2015-02   5340   Æĸ®´ë¿Õ
2017-02   5340   °³¹é¼ö28È£
2016-04   5340   ¹æoÈ¿o¹®
2007-07   5340   À̰ǹÎ
2006-02   5340   ±èÈ«±æ