Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Theory Relations, graphs

Similar presentations


Presentation on theme: "Graph Theory Relations, graphs"— Presentation transcript:

1 Graph Theory Relations, graphs
Degree sequence, isomorphism, Eulerian graphs Trees Computer networks, circuit design, data structures

2 A little bit of History: Graph Theory
Königsberg (Kalinigrad) was a city in Russia situated on the Pregel River, which served as the residence of the dukes of Prussia in the 16th century. In the eighteenth century, seven bridges connected the four regions. Königsberg people used to take long walks through town on Sundays.

3 They wondered whether it was possible to start at one location in the town, travel across all the bridges without crossing any bridge twice and return to the starting point. This problem was first solved by the prolific Swiss mathematician Leonhard Euler, who, as a consequence of his solution invented the branch of mathematics now known as graph theory.

4 Basic concepts of graph theory
A graph(undirected graph) is a collection of points called vertices, joined by lines called edges: Kuala Lumpur Ipoh Alor setar Johor Bahru P.Pinang We represent the graph as G=(V,E) ·        In a graph G, if there exists a path consisting of n edges between two vertices Pi and Pj, then we say that there exists an n-walks from Pi to Pj. For instance, there are three different 2-walks between the points P2 and P7 on the above graph G1.

5 A digraph (directed graph)
consists of a set of V of vertices (or nodes) and a set of E of edges (or arcs) such that each edge is associated with an ordered pair of vertices. If there is a unique edge e associated with the ordered pair (v,w) of vertices, we write e=(v,w) which denotes an edge from v to w. The arcs are the ordered pairs of vertices. The directed edges are indicated by arrows.

6 the number of edges having that vertex as an end point.
Degree of vertex the number of edges having that vertex as an end point. Path in a graph a sequence of vertices, each adjacent to the next, and a choice of an edge between each of them, so that no edge is chosen more than once. Cycle/Circuit in a graph a path which begins and ends with the same vertex. Simple circuit/path if the vertices are all distinct ·        In a graph G, if there exists a path consisting of n edges between two vertices Pi and Pj, then we say that there exists an n-walks from Pi to Pj. For instance, there are three different 2-walks between the points P2 and P7 on the above graph G1.

7 Euler Path and Circuits
a path in a graph G is called an Euler path if it includes every edge exactly once. An Euler circuit is an Euler path that is a circuit. E 2 4 D 3 C B 1 5 A ·        In a graph G, if there exists a path consisting of n edges between two vertices Pi and Pj, then we say that there exists an n-walks from Pi to Pj. For instance, there are three different 2-walks between the points P2 and P7 on the above graph G1.

8 Euler circuit and Euler path
An Euler circuit in a graph G is a simple circuit containing every edge of G, and has same first and last vertices. A connected graph has an Euler circuit if each of its vertices has even degree.

9 Euler path An Euler Path in G is a simple path containing every edge of G, and has different first and last vertices. A connected graph has an Euler path but not an Euler circuit if it has exactly two vertices of odd degree.

10 Example: Is it an Euler path and/or Euler circuit? b a
* the path a,b,c,d is an Euler circuit. * All the edges are included * Each edge is included exactly once * each of its vertices has even degree (degree of two). d c

11 Example: Is it an Euler path and/or Euler circuit?
has neither an Euler path nor circuit

12 Example: is it an Euler path and/or Euler circuit?
b f a there is a n Euler path a,b,c,d,e,f, but not an Euler circuit. it has exactly two vertices of odd degree.

13 Shortest Path and Distance
Shortest path – path that has minimum length Shortest path Algorithm.--the algorithm was discovered by Edsger Dijkstra in 1959. Many problems can be modeled using graphs with weights assigned to their edges. We set up the basic graph model by representing cities by vertices and flights by edges. Problem involving distances can be modeled by assigning distance (example in km) to the edges. Problems involving flight time can be modeled by assigning flight times to edges. Problems involving fares can be modeled by assigning fares to the edges.

14 Example What is the length of shortest path between a and z in the weighted graph ? b c 3 4 2 z The shortest path from a to z, namely a,d,e,z., with length of 6. a 3 1 2 3 d e 3 d b The shortest path from a to z, namely a,c,b,d,e,z., with length of 13. 4 6 1 z 8 4 a 3 2 c 10 e


Download ppt "Graph Theory Relations, graphs"

Similar presentations


Ads by Google