130 likes | 352 Views
Lecture 11:. 9.4 Connectivity Paths in Undirected & Directed Graphs Graph Isomorphisms Counting Paths between Vertices 9.5 Euler and Hamilton Paths Euler Paths & Circuits Hamilton Paths & Circuits Gray Code. Introduction of Connectedness.
E N D
Lecture 11: • 9.4 Connectivity • Paths in Undirected & Directed Graphs • Graph Isomorphisms • Counting Paths between Vertices • 9.5 Euler and Hamilton Paths • Euler Paths & Circuits • Hamilton Paths & Circuits • Gray Code
Introduction of Connectedness http://farm4.static.flickr.com/3120/3409325514_68840abcb8.jpg
Paths in Graphs http://www.ctl.ua.edu/math103/euler/ifagraph.htm
The Seven Bridges of Konigsberg Graph theory began with the analysis of a puzzle involving the bridges in the town of Konigsberg, Prussia (currently Kaliningrad, Russia) by the mathematician Leonhard Euler The problem was to find a walk through the city that would cross each bridge once and only once. The islands could not be reached by any route other than the bridges, and every bridge must have been crossed completely every time (one could not walk half way onto the bridge and then turn around and later cross the other half from the other side). Euler showed that there is no solution. The traversal of any graph in which every edge is used exactly once is called an Euler Circuit. Euler observed that a necessary condition for the existence of Eulerian circuits is that all vertices in the graph have an even degree. A graph where every vertex has an even degree is called Eulerian graph. http://en.wikipedia.org/wiki/Eulerian_path
B B A A C C E E D D Graph Coloring Algorithm In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints. In its simplest form, it is a way of coloring the vertices of a graph such that no two adjacent vertices share the same color; this is called a vertex coloring. Determining if a graph can be colored with 2 colors is equivalent to determining whether or not the graph is bipartite, and thus computable in linear time using breadth-first search. Course Scheduling (Timetable) Problem as Graph Coloring - vertex = course edge = conflict color = time of course A B C D E A - * * * B * - * * * C * * - * D * * * - * E * * - http://en.wikipedia.org/wiki/Graph_coloring
Graph Depth-First Traversal (DFT) Algorithm Implementation pseudo-code DFT( node vk ) { // deal with current node for each node, vi { if (node_avail(vi)) then DFT(vi) } } node_avail( vi ) is a boolean function that returns true if node vi is available for traversal, which means that vihas not been traversed, and viis adjacent to vk.
Gray Code 0 0 1 1 0 1 0 0 0 0 1 1 1 1 1 0 00 01 11 10