Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic properties Continuation

Similar presentations


Presentation on theme: "Basic properties Continuation"— Presentation transcript:

1 Basic properties Continuation
Graphs Basic properties Continuation

2 Multigraphs If computers are connected via internet instead of directly, there may be several routes to choose from for each connection. Depending on traffic, one route could be better than another. Makes sense to allow multiple edges:

3 Multigraphs e1 e2 Edge-labels distinguish between edges sharing same endpoints. e1  {1,2}, e2  {1,2}, e3  {1,3}, e4  {2,3}, e5  {2,3}, e6  {1,2} 1 2 e3 e4 e5 e6 3 4

4 Multigraphs A multigraph G = (V, E, f ) consists of a non-empty set V of vertices, a set E (possibly empty) of edges and a function f with domain E and codomain the set of pairs in V. L23

5 Pseudographs If self-loops in a multigraph are allowed, we get a pseudograph: Now edges may be associated with a single vertex, when the edge is a loop e1  {1,2}, e2  {1,2}, e3  {1,3}, e4  {2,3}, e5  {2}, e6  {2}, e7  {4} e6 e1 e2 1 2 e5 e3 e4 e7 3 4

6 Pseudographs A pseudograph G = (V, E, f ) consists of a non-empty set V of vertices, a set E (possibly empty) of edges and a function f whose domain is E and whose codomain the set of pairs and singletons in V. Sometimes a pseudograph and a multigraph are not differed from each other and in this case a term “multigraph” is used. A singleton is a set of cardinality 1.

7 Degree of a Vertex The number of edges incident with a vertex is called the degree of this vertex: deg(A) is the degree of A. A loop on a vertex A is counted twice in deg(A) deg(1)=3; deg(2)=7; deg(3)=2; deg(4)=2 e6 e1 e2 1 2 e5 e3 e4 e7 3 4

8 Degree of a Vertex Theorem. In a multi (pseudo) graph, the sum of degrees of the vertices equals twice the number of edges. deg(1)=3; deg(2)=7; deg(3)=2; deg(4)=2 There are 7 edges and e6 e1 e2 1 2 e5 e3 e4 e7 3 4

9 Multigraphs: Adjacency Matrix
For an undirected multi (pseudo) graph G = (V,E ,f) define the matrix AG by: Rows, Columns –one for each element of V Value at i th row and j th column is the number of edges incident with vertices i and j.

10 Multigraphs: Adjacency Matrix
Q: What’s the adjacency matrix? 1 2 3 4 L23

11 Multigraphs: Adjacency Matrix
1 2 A: Important property: AG is symmetric. 3 4 L23

12 Paths A path in a multi(pseudo) graph is a continuous way of getting from one vertex to another by using a sequence of edges. Could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 Or simpler: 1-e12-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4

13 Paths The length of a path is n (the number of edges listed). 1-e12-e11-e33-e42-e62-e52-e43 =>7 Or simpler: 1-e12-e43 =>2 4 is the path to itself with the length 0. However, there is another path 4-e74 =>1 e6 e1 e2 1 2 e5 e3 e4 e7 3 4

14 Paths In a path the vertices need not be distinct, and some of the edges can be the same. When there is no chance of confusion, a path can be represented by the vertices V1, V2, …, Vn+1 only or by the edges e1, e2, …, en only.

15 Paths – Another Definition
A path of length n in a multi (pseudo) graph is a sequence of n edges e1, e2, … ,en such that each consecutive pair ei , ei+1 share a common vertex. In a simple graph, one may instead define a path of length n as a sequence of n+1 vertices v0, v1, v2, … ,vn such that each consecutive pair vi , vi+1 are adjacent. Paths of length 0 are also allowed according to this definition.

16 Simple Paths and Circuits
A simple path contains no duplicate edges (though duplicate vertices are allowed). A circuit (or cycle ) is a path which starts and ends at the same vertex and where all the vertices (excepting the first/last one) and all the edges are distinct. Note: Simple paths need not be in simple graphs. E.g., may contain loops and therefore they may be found in multi (pseudo) graphs.

17 Simple Paths and Circuits
Find a longest possible simple path in the following graph: e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

18 Simple Paths and Circuits
Solution: The path e1,e5,e6,e2,e3,e4 from 1 to 2 is a maximal simple path because simple: each of its edges appears exactly once maximal: because it contains every edge except the unreachable edge e7 e1 e6 1 e2 2 e5 e3 e4 e7 3 4

19 Connectivity Let G be a multi (pseudo) graph. Let U and V be vertices. U and V are connected to each other if there is a path in G which starts at U and ends at V. Graph G is said to be connected if all vertices are connected to each other. Remark : Any vertex is automatically connected to itself via the empty path. L24

20 Connectivity Which of the following graphs are connected?
The first is disconnected (there is no path to (from) 4 from (to) other vertices), the second is connected 1 2 1 2 3 4 3

21 Homework Read pp Problems (Exercises 4.2) 1-9


Download ppt "Basic properties Continuation"

Similar presentations


Ads by Google