Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.

Similar presentations


Presentation on theme: "CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler."— Presentation transcript:

1 CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler

2 Bipartite Property that a graph may have Useful to find a variable’s usage in a program Bipartite = it is possible to partition the set of vertices into 2 subsets, such that within a subset no two vertices are adjacent – As a consequence, you won’t see triangles anywhere. – To determine: try to partition vertices. Adjacent vertices must go to different camps. Are these bipartite?

3 Isomorphism Meaning: same shape How can we tell if 2 graphs are essentially the same? Definition: the vertices can be put into a 1-1 correspondence. (  same adj matrix) Easier to disprove when not isomorphic. Checklist: – Same # vertices and same # edges – Same degree sequence – Connectedness (both are, or both are not) – Existence of cycles – Adjacency of conspicuous vertices – Consider the complement if e < n(n – 1) / 4

4 Examples Isomorphic since A, B, C, D correspond to W, Z, Y, X Check out adjacency of degree-2 vertices! Question: can a graph by isomorphic to its complement? BA Z X Y C W D

5 How many graphs… How many nonisomorphic graphs have 4 vertices and 3 edges? For this question, let’s expand the definition of “graph” to include – Loop(s) on a single vertex: pseudograph – Multiple edges between same pair of vertices: multigraph I think the answer is 20. Can you draw all of them? – 3 loops (3); 2 loops (5); 1 loop (4) – Parallel (3); parallel and loop (2) – Simple (3)

6 Subgraph Analogous to a subset To obtain a subgraph from an existing graph, feel free to remove edges/vertices. But you can’t remove a vertex if some edge needs it! What are the subgraphs of a triangle? It’s convenient to classify by the number of edges. – e = 0: You only have vertices. 8 subsets of 3 elements. – e = 1: Choose which vertex is not connected. For each case, you can even remove that vertex. – e = 2: Just choose which edge not to draw. – e = 3: The entire graph itself.

7 Paths and Cycles A path is simply a sequence of edges that allow us to “travel” from one vertex to another. – Formally, each edge’s first vertex must match the second vertex of the previous edge. And analogously, each edge’s second vertex must match the next edge’s first vertex. In other words, you can’t just list the edges in random order. Cycle = a path in which the first vertex is the same as the last vertex. There are 2 interesting types of cycles – Hamiltonian: passes thru every vertex once – Euler: includes every edge once

8 Hamiltonian Can refer to a path or a cycle that… – goes thru every vertex exactly once – And, in the case of a cycle, returns home. When does a graph contain one? – There needs to be a subgraph where all vertices have degree 2, such as a polygon. – The trick is to remove edges we don’t really need, and recognize edges that are essential. – Essential edges  we may be forced to visit a vertex twice. – Removing unnecessary edges  graph may become disconnected. *** Examples in book

9 Euler Can refer to a path or a cycle that… – Goes thru every edge exactly once Euler said it was impossible to cross all 7 bridges of Königsberg and return to the same point. Key: every vertex must have even degree


Download ppt "CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler."

Similar presentations


Ads by Google