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

ÇÑŵ¿   
   Á¶È¸ 5330   Ãßõ 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 2538/5687
2014-05   4993976   Á¤ÀºÁØ1
2015-12   1529895   ¹é¸Þ°¡
2006-05   5331   ÀÌÇü¼·
2016-11   5331   mjxaone
2009-01   5331   ±è°æ·Ï
2019-02   5331   ÄĹÚ
2014-10   5331   ¹Î¼ºÀÏ
2005-12   5331   ¹Ú¿ì¿­
2017-09   5331   ±èȲÁß
2007-05   5331   °­ÇѸð
2008-01   5331   Á¶Áß¿¬
2012-03   5331   GoodWolf
2006-06   5330   ¿ì½Â¿±
2013-05   5330   Sico
2005-10   5330   À±È£¿ë
2016-01   5330   jake
2006-02   5330   ÀÌ»ó¿­
2012-09   5330   ¹Ì¼ö¸Ç
2013-10   5330   ȲÁø¿ì
2015-03   5330   °ÉÀνÅȫö
2016-04   5330   ¹æoÈ¿o¹®
2012-10   5330   ½Å¼º°ø