1 / 20

Graph Theory to the Rescue

Graph Theory to the Rescue. Dr. Carrie Wright University of Arizona Teacher’s Circle November 17, 2011. Using graph theory to solve games and problems. BRIDGES OF KONIGSBERG.

benson
Download Presentation

Graph Theory to the Rescue

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. Graph Theory to the Rescue Dr. Carrie Wright University of Arizona Teacher’s Circle November 17, 2011 Using graph theory to solve games and problems

  2. BRIDGES OF KONIGSBERG • In Konigsberg, East Prussia, a river runs through the city such that in its center is an island, and after passing the island, the river broke into two parts. Seven bridges were built so that the people of the city could get from one part to another. • The people wondered whether or not one could walk around the city in a way that would involve crossing each bridge exactly once.

  3. Bridges of Konigsberg Problem • Can the Konigsberg Bridge Problem be solved? • Suppose they had decided to build one fewer bridge in Konigsberg. Can I solve the problem now? • Does it matter which bridge you take away? • What if you add bridges? • What about walking through the city crossing every bridge ending at a different place? (Somebody is picking you up)

  4. GRAPHS • A graph is an ordered pair G=(V,E), comprising of a finite, nonempty set, V, (called the vertices) together with a multiset E of unordered pairs (called edges) • EXAMPLE: • V={a,b,c,d} E={(a,c),(a,c),(a,b),(c,b),(b,d),(b,d),(a,a),(d,d)}

  5. Graph Theory definitions • Let x and y be vertices in a graph G=(V,E). An x-y walk in G is a (loop-free) finite alternating sequence of vertices and edges from G starting at vertex x and ending at vertex y. • If no edge in the x-y walk is repeated, then the walk is called an x-y trail. A closed x-x trail is called a circuit. • The degree of a vertex, v, is the number of edges that are incident to v; or, the number of edges meeting at a vertex, v.

  6. Represent the Bridges of Konigsberg problem into a graph (the vertices represent the parts of land and the edges represent the bridges) • A graph G is said to have an Euler circuit if there is a circuit in G that traverses every edge of the graph exactly once. If there is an open trail from a to b in G that traverses each edge in G exactly once, then the trail is called an Euler circuit.

  7. Graphs and Euler Circuits • Here are some more graphs. Which ones have Euler Circuits and which ones don’t? • When do graphs have Euler Circuits? • THEOREM: Let G be a graph with no isolated vertices. The graph G has an Euler circuit if and only if G is connected and the degree of every vertex is even. • Theorem: Let G be a graph with no isolated vertices. G has an Euler trail if and only if G has exactly two vertices of odd degree.

  8. Bridges of Konigsberg Problem • Can the Konigsberg Bridge Problem be solved? • Suppose they had decided to build one fewer bridge in Konigsberg. Can I solve the problem now? • Does it matter which bridge you take away? • What if you add bridges? • What about walking through the city crossing every bridge ending at a different place? (Somebody is picking you up)

  9. More Problems • Jeannie, who lives in Eugene, was flying to visit several of her aunts and uncles over Christmas. She flew on an airline that has hubs in Chicago and Denver. She had to get to Minneapolis to visit her aunt Minnie and to St. Louis to see her Uncle Louis and to Little Rock to see her uncle Rocco. Can Jeannie fly on each flight leg exactly once and end up back in Eugene?

  10. More Problems • Mike had had a very successful Cub Scout popcorn sale. Now the popcorn had arrived and it was time to deliver it to all the neighbors. He had managed to sell popcorn to just about every household in his neighborhood and now had to haul his load of popcorn along 22 blocks to deliver it. He's looking for the most efficient route through his neighborhood--he wants to walk each block exactly once until all his popcorn is delivered. Can you find a route for him? Here's a map of his neighborhood:

  11. INSTANT INSANITY (1967) • A puzzle with 4 cubes. Each cubes face is one of 4 colors: red, blue, green, white • Stack the cubes in a column. So that each side of the column has all four colors showing.

  12. R 1 2 G Y R B Y Y B Y R Y B G B 3 4 R G R G B G R B Y Y One Instant Insanity Game

  13. How many different arrangements are there? • Cube 1 at the bottom – 3 different arrangements for this cube (only concerned with the four faces on the side) • 6 ways to place it on top now – then rotate it 4 times with a different outcome possible – so 24 total ways • Similarly 24 for the 3rd and 4th arguments • Total Number: 3(24)(24)(24) = 41,472 possibilities

  14. Instant Insanity and Graph Theory • We are only concerned with the sides – and the opposite colors. We can start by focusing on the front and back of the cubes, then move to the sides • We want to represent the cube in terms of a graph: • 4 colors will represent the vertices • Edge will represent if 2 colors are on opposite faces of the cube • Do this for all 4 cubes – you can either put them all on one graph or separate it into 4 separate graphs (each graph representing a cube) • Label the edges by denoting which cube they come from

  15. R 1 2 G Y R B Y Y B Y R Y B G B 3 4 R G R G B G R B Y Y One Instant Insanity Game

  16. Solving Instant Insanity • With the 4 cubes stacked in a column, examine two opposite sides of the column. • This gives us 4 edges in the graph with each label appearing once. • Each color appears once on each side. So each color must appear twice as an endpoint. • Do the same thing with the other sides. • Note: These aren’t always possible. • You’re looking for 2 disjoint subgraphs: • Each subgraph contains all 4 vertices and four edges (one for each cube) • Each subgraph, each vertex is incident with exactly two edges • No (labeled) edge of the labeled graph appears twice in both subgraphs

  17. Cubes as Graphs

  18. A Solution Here is a possible solution to this puzzle. There is another solution, too.

  19. Solution • Here is a solution to this particular Instant Insanity game. There is another solution to this same game.

  20. Other Instant Insanity Games • There are 3 more games on the tables. Can you solve them? Note: not all of them have solutions. These are labelled as b-b, meaning blue is opposite of blue.

More Related