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

ÇÑŵ¿   
   Á¶È¸ 5322   Ãßõ 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 4213/5686
2014-05   4979022   Á¤ÀºÁØ1
2015-12   1515147   ¹é¸Þ°¡
2005-05   5637   õÈñ½Â
2002-10   25867   ÃÖ¿µ¿ì
2005-08   5578   ±è¼º±â
2005-10   5560   ¹èµ¿°ü
2006-01   5276   ¾ÈâÁØ
2003-07   9915   ±èÇüÁø
2006-04   5150   ÀÌ°ü¿õ
2004-12   6889   ÃÖÁöÈÆ
2007-10   5789   ÀÌÁؼº
2003-10   8544   ¹Ú¸íÈÆ
2003-11   10062   ¿À°æ
2006-06   5628   ÀÌÅÂÈ£
2005-07   5578   À¯»ç¿ë
2008-11   7795   ¹Úµ¿¼±
2003-10   9862   ¹Úµ¿¼±
2003-10   10245   ±è°Ç¿ì
2019-09   4842   ½Ãµµ´Ï
2003-02   12001   ÃÖºÀ±Ô
2005-11   5451   À±¿µ¹è
2003-06   8953   ±èÈ«±â