亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dijikstra.htm

?? 關于windows游戲編程的一些文章還有相關圖形
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<!--Header-->
<HTML>
<HEAD>
<TITLE>GPMega - Advanced Section - Shortest Paths: Dijkstra's Algorithm</TITLE>
</HEAD>
<BODY BGCOLOR=#000000 TEXT=#FFFFFF LINK=#00FF00 VLINK=#00FF00 ALINK=#0000FF>
<!--End Header-->
<!--Advertiser-->
<CENTER>
<TABLE>
<TR>
<TD>
<A HREF="http://www.ugo.com/">
<IMG SRC="/GPMega/ugologo120.gif" BORDER=0 WIDTH=120 HEIGHT=60></A>
</TD>
<TD>
<IMG SRC="/GPMega/sponsored.gif" WIDTH=468 HEIGHT=10><br><br>
<SCRIPT LANGUAGE= "JavaScript">
<!--
var now = new Date();
var random_num = now.getSeconds();
document.write("<A HREF='http://www.ugo.net/RealMedia/ads/click_nx.cgi/www.perplexed.com/GPMega/advanced/dijikstra.htm/" + random_num + "/@Top'>");
document.write("<IMG SRC='http://www.ugo.net/RealMedia/ads/adstream_nx.cgi/www.perplexed.com/GPMega/advanced/dijikstra.htm/" + random_num + "/@Top' BORDER='0' WIDTH='468' HEIGHT='60'></A>");
//-->
</SCRIPT>
</TD>
</TR>
</TABLE>
</CENTER>
<!--End Advertiser-->
<!--Splitter-->
<BR>
<!--End Splitter-->
<!--Body-->
<FONT SIZE=2 FACE=Helvetica>
<STRONG>
<!--Top Navigation-->
<A NAME="top"></A>
<CENTER>
<TABLE WIDTH=75%>
   <TR VALIGN=MIDDLE>
   <TD ALIGN=LEFT>
      <IMG SRC="gradsplit2.jpg" WIDTH=100% HEIGHT=1><BR><BR>
      <A HREF="http://www.perplexed.com/GPMega/"><IMG SRC="logo.jpg" BORDER=0 ALT="Home" WIDTH=80 HEIGHT=47 ALIGN=CENTER></A>
      <FONT COLOR=#666666 FACE=HELVETICA SIZE=-1><I>
      This Article Is Taken From <A HREF="http://www.perplexed.com/GPMega/">The Game Programming MegaSite</A>, A Definitive Resource For Game Developers!
      </I></FONT><BR>
      <IMG SRC="gradsplit2.jpg" WIDTH=100% HEIGHT=1>
   </TD>
   </TR>
</TABLE>
</CENTER>
<BR><!--End Top Navigation-->
<!--Title-->
<H3 ALIGN=CENTER><font color="#FFF800">S</font><font color="#FFF100">h</font><font color="#FFEA00">o</font><font color="#FFE300">r</font><font color="#FFDC00">t</font><font color="#FFD500">e</font><font color="#FFCE00">s</font><font color="#FFC700">t</font><font color="#FFC000"> </font><font color="#FFB900">P</font><font color="#FFB200">a</font><font color="#FFAB00">t</font><font color="#FFA400">h</font><font color="#FF9D00">s</font><font color="#FF9600">:</font><font color="#FF8F00"> </font><font color="#FF8800">D</font><font color="#FF8100">i</font><font color="#FF7A00">j</font><font color="#FF7300">k</font><font color="#FF6C00">s</font><font color="#FF6500">t</font><font color="#FF5E00">r</font><font color="#FF5700">a</font><font color="#FF5000">'</font><font color="#FF4900">s</font><font color="#FF4200"> </font><font color="#FF3B00">A</font><font color="#FF3400">l</font><font color="#FF2D00">g</font><font color="#FF2600">o</font><font color="#FF1F00">r</font><font color="#FF1800">i</font><font color="#FF1100">t</font><font color="#FF0A00">h</font><font color="#FF0300">m</font><BR><FONT SIZE=-2>By: <A HREF="mailto:crpalmer@undergrad.math.uwaterloo.ca">Chris Palmer</A></FONT></H3>
<!--End Title-->

