- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
In a directed graph, the flow along the arcs between two vertices can follow only the indicated direction. In an undirected graph, the flow between two vertices can go in either direction. * Final point: Tree and graph A tree is a graph in which each vertex has only one predecessor A graph is not a tree Spanning tree * adds a disjoint--that is, an unconnected--vertex to the graph * Like any other delete algorithm, the first thing we have to do to delete a vertex is to find it. Once we have found it, however, we also need to make sure that it is disjoint; that is, we need to ensure that there are no arcs leaving or entering the vertex. If there are, we reject the deletion. * To add an edge, two vertices must be specified To insert an arc, we need two points in the graph, the source vertex (fromPtr) and the destination vertex (toPtr). * * The order in which the adjacent vertices are processed depends on how the graph is physically stored. Insert the arcs: Ascending key sequence Process adjacent vertices: Descending key sequence * we must ensure that each vertex is processed only once. When we created the structure for the vertex ,we included a visited flag. we add the edges in ascending key sequence. Because we are using a stack, however, the traversal will process adjacent vertices in descending (last in-first out [LIFO]) order. * Although the arrays offer some simplicity and processing efficiencies, the number of vertices must be known in advance. This is a major limitation. * If two vertices are adjacent--that is, if there is an edge between them, the matrix intersect has a value of 1; if there is no edge between them, the intersect is set to 0. * destination is a pointer to a graphVertex. Processed is used only for traversals. It indicates that the data in a vertex are waiting to be processed or have already been processed during the current traversal. * The graph data are stored in the vertex node. These data pertain only to the vertex. Later we will s
文档评论(0)