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

ÇÑŵ¿   
   Á¶È¸ 5346   Ãßõ 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 3143/5688
2014-05   5007307   Á¤ÀºÁØ1
2015-12   1543125   ¹é¸Þ°¡
2017-01   5345   ±è°Ç¿ì
2015-03   5345   ±èÁ¦¿¬
2006-01   5345   À¯¼º¸ð
2021-04   5345   ÄËƲ¸®12
2015-09   5345   ¸Ö¸°
2005-08   5345   ¹ÚÁøÇÑ
2016-06   5345   Çϼ¿È£ÇÁ
2018-12   5345   ĵÀ§µå
2013-11   5345   ÀÌÀ纹2
2012-09   5345   monan
2012-10   5345   ¹é½Âö
2016-11   5345   ÄĹÚ
2013-05   5346   Sico
2015-02   5346   Æĸ®´ë¿Õ
2007-09   5346   Á¤ÀºÁØ
2005-08   5346   ÃÖÁ¾Çå
2016-04   5346   ¹æoÈ¿o¹®
2014-04   5346   ÇöÁ¤È£
2019-04   5346   Psychophysi¡¦
2007-06   5346   ÃÖâÇö