Floyd-Warshall算法描述 1)適用范圍: a)APSP(All Pairs Shortest Paths) b)稠密圖效果最佳 c)邊權(quán)可正可負(fù) 2)算法描述: a)初始化:dis[u,v]=w[u,v] b)For k:=1 to n For i:=1 to n For j:=1 to n If dis[i,j]>dis[i,k]+dis[k,j] Then Dis[I,j]:=dis[I,k]+dis[k,j] c)算法結(jié)束:dis即為所有點(diǎn)對(duì)的最短路徑矩陣 3)算法小結(jié):此算法簡(jiǎn)單有效,由于三重循環(huán)結(jié)構(gòu)緊湊,對(duì)于稠密圖,效率要高于執(zhí)行|V|次Dijkstra算法。時(shí)間復(fù)雜度O(n^3)。 考慮下列變形:如(I,j)∈E則dis[I,j]初始為1,else初始為0,這樣的Floyd算法最后的最短路徑矩陣即成為一個(gè)判斷I,j是否有通路的矩陣。更簡(jiǎn)單的,我們可以把dis設(shè)成boolean類型,則每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”來代替算法描述中的藍(lán)色部分,可以更直觀地得到I,j的連通情況。
標(biāo)簽: Floyd-Warshall Shortest Pairs Paths
上傳時(shí)間: 2013-12-01
上傳用戶:dyctj
用C++中的MFC編程實(shí)現(xiàn)正軸等角割圓柱投影,實(shí)現(xiàn)以下要求: 取克拉索夫斯基橢球 (1)制圖區(qū)域: Bs=0°, BN=25° LE=105°, LE=125° (2)經(jīng)緯線間隔: ΔB=ΔL=5° (3)制圖比例尺: 1:M0=1:1000 000 (4)標(biāo)準(zhǔn)緯線: Bk=±15° 計(jì)算經(jīng)緯網(wǎng)格點(diǎn)的 x, y,m,n, p
標(biāo)簽: MFC 編程實(shí)現(xiàn) 正 投影
上傳時(shí)間: 2013-12-29
上傳用戶:himbly
"棧頂運(yùn)算符為: %c\n",getTop(optr)) printf("此時(shí)運(yùn)算符為:%c\n",e) printf("棧頂運(yùn)算符優(yōu)先級(jí)低,%c進(jìn)棧\n",e) push(optr,e) //e進(jìn)運(yùn)算符棧
標(biāo)簽: printf getTop optr 棧
上傳時(shí)間: 2016-02-25
上傳用戶:英雄
約瑟夫問題的C語言程序,基本實(shí)現(xiàn)其功能,可以輸入N個(gè)人數(shù),進(jìn)行結(jié)果計(jì)算輸出
標(biāo)簽: C語言程序
上傳時(shí)間: 2013-12-24
上傳用戶:cylnpy
數(shù)據(jù)結(jié)構(gòu)(嚴(yán)慰敏)配套純c代碼實(shí)驗(yàn)十 typedef int InfoType // 定義其它數(shù)據(jù)項(xiàng)的類型 typedef int KeyType // 定義RedType類型的關(guān)鍵字為整型 struct RedType // 記錄類型(同c10-1.h) { KeyType key // 關(guān)鍵字項(xiàng) InfoType otherinfo // 其它數(shù)據(jù)項(xiàng) } typedef char KeysType // 定義關(guān)鍵字類型為字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化靜態(tài)鏈表L(把數(shù)組D中的數(shù)據(jù)存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
標(biāo)簽: typedef int InfoType KeyType
上傳時(shí)間: 2016-03-03
上傳用戶:2404
The market for miniature computer programming is exploding. C++ Footprint and Performance Optimization supplies programmers the knowledge they need to write code for the increasing number of hand-held devices, wearable computers, and intelligent appliances. This book gives readers valuable knowledge and programming techniques that are not currently part of traditional programming training. In the world of C++ programming, all other things being equal, programs that are smaller and faster are better. C++ Footprint and Performance Optimization contains case studies and sample code to give readers concrete examples and proven solutions to problems that don t have cut and paste solutions.
標(biāo)簽: Performance programming Optimizati Footprint
上傳時(shí)間: 2013-12-09
上傳用戶:wfl_yy
這是一個(gè)用C語言寫的禁忌搜索算法的解釋,解決了了一個(gè)n后問題,這是一個(gè)典型的介紹性的算法代碼。 很不錯(cuò)
上傳時(shí)間: 2014-01-02
上傳用戶:shinesyh
C++讀取Excel AppWizard uses "TODO:" to indicate parts of the source code you should add to or customize. If your application uses MFC in a shared DLL, and your application is in a language other than the operating system s current language, you will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. For example, MFC42DEU.DLL contains resources translated to German.) If you don t do this, some of the UI elements of your application will remain in the language of the operating system.
標(biāo)簽: AppWizard indicate custom source
上傳時(shí)間: 2016-03-12
上傳用戶:cazjing
對(duì)c++的介紹,適合初學(xué)者。系外文資料。
標(biāo)簽:
上傳時(shí)間: 2013-12-26
上傳用戶:jjj0202
冒泡法是數(shù)據(jù)排序的一種基本算法,它的基本方法是:相鄰兩元素進(jìn)行比較,如有需要?jiǎng)t進(jìn)行交換, 每完成一次循環(huán)就將最小元素排在最后(如從大到小排序),下一次循環(huán)是將其他的數(shù)進(jìn)行類似操作? 如將N 個(gè)數(shù)按從大到小排序,Turbo C語言程序函數(shù)
標(biāo)簽: 排序 元素 循環(huán) 數(shù)據(jù)
上傳時(shí)間: 2016-03-20
上傳用戶:趙云興
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1