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

ÇÑŵ¿   
   Á¶È¸ 5297   Ãßõ 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 3141/5680
2015-12   1482140   ¹é¸Þ°¡
2014-05   4945458   Á¤ÀºÁØ1
2006-08   5285   ÃÖÀϼ·
2012-09   5285   monan
2015-10   5285   »Ú»ß
2005-12   5286   À±È£¿ë
2008-07   5286   ±¸¿µÈ¯
2007-03   5286   ±èÇѱ¸
2013-09   5286   ½Å¼º°ø
2007-10   5286   ½ÅÇöµ¿
2014-07   5286   Æĸ®´ë¿Õ
2005-12   5286   ±¸¸í¼­
2005-11   5286   ¿À»óÈÆ
2008-08   5286   ±è½Â±Ç
2007-02   5286   Çã´ë¿õ
2011-12   5286   MikroTikÀÌÁø
2008-03   5286   ¹Ú¿µ¼±
2020-03   5286   ÁÒ½´¾Æ
2006-01   5286   ÀÌÀ±
2008-07   5286   ÇѼº½Ä
2015-02   5286   ¹Ì¼ö¸Ç
2008-08   5286   ±èµ¿¼ö(PE)