Floyd-Warshall算法描述 1)適用范圍: a)APSP(All Pairs Shortest Paths) b)稠密圖效果最佳 c)邊權可正可負 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)算法結束:dis即為所有點對的最短路徑矩陣 3)算法小結:此算法簡單有效,由于三重循環結構緊湊,對于稠密圖,效率要高于執行|V|次Dijkstra算法。時間復雜度O(n^3)。 考慮下列變形:如(I,j)∈E則dis[I,j]初始為1,else初始為0,這樣的Floyd算法最后的最短路徑矩陣即成為一個判斷I,j是否有通路的矩陣。更簡單的,我們可以把dis設成boolean類型,則每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”來代替算法描述中的藍色部分,可以更直觀地得到I,j的連通情況。
標簽: Floyd-Warshall Shortest Pairs Paths
上傳時間: 2013-12-01
上傳用戶:dyctj
數據結構(嚴慰敏)配套純c代碼實驗十 typedef int InfoType // 定義其它數據項的類型 typedef int KeyType // 定義RedType類型的關鍵字為整型 struct RedType // 記錄類型(同c10-1.h) { KeyType key // 關鍵字項 InfoType otherinfo // 其它數據項 } typedef char KeysType // 定義關鍵字類型為字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化靜態鏈表L(把數組D中的數據存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
標簽: typedef int InfoType KeyType
上傳時間: 2016-03-03
上傳用戶:2404
s1.c是server,c.c是client, server負責接收client傳的數字進行運算並回傳,運用了同步的機制。編譯須加 -lsocket -lpthread -lrt
標簽: server
上傳時間: 2014-01-02
上傳用戶:athjac
A* sudo sudo/* B* adduser script adduser C* rmuser script rmuser E* tout tout/* F* dumdum dumdum G* lostfile lostfile H* Mkfl.localsys Makefile.localsys I* spacegripe spacegripe J* sendmail.cf sendmail.cf N* remote remote.c O* distributed conrol distrib/* P* hosts and name server makerevhosts Q* xargs xargs/*
標簽: adduser script rmuser sudo
上傳時間: 2016-03-29
上傳用戶:gxrui1991
根據bluelab3.5.2實例hid-keyboard做出應用,能發出數字鍵1-5
標簽: hid-keyboard bluelab
上傳時間: 2013-12-24
上傳用戶:牧羊人8920
基于J2EE的物流信息系統的設計與實現 介紹了J2EE 體系結構、Mv c模式等相關概念和技術,并重點探討了 目 前比 較受歡迎的三種開源框架( s t r ut s框架、S Pr i n g框架和H i b e m a t e 框架)。 分析了他們的體系結構、 特點和優缺點。 根據J ZE E的分層結構,結合We b應用 的特點, 將三種框架進行組合設計, 即表現層用S t r ut s框架、 業務邏輯層用S P ri n g 框架、持久層用比b ema t e 框架,從而來構建物流信息系統。這種整合框架使各 層相對獨立, 減少各層之間的禍合程度,同時加快了系統的開發過程,增強了系 統的可維護性和可擴展性,初步達到了分布式物流信息系統的設計目標。 經過以上分析,結合物流系統的業務需求,進行了相關的實現。最后,系統 運用先進的A ja x技術來增強Ui層與服務器的異步通信能力, 使用戶體驗到動態 且響應靈 敏的桌 面級w e b應用程序。 通過江聯公司的試運行結果,系統達到了 渝瞇。 并 且 對 江 聯 公 司 提 出 了 基 于 R F I D 的 解 決 方 案 的 實 施 計 劃 。
上傳時間: 2016-06-01
上傳用戶:ynsnjs
求標準偏差 > function c=myfunction(x) > [m,n]=size(x) > t=0 > for i=1:numel(x) > t=t+x(i)*x(i) > end > c=sqrt(t/(m*n-1)) function c=myfunction(x) [m,n]=size(x) t=0 for i=1:m for j=1:n t=t+x(i,j)*x(i,j) end end c=sqrt(t/(m*n-1
標簽: gt myfunction function numel
上傳時間: 2014-01-15
上傳用戶:hongmo
求標準偏差 > function c=myfunction(x) > [m,n]=size(x) > t=0 > for i=1:numel(x) > t=t+x(i)*x(i) > end > c=sqrt(t/(m*n-1)) function c=myfunction(x) [m,n]=size(x) t=0 for i=1:m for j=1:n t=t+x(i,j)*x(i,j) end end c=sqrt(t/(m*n-1
標簽: gt myfunction function numel
上傳時間: 2013-12-26
上傳用戶:dreamboy36
求標準偏差 > function c=myfunction(x) > [m,n]=size(x) > t=0 > for i=1:numel(x) > t=t+x(i)*x(i) > end > c=sqrt(t/(m*n-1)) function c=myfunction(x) [m,n]=size(x) t=0 for i=1:m for j=1:n t=t+x(i,j)*x(i,j) end end c=sqrt(t/(m*n-1
標簽: gt myfunction function numel
上傳時間: 2016-06-28
上傳用戶:change0329
求標準偏差 > function c=myfunction(x) > [m,n]=size(x) > t=0 > for i=1:numel(x) > t=t+x(i)*x(i) > end > c=sqrt(t/(m*n-1)) function c=myfunction(x) [m,n]=size(x) t=0 for i=1:m for j=1:n t=t+x(i,j)*x(i,j) end end c=sqrt(t/(m*n-1
標簽: gt myfunction function numel
上傳時間: 2014-09-03
上傳用戶:jjj0202