<H3><FONT COLOR=YELLOW><I>Notes:</I></FONT></H3>

<P>This algorithm is not presented in the same way that you'll find it in most texts because i'm ignored directed vs. undirected graphs and i'm ignoring the loop invariant that you'll see in any book which is planning on proving the correctness of the algorithm.

<P>If we are dealing with a di-graph the algorithm will be the same with the only difference being the meaning attached to each edge.

<P>The loop invariant is that at any stage we have partitioned the graph into three sets of vertices (S,Q,U), S which are vertices to which we know their shortest paths, Q which are ones we have "queued" knowing that we may deal with them now and U which are the other vertices.  This information is important in proving the correctness and analyzing the running-time of the algorithm and not for understanding it (in my humble opinion).

<BLOCKQUOTE>
<FONT COLOR=RED>
	<DL>
		<DT><I>REF</I>: Cormen. Thomas H., Leiserson, Charles E., Rivest, Ronald L.,
		<DD><I>Introduction to Algorithms</I>, MIT Press (1990), pages 527-531
	</DL>
</FONT>
</BLOCKQUOTE>

<H3><FONT COLOR=YELLOW><I>Revision:</I></FONT></H3>

<P>The current revision of this page was last modified on November 18th, 1995.

<P>Given a graph G with a weight function wt:E(G)->R which maps the edges
to a real valued weight and wt(e) > 0 for all e in E(G).  NOTE: wt(e) > 0
is a VERY important assumption.  As i've presented the algorith, a weight
of 0 is not actually a problem (it could be for some implementations) but
a negative weight could/would result in an infinite loop.  For example,

<BLOCKQUOTE>
<PRE><FONT SIZE=2 COLOR=RED>
     *---- 1 ---*
      \        /
      -10     1
         \   /
          \ /
           *
</FONT></PRE>
</BLOCKQUOTE>

<P>will generate paths which cycle endlessly.

<P>You need an origin vertex (where all the paths are starting from, or,
more typically in games, where the paths are ending).

<P>Augment the labels of the vertices by a real value, initially infinity,
which is the shortest weighted path from the origin to this vertex (which
has been found so far).  Also, augment each vertex with a "pointer" to its
parent in the shortest weighted path found so far, initially have this
pointing nowhere.

<P>You need a priority queue which is sorted based on the weight of the
shortest path from the origin to the vertex.  When an element is inserted
into the priority queue and it already exists, the previous copy must be
removed and the new one inserted into the right level [*].

<P>Take the origin vertex, set the weight of the shortest path to 0 and
push it onto the priority queue.

<BLOCKQUOTE>
<PRE><FONT SIZE=2 COLOR=RED>
	while the priority queue is not empty, pop an entry <v,w_v,p_v> where
	  v is the vertex, w_v and p_v are the augmented labels of v.
	  foreach edge e=(v,u) in G, where u has augmented labels w_u, p_u.
	      if wt(e) + w_v < w_u then
        	  set p_u to v
	          set w_u to wt(e) + w_v
	          add <u, w_u, p_u> to the priority queue.
</FONT></PRE>
</BLOCKQUOTE>

<H3><FONT COLOR=YELLOW><I>Comments:</I></FONT></H3>

<P>Technically, [*] must be true because otherwise it would be impossible to
prove the correctness of the algorithm.  I've played with an personally
think that you can get a better performance (your priority queue becomes
almost O(1) with the cost of extra elements building up in the queue)
by relaxing this restriction and allowing multiple copies of the same
vertex to accumulate in the queue.

<P>The net effect will be that some sets of vertices may have to be cycled
through the queue several times (read "more cost").  It is my opinion
that this additional cost is considerably less than the O(log n) [n is
the size of the priority queue] time required to implement this algorithm
as described above.

<P>However, I have not attempted to analyze the worst case effect of relaxing
[*] and would say to implement it in this way only if you trust my guess.

<P>Also, note that if you were going to implement a heuristic for directing
the search, you wouldn't insert the weight of the shortest path from the
source node to this node.  Instead, you would insert the weight of the
shortest path from the source node to this node plus the heuristic's
estimate of the cost to the destination node.  I won't be discussing this
anymore until the very end of the document.

