【精品数据结构】graphs

【精品数据结构】graphs

ID:40137535

大小:152.00 KB

页数:31页

时间:2019-07-23

【精品数据结构】graphs_第1页
【精品数据结构】graphs_第2页
【精品数据结构】graphs_第3页
【精品数据结构】graphs_第4页
【精品数据结构】graphs_第5页
资源描述:

《【精品数据结构】graphs》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Chapter12GraphsMaintopicsDefinitionofgraphsandsometerminologyThreecommongraphrepresentationsSomealgorithms12.1DefinitionandterminologiesDefinitionofgraphs:Graph=(V,E)V:nonemptyfiniteverticesetE:edgesetUndirectedpraph:Ifthetupledenotinganedgeisunordered,then(v1,v2)and(v2,v1

2、)arethesameedge.12.1DefinitionandterminologiesDirectedgraph:Ifthetupledenotinganedgeisordered,then(v1,v2)and(v2,v1)aredifferentedges.12.1DefinitionandterminologiesExample:V2V4V3V1V(G1)={V1,V2,V3,V4}E(G1)={(V1,V2),(V1,V3),(V1,V4),(V2,V3),(V2,V4),(V3,V4)}V1V2V(G2)={V1,V2,,V3

3、}E(G2)={,,}V312.1DefinitionandterminologiesWewillnotdiscussgraphsofthefollowingtypes12.1Definitionandterminologies2.CompletegraphInanundirectedgraphwithnnodes,thenumberofedges<=n*(n-1)/2.If“=“issatisfied,thenitiscalledacompleteundirectgraph.V2V4V3V112.

4、1DefinitionandterminologiesInadirectedgraphwithnnodes,thenumberofedges<=n*(n-1).If“=“issatisfied,thenitiscalledacompletedirectedgraph.12.1Definitionandterminologies3.degreediofvertexi,TD(v):isthenumberofedgesincidentonvertexi.Inadirectedgraph:in-degreeofvertexiisthenumbero

5、fedgesincidenttoi,ID(v).out-degreeofvertexiisthenumberofedgesfromthei,OD(v).12.1DefinitionandterminologiesTD(v)=ID(v)+OD(v)Generally,iftherearenverticesandeedgesinagraph,thene=(TD(vi))/2v1v2v3ID(v2)=1OD(v2)=2TD(v2)=3i=1n12.1Definitionandterminologies4.SubgraphGraphG=(V,E)

6、,G’=(V’,E’),ifV’V,E’E,andtheverticesincidentontheedgesinE’areinV’,thenG’isthesubgraphofG.Forexample:134211331412.1DefinitionandterminologiesAnotherexample:V2V4V3V1V2V3V1V112.1Definitionandterminologies5.path.AsequenceofverticesP=i1,i2,……ikisani1toikpathinthegraphofdigrap

7、hG=(V,E)ifftheedge(ij,ij+1)isinEforeveryj,1<=j

8、7.Connectedgraph&connectedcomponentInaundirectedgraph,ifthereisapathfromvertexv1tov2,then

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。