Welcome to IS 2610 University of Pittsburgh欢迎您到2610 匹兹堡大学.pptVIP

  • 4
  • 0
  • 约8.98千字
  • 约 27页
  • 2017-03-09 发布于上海
  • 举报

Welcome to IS 2610 University of Pittsburgh欢迎您到2610 匹兹堡大学.ppt

Welcome to IS 2610 University of Pittsburgh欢迎您到2610 匹兹堡大学

IS 2610: Data Structures Graph April 5, 2004 Graph Terminology Graph : vertices + edges Induced subgraph of a subset of vertices Connected graph: a path between every pair Maximal connected: there is no path from this subgraph to an outside vertex Representation Adjacency matrix V by v array Adv./disadvantages Adjacency list Linked list for each vertex Adv./disadvantages Hamilton Path Hamilton path: Given two vertices, is there a simple path connecting them that visits every vertex in the graph exactly once? Worst case for finding Hamilton tour is exponential Assume one vertex isolated; and all v-1 vertices are connected (v-1)! Edges need to be checked Euler Tour/Path Euler Path Is there a path connecting two vertices that uses each edge in the graph exactly once? Vertices may be visited multiple times Euler tour: Is there a cycle with each edges exactly once Bridges of konigsberg Properties: A graph has a Euler tour iff it is connected and all the vertices are of even degree A graph has a Euler path iff it is connected and exactly two of its vertices are of odd degrees Complexity? Graph Search Depth First Search V2 for adj matrix V+E for adj. list Graphs may not be connected DFS for graph problems Cycle detection Back edges Simple path Simple connectivity The graph search function calls the recursive DFS function only once. Two way Euler tour Each edge visited exactly twice Spanning tree Given a connected graph with V vertices, find a set of V-1 edges that connects the vertices Any DFS is a spanning tree Two coloring, bipartiteness check Separability and Connectivity Bridge An edge that, if removed, would separate a connected graph into two disjoint subgraphs. Edge-connected graph – has no bridges In a DFS tree, edge v-w is a bridge iff there are no back edges that connect a descendant of w to an ancestor of w Separability and Connectivity Articulation point (separation/cut) Removal results in at least two disjoint subgraphs K-connected - for each pai

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档