<H3><FONT COLOR=YELLOW><I>Tile/Grid Implementation:</I></FONT></H3>

<BLOCKQUOTE>
<FONT COLOR=RED>
	<DL>
		<DT><I>Def</I>: What I mean by "a game with a grid/tile map"
		<DD>A game where the playing area is dividing into squares with one or more "object" on the square.  These objects include walls, doors, etc which are assumed to occupy the entire square.
	</DL>
</FONT>
</BLOCKQUOTE>

<P>If you want to apply what i'm going to say where walls do not occupy the
entire square, you'll need a function wt({x,y}, {x',y'}) which gives the
cost of moving from (x,y) to (x',y') and otherwise it's the same.

<P>In a game with a grid map, you need a function (or a table or whatever)
which i'll call wt(x,y) which gives you the "cost" of moving onto a
specified grid location (x,y).  Note: "moving *onto*".  If you are
writing a dungeon based game and you have a teleporter at (a,b) that you don't
want the monsters to hit, make wt(a,b) = infinity where infinity is
some arbitrarily large number.  The same applies to walls, if you have a
wall square at (a,b) then wt(a,b) = infinity.

<P>For any square, there are at most 8 squares around it.  This is easy to
implement with an array that gives the offsets for each square.

<P>We'll assume that you don't want the shortest paths for the entire world
(which could be arbitrarily large) but instead want shortest paths for
only a limited area, say of width and height 2*DELTA+1.

