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

ÇÑŵ¿   
   Á¶È¸ 5351   Ãßõ 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 3142/5689
2014-05   5010488   Á¤ÀºÁØ1
2015-12   1546172   ¹é¸Þ°¡
2006-01   5351   ±ÇÈñ¼®
2009-02   5351   Àå¼ø¿­
2007-06   5351   ÃÖâÇö
2006-03   5351   À̹®Èì
2006-05   5351   À¯»ç¿ë
2006-02   5351   ±èÈ«±æ
2006-07   5351   °íÀ±Ã¶
2014-10   5351   ¹Î¼ºÀÏ
2011-12   5351   ¹Ì¼ö¸Ç
2015-02   5351   QS¿ÕÅëÅ°¼Õ¡¦
2016-11   5351   ÄĹÚ
2008-11   5352   ÇÑŵ¿
2005-10   5352   À±È£¿ë
2013-01   5352   ÀÌõdz
2008-10   5352   ±èÀºÈ£
2018-09   5352   ¹Î»çÀå
2015-02   5352   Æĸ®´ë¿Õ
2016-07   5352   ÆËÀÌÁÁ¾Æ
2005-06   5352   ¹ÚÂù¹Î
2006-03   5352   ½É±Ô»ó