网站大量收购独家精品文档,联系QQ:2885784924

数据结构D.S.期终复习幻灯片.ppt

  1. 1、本文档共197页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
第9章:图 1.无向图、有向图的有关概念 2.图的机内存储 邻接矩阵 邻接表 3.图的若干算法 1) 图的遍历----DFS BFS 2) 最小代价生成树---Prime算法 Kuscal算法 3) 最短路径-----Dijkstra算法 Floyed算法 4) 活动网络----AOV——拓扑排序 AOE——关键路径 4. 例1, 例2 第9章:图 2.图的机内存储 邻接矩阵 邻接表 Representation of graphs and digraphs 1.Adjacency Matrix G=(V,E), V={V1,V2,……,Vn} then the adjacency matrix of graph G: A(i,j)= 1 if i,j,j,i?E or (i,j)?E 0 otherwise Representation of graphs and digraphs For example: graph V1 V2 V3 V4 A(i,j)= 0 1 1 1 1 0 1 1 1 1 0 0 1 1 0 0 1)Adjacency matrix of graph is a symmetric matrix 2) ?A(i,j)= ?A(j,i)=di (degree of vertex i) n j=1 n j=1 Representation of graphs and digraphs Digraph V1 V2 V5 V4 V3 A(i,j)= 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 ?A(i,j)= diout ?A(j,i)=diin j=1 n n j=1 Representation of graphs and digraphs Representation of networks, replace 1 with weights, others with ∞ W(i,j) if i!=j and i,j,j,i?E or(i,j)?E ∞ otherwise A(i,j)= Representation of graphs and digraphs For example: 除了邻接矩阵外,还要顶点信息表. 3 4 1 2 8 6 2 3 1 4 9 5 A(i,j)= ∞ 1 ∞ 4 ∞ ∞ 9 2 3 5 ∞ 8 ∞ ∞ 6 ∞ Representation of graphs and digraphs 2. Linked-adjacency Lists reduce the storage requirement if the number of edges in the graph is small. V1 V3 V2 V4 4 3 0 2 4 3 0 1 1 2 0 1 2 0 1 2 3 4 h dest link Representation of graphs and digraphs Digraph: V1 V2 V3 11 3 4 6 2 2 4 3 11 0 3 2 0 1 6 1 3 0 1 2 3 h dest cost link 2 6 3 3 0 2 2 0 1 4 0 1 11 1 2 3 h data adj Node Table: dest cost link 第9章:图 3.图的若干算法 1) 图的遍历----DFS BFS 以有向图为例: v1 v2 v6

您可能关注的文档

文档评论(0)

开心农场 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档