<P>We will be storing elements in two arrays in positions [0..2*DELTA] which
correspond to the position on the map (o_x - x + DELTA - 1).  To make

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
男女视频一区二区| 欧美色图激情小说| 一本大道久久a久久精品综合| 日韩不卡一区二区三区| 视频一区视频二区在线观看| 午夜精品福利在线| 热久久国产精品| 国产69精品一区二区亚洲孕妇| www.亚洲色图.com| 欧美日韩国产精品成人| 日韩欧美成人激情| 中文av字幕一区| 亚洲大片免费看| 国产一区视频网站| 日本韩国欧美一区二区三区| 欧美精品电影在线播放| 国产日韩欧美激情| 久久精品99国产精品日本| 一区二区三区日韩精品视频| 欧美精品一区二区三区蜜臀| 久久精品夜色噜噜亚洲aⅴ| 国产精品久久夜| 亚洲一区视频在线观看视频| 美女网站色91| 91黄色免费看| 精品999久久久| 丝袜亚洲精品中文字幕一区| 日韩免费高清电影| 亚洲线精品一区二区三区 | 欧美天天综合网| 日韩三级免费观看| 中文字幕巨乱亚洲| 麻豆精品在线观看| 日本电影欧美片| 欧美精品一区在线观看| 亚洲精选视频免费看| 久久99精品久久久久久动态图| 国产999精品久久久久久绿帽| 欧美中文字幕久久| 中文字幕日本不卡| 国产精品一二二区| 91精品国产综合久久久久久| 亚洲免费资源在线播放| 成人午夜av电影| 日韩视频在线永久播放| 性做久久久久久免费观看 | 国产69精品久久777的优势| 亚洲精品在线观看视频| 日精品一区二区三区| 欧美日韩一级二级三级| 国产成人精品亚洲日本在线桃色 | 亚洲电影你懂得| 99久久综合99久久综合网站| 18成人在线视频| 色爱区综合激月婷婷| 亚洲欧美成aⅴ人在线观看| 成人综合婷婷国产精品久久| 欧美激情综合在线| 成人免费黄色大片| 国产精品国产a级| av成人免费在线| 亚洲成精国产精品女| 日韩欧美国产综合| 日本特黄久久久高潮| 久久只精品国产| www.欧美日韩| 视频一区欧美精品| 久久一留热品黄| 97se亚洲国产综合在线| 日本美女视频一区二区| 欧美日韩精品三区| 国产综合久久久久久鬼色| 日韩毛片视频在线看| 欧美日韩三级一区| 国产一区在线观看视频| 国产福利不卡视频| 图片区日韩欧美亚洲| 亚洲国产高清不卡| 欧美性大战久久| 国产专区综合网| 亚洲黄色小视频| 久久婷婷成人综合色| 欧美色图免费看| a级精品国产片在线观看| 麻豆高清免费国产一区| 亚洲影视在线观看| 亚洲欧美在线视频| 国产精品欧美久久久久一区二区| 日韩欧美国产三级电影视频| 欧美在线色视频| 99re热这里只有精品视频| 国产成人精品免费网站| 日韩高清在线一区| 亚洲精品大片www| 国产女人aaa级久久久级| 亚洲超碰97人人做人人爱| 成人欧美一区二区三区| 亚洲国产精品国自产拍av| 精品人在线二区三区| 欧美一区二区性放荡片| 欧美三级午夜理伦三级中视频| 菠萝蜜视频在线观看一区| 成人国产精品免费观看动漫| 大尺度一区二区| 91香蕉视频污| 欧洲日韩一区二区三区| 欧美在线视频全部完| 91精品麻豆日日躁夜夜躁| 欧美精品一区二区三| 欧美一区二区三区喷汁尤物| 精品少妇一区二区三区免费观看| 欧美va在线播放| 欧美大片免费久久精品三p| 欧美tickling网站挠脚心| 精品人在线二区三区| 国产精品国产a级| 亚洲成人久久影院| 久久国产视频网| 成人久久久精品乱码一区二区三区| 日日骚欧美日韩| 久久国产免费看| 99久久精品国产麻豆演员表| 欧美日韩aaa| 国产精品污网站| 日韩黄色小视频| 高清成人免费视频| 欧美中文一区二区三区| 欧美大胆人体bbbb| 国产精品国产自产拍高清av王其| 亚洲精品视频一区二区| 秋霞午夜鲁丝一区二区老狼| 成人午夜又粗又硬又大| 日韩一区和二区| 午夜在线成人av| 北条麻妃一区二区三区| 26uuu色噜噜精品一区| 亚洲精品一二三| 老司机免费视频一区二区| 成人黄页在线观看| 欧美亚洲动漫另类| 国产精品视频看| 老司机免费视频一区二区| 欧美日韩国产123区| 一区二区三区精品视频在线| 久久国产精品露脸对白| 欧美精品1区2区| 亚洲影院理伦片| 成人h精品动漫一区二区三区| 在线成人av影院| 亚洲成a人片在线不卡一二三区| av在线免费不卡| 日韩理论片中文av| www.欧美日韩国产在线| 久久亚洲影视婷婷| 成人午夜视频网站| 日韩美女精品在线| 91丨porny丨中文| 亚洲免费在线看| 欧美体内she精高潮| 日韩精品欧美成人高清一区二区| 欧美亚洲精品一区| 日韩和欧美一区二区三区| 欧美巨大另类极品videosbest | 91欧美一区二区| 亚洲色欲色欲www| 91麻豆6部合集magnet| 亚洲成人资源在线| 日韩限制级电影在线观看| 成人在线视频一区二区| 一二三四社区欧美黄| 制服视频三区第一页精品| 日本午夜精品一区二区三区电影| 精品国产精品网麻豆系列| 国产不卡高清在线观看视频| 亚洲色图另类专区| 91精品国产一区二区人妖| 国产一区二区三区久久久| 一区二区三区在线免费视频| 久久久蜜桃精品| 欧洲色大大久久| 国产精选一区二区三区| 亚洲人妖av一区二区| 欧美疯狂做受xxxx富婆| 高清av一区二区| 亚洲国产成人91porn| 国产精品色一区二区三区| 日韩三级.com| 色婷婷综合久久久久中文| 国产麻豆欧美日韩一区| 亚洲男同1069视频| 久久综合色鬼综合色| 精品1区2区3区| 色哟哟一区二区在线观看| 国产精品一区二区三区乱码| 蜜桃av一区二区在线观看| 亚洲一区在线电影| 欧美激情艳妇裸体舞| 欧美日韩一级视频| 97久久精品人人做人人爽50路| 久久99国产精品久久99果冻传媒|