PHẦN PHỤ LỤCPhụ lục 1Unit chứa khai báo các cấu trúc dữ liệu cho đồ thịvà cài đặt thủ tục tìm đường đi ngắn nhất theo thuật toánunit Func_DoThi;interfacetype TypeToaDo=record x,y:integer; end; TypeChiPhi=record VoCung:boolean;//Neu VoCung=True thi co nghia la chi phi bang Vo Cung, nguoc lai thi chi phi bang Gia Gia:real; end; TypeDinh=record Ten:String; ToaDo:TypeToaDo; MucKichHoat:Byte; end; TypeDanhSachDinh=array of TypeDinh; TypeCanh=record DinhDau,DinhCuoi:Integer;//Tham chieu trong danh sach Dinh TrongSo:TypeChiphi; end; TypeDanhSachCanh=Array of TypeCanh; TypeDoThi=Record SoDinh:Integer; DSDinh:TypeDanhSachDinh; SoCanh:Integer; DSCanh:TypeDanhSachCanh; end; TypeCost=Array of Array of TypeChiPhi; TypeDist=Array of TypeChiPhi; TypeDuongDi=Array of Integer;Function DuongDiNganNhat(G:TypeDoThi;X,Y:Integer;Var DuongDiTuXdenY:TypeDuongDi;Var ChiPhi:real):Boolean;Procedure DeleteGraph(VAR G:TypeDoThi);var G:TypeDoThi;implementationFunction DuongDiNganNhat(G:TypeDoThi;X,Y:Integer;Var DuongDiTuXdenY:TypeDuongDi;var ChiPhi:real):Boolean;Var s:Array of byte;{S[i]=0 hoac S[i]=1}Cost:TypeCost;Dist:TypeDist;MocXich:Array of Integer;M,i,j,K,u,w:Integer;Min:TypeChiPhi;beginM:=G.SoDinh; {Thuc ra M=N, ma tran vuong kich thuoc MxM}Setlength(Cost,M,M);Setlength(Dist,M);Setlength(MocXich,M);Setlength(S,M);for i:=0 to M-1 do for j:=0 to M-1 do Cost[i,j].VoCung:=True;for k:=0 to G.SoCanh-1 do begin i:=G.DSCanh[K].DinhDau;j:=G.DSCanh[K].DinhCuoi; Cost[i,j]:=G.DSCanh[K].TrongSo; end;for i:=0 to M-1 do begin S[i]:=0;Dist[i]:=Cost[X,i];MocXich[i]:=X;end;S[X]:=1;Dist[X].VoCung:=False;Dist[X].Gia:=0;K:=2; {Dua X vao S}while k begin u:=0; While S[u]0 do u:=u+1; Min:=Dist[u];i:=u+1; While i begin If S[i]=0 then If ((Min.VoCung)and(not Dist[i].VoCung))or...
Phần bên dưới chỉ hiển thị một số trang ngẫu nhiên trong tài liệu. Bạn tải về để xem được bản đầy đủ
GỢI Ý
Những tài liệu gần giống với tài liệu bạn đang xem
GT toán rời rạc Phụ lục 1 1PHẦN PHỤ LỤCPhụ lục 1Unit chứa khai báo các cấu trúc dữ liệu cho đồ thịvà cài đặt thủ tục tìm đường đi ngắn nhất theo thuật toánunit Func_DoThi;interfacetype TypeToaDo=record x,y:integer; end; TypeChiPhi=record VoCung:boolean;//Neu VoCung=True thizip Đăng bởi pfloyd611
5 stars -
330429 reviews
Thông tin tài liệu
23 trang
Đăng bởi: pfloyd611 -
14/01/2025
Ngôn ngữ: Việt nam, English
5 stars -
"Tài liệu tốt"
by khotrithucso.com,
Written on
14/01/2025
Tôi thấy tài liệu này rất chất lượng, đã giúp ích cho tôi rất nhiều. Chia sẻ thông tin với tôi nếu bạn quan tâm đến tài liệu: GT toán rời rạc Phụ lục 1 1