1 / 30

Graph Theory

Great Theoretical Ideas In Computer Science. Graph Theory. Lecture 22. CS 15-251. Can I draw the above figure in one continuous trace with no line being drawn twice?. How about this one?. Picture only what is essential to the problem.

Download Presentation

Graph Theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Great Theoretical Ideas In Computer Science Graph Theory Lecture 22 CS 15-251

  2. Can I draw the above figure in one continuous trace with no line being drawn twice?

  3. How about this one?

  4. Picture only what is essential to the problem. The residents of Königsberg, Germany, wondered if it was possible to take a walking tour of the town that crossed each of the seven bridges over the Presel river exactly once. Leonard Euler1736 (father of graph theory)

  5. Is it possible to start at some node and take a walk that uses each edge exactly once, and ends at the starting node?

  6. 1 3 2 4 Redrawn: 2 4 1 3 Original: You can redraw the original picture as long as for every edge between nodes i and j in the original you put an edge between nodes i and j in the redrawn version (and you put no other edges in the redrawn version).

  7. Euler: Has no tour that uses each edge exactly once. (Even if we allow the walk to start and finish in different places.) Can you see why? Let’s prove a general theorem that answers this question for any given graph.

  8. A walk in a graph is called an Euler tour if it starts and ends in the same place and uses each edge exactly once. A walk in a graph is called an Euler trail if it uses each edge exactly once. If a graph has an Euler tour, it is said to be an Eulerian graph.

  9. The problem in our language: Show that is not Eulerian. In fact, it contains no Euler trail.

  10. This node has degree 5. Note: Each loop counts as two edges emanating from a node. connected graph Definitions: A graph is connected if it is possible to walk from any vertex to any other vertex. Two nodes (vertices) are adjacent if there is at least one edge between them. The degree of a vertex is the number of edges emanating from it.

  11. Theorem (Euler): 1. G is Eulerian, no degree-0 nodes  G is connected and has no vertices of odd degree 2. G is has an Euler trail from node a to some other node b, no degree-0 nodes  G is connected and a b are the only two nodes of odd degree

  12. 1. 2. Proof: Assume G has an Euler trail C from node a to node b (a and b not necessarily distinct). G is certainly connected, since the Euler trail reaches every edge (and hence every node) of G. For every node besides a and b, C uses an edge to exit for each edge it uses to enter. Thus, the degree of the node is even. 1.If a=b, then a also has even degree. 2.If ab, then a and b both have odd degree.

  13. a b 1. 2. Assume G is connected. If there are no odd-degree nodes, pick any a = b. If there are two odd-degree nodes, call these nodes a and b. Start at a. Take a walk w1 until you get stuck. You must be at b. If no vertex along w1 has an unused edge, we are done. Otherwise, call this vertex v. Walk from v until you get stuck. You must be back at v. v Incorporate this walk from v into w1.

  14. Example: A directed graph is a graph where each edge is directed from one of its endpoints to the other. The theorem remains true for any connected, directed graph where # of edges leaving a node = # of edges coming in

  15. A graph has a Hamiltonian tour if there is a tour that visits every vertex exactly once (and returns to its starting point). A graph with a Hamiltonian tour is called a Hamiltoniangraph.

  16. Yes. A graph of the vertices of a dodecahedron. Is it Hamiltonian?

  17. This one has a Hamiltonian path, but not a Hamiltonian tour. This one has a trail.

  18. Given a graph, what is a nice way to determine if it is Hamiltonian?

  19. No one knows. Deciding if a graph is Hamiltonian is NPcomplete. There is probably no nice characterization of Hamiltonian graphs the way there was with Euler graphs.

  20. Ancient Sanskrit Nonsense YAMÁTÁRÁJABHÁNASALAGÁM This will not be on the final.

  21. YA MÁ TÁ RÁ JA BHÁ NA SA LA GÁM 0 1 1 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 It’s a memory aid from the Indian theory of rhythms.

  22. Rotating memory drum address decoder Modern application: memory wheel

  23. Is there a memory wheel with 16 bits in which all 4-bit patterns occur? Is there a memory wheel with 2n bits in which all n-bit patterns occur?

  24. 000 0 1 0 001 100 0 1 010 1 1 0 101 110 011 111 There is an arrow from node a to node b if the last two bits in a equal the first two bits in b. There is a 1-1 correspondence between Hamiltonian tours of this graph and memory wheels with 8 bits.

  25. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1011 1001 1010 1101 1100 1110 1111 Hamiltonian graph?

  26. Perhaps a different graph can represent the same problem. Hint: It’s better to be looking for Eulerian tours than Hamiltonian tours.

  27. abc bc ab bcd cd Idea: Instead of having the nodes be the 3-bit patterns, and putting an edge between patterns with a 2-bit overlap,…… Have the nodes be the 2-bit overlap and the edges the 3-bit pattern.

  28. 000 00 001 100 010 10 01 101 011 110 11 111 Every Euler tour corresponds to a memory wheel.

  29. 0000 000 0001 1000 1001 001 100 0010 0100 010 1 0 1 1 0011 1 0101 1100 1010 1 1 101 0 0 1011 1101 0 0 0110 0 1 011 110 0 0 1 111 0111 1110 1111

  30. Theorem: For every n, there exists a memory wheel of size 2n that has all n-bit patterns. Proof: There are 2 edges in and 2 edges out of every vertex. Graph is connected – can find path from any a to any b.Thus the graph is Eulerian. Every Euler tour corresponds to a memory wheel.

More Related