lecture 11: 9.4 connectivity paths in undirected & directed graphs graph isomorphisms counting...

Post on 06-Jan-2018

240 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Paths in Graphs

TRANSCRIPT

Lecture 11:

9.4 ConnectivityPaths in Undirected & Directed GraphsGraph IsomorphismsCounting 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

Connected Components of a Graph

Connectedness in Directed Graphs

Test for Isomorphism

Counting Paths Between Vertices

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.

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

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

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

http://en.wikipedia.org/wiki/Graph_coloring

A B C D EA - * * *B * - * * *C * * - * D * * * - *E * * -

A

B

E

D

CA

B

E

D

C

Hamilton Circuit

Graph Depth-First Traversal (DFT) Algorithm Implementationpseudo-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 vi has not been traversed, and vi is adjacent to vk.

Gray Code

0110

00110 00 11 11 0

00001111

top related