Presentation is loading. Please wait.

Presentation is loading. Please wait.

MTH118 Sanchita Mal-Sarkar. Routing Problems The fundamental questions: Is there any proper route for the particular problem? If there are many possible.

Similar presentations


Presentation on theme: "MTH118 Sanchita Mal-Sarkar. Routing Problems The fundamental questions: Is there any proper route for the particular problem? If there are many possible."— Presentation transcript:

1 MTH118 Sanchita Mal-Sarkar

2 Routing Problems The fundamental questions: Is there any proper route for the particular problem? If there are many possible routes, which one is the best (cost, distance, or time)?

3 Routing Problems Examples: Mail delivery Garbage collection Newspaper delivery Internet access

4 Graphs Graph is a picture consisting of –Dots (called vertices) –Lines (called edges) Edges do not have to be straight lines Edges have to connect two vertices When an edge connects a vertex back with itself, then it is called a loop.

5 Examples of graphs A B CD A B C D Graph 1 Graph 2

6 Graph represents a relationship Ron John Bob Ruben Edge represents “brother of ”

7 Adjacent vertices/edges Two vertices are adjacent if there is an edge joining them. Two edges are adjacent if they share a common vertex. Vertices A and C are adjacent vertices AD and AC are adjacent edges

8 Degree of a vertex deg(A) = 2, deg(B) = 1, deg(C) = 5, deg(D) = 5, deg(E) = 3

9 Paths Vertex can appear on the path more than one. Edge cannot appear on the path more than once A sequence of vertices so that each vertex in the sequence is adjacent to the next one E, D, C, A. => A path from vertex E to vertex A E, D, C, D, A => Not a path because the edge DC appears twice

10 Circuits A path that starts and ends at the same vertex. A, C, D, A => A circuit of length 3

11 Connected graph A graph is connected if it is possible to travel from any vertex to any other vertex along consecutive edges of the graph Disconnected => If it is not connected Graph1, Graph4 => Connected Graph 2, Graph 3 => Disconnected

12 Bridge Absence of the bridge (edge) will disconnect the graph BD is a bridge

13 Euler Paths A path that travels through every edge of a graph. Edges can be traveled once since it is a path Travel every edge 1) without lifting your pencil 2) without retracing any edge R A L D No Euler paths R A L D Several Euler paths L,A, R, D, A, R, D, L, A

14 Euler circuits A circuit that travels through every edge of a graph Same requirement as for an Euler path, as well as Additional requirement: starting and ending vertex be the same. A B C D E F Graph has Euler circuit

15 Euler Theorem 1 If a graph has many odd vertices, then it cannot have an Euler circuit If a graph is connected and every vertex is an even vertex, then it has at least one Euler circuit (and usually more A B CD E Graph has no Euler circuit

16 Euler’s Theorem 2 If a graph has more than two odd vertices, then it cannot have an Euler path. If a graph is connected and has exactly two odd vertices, then it has at least one Euler path (and usually more). Any such path must start at one of the odd vertices and end at the other one.

17 Euler Theorem 2 No Euler circuit But, Euler path No Euler circuit No Euler path Euler circuit Euler path

18 Euler’s Theorem 2 Euler circuit Euler path No Euler circuit No Euler path No Euler circuit No Euler path No Euler circuit But, Euler path

19 Euler’s Theorem 3 The sum of the degrees of all the vertices of a graph equals twice the number of edges A graph always has an even number of odd vertices A graph has seven vertices–two vertices of degree 6, four vertices of degree 5, and one vertex of degree 2. The number of edges in the graph is 17. 2n = sum of the degree of all the vertices of a graph, n = no. of edges in the graph


Download ppt "MTH118 Sanchita Mal-Sarkar. Routing Problems The fundamental questions: Is there any proper route for the particular problem? If there are many possible."

Similar presentations


Ads by Google