 discussions on graph theory now the question is what is a graph a graph is a is an ordered pair of sets the first set is called the set of vertices and the second set is called the set of edges however the set of vertices and set of edges are not independent every edge corresponds to two vertices which are called the end points or the end vertices of these two this of that edge. Let me write down the definition formally a graph consists of a set of objects V and the objects denoted by V1 V2 and so on called vertices another set denoted by usually consisting of edges consisting of objects which we denote by E1 E2 and so on consisting of objects called edges. Now what is the connection between an edge and vertices edge EK is identified two vertices VI and VJ we will be writing this fact by now here we have to be careful and and mention that this pair is unordered that means we do not consider the order as important here so it is called unordered pair later on we may introduce ordered pair and then instead of just edges we will have directed edges and instead of just graphs we will have directed graphs or digraphs but we are not considering those type of graphs right now we are considering just graphs or undirected graphs and therefore an edge is associated to a pair of vertices in fact if we will let us see that it does not mean that the vertices has to be distinct so what happens if the two vertices are same we will discuss that also so it will associate to two vertices which need not be distinct. So let us look at an example of a graph so we have got vertices which we write as points on a plane let us name these points call them V1, V2, V3, V4 and V5 now we start writing the edges the edge E1 is in a way interesting because the vertices corresponding to E1 are not distinct E1 corresponds to the pair V1, V1 it is called a self loop so the end points of the edge E1 are not distinct E1 will be referred to as a self loop at V2 now where is E2, E2 is an edge like this then E3 is this E4 is this now we come to another phenomena E5 now we see that we have drawn two edges in between V1 and V3 it is also possible because when I am talking about the set of edges and edge EK is associated to two end vertices or end points let us say VI, VJ and there may be another some other edge associated to the same unordered pair of vertices these two edges will be called parallel edges. So we write this as the edges E4 and E5 each are associated to the end points V1, V3 thus there are two edges connecting the end points or vertices V1, V3 thus there are edges connecting the vertices V1, V3 namely E4, E5 these edges are called parallel edges now let us look at let us draw some more edges E6 and then E7 thus we have got here an example of a graph the type of objects that we are going to consider in this lecture and in some subsequent lectures now we can take this the whole thing together and denote this graph by an ordered pair of sets let us call it G V E where V consists of the vertices V1 up to V5 and E consists of the edges E1 up to E7 this is our graph now we will consider the same graph and discuss some more terminologies which are related to graphs according to our definition this is a graph we can restrict our definition a little more and talk about simple graphs a graph G V E is said to be a simple graph if it has neither self loops nor parallel edges sometimes we will prove certain results related to simple graphs but for the time being we consider the graphs which may have parallel edges or self loops now we talk about two important concepts related to vertices and edges namely incidence and adjacency and degree incidence degree and adjacency when a vertex Vi is end vertex some edge Ej Vi Ej said to be incident each other or incident each other now let us look at the graph that we have here and see some examples of vertices and edges incident with each other if we consider V1 the vertex V1 and the edge E3 they are incident with each other or we can say that E3 is incident to V1 or incident on V1 or we can say that V1 is incident to or incident on E3 similarly we can say that V1 is incident with E5 we can say that V1 E4 are incident with each other and so on now it is not difficult to see that if we are given a graph and we can pick up then in that case we can pick up each vertex and check how many edges are incident on it now that number is called the degree of that vertex the number of edges incident on a vertex Vi with self loops counted twice is called the degree of Vi and denoted by d Vi so we have talked about incidents we have talked about degree now the question is what do we mean by adjacent vertex vertices or adjacent edges two vertices are said to be adjacent if they are end vertices of a common edge now again if we look at the graph above we will see that V1 V2 are in our adjacent to each other because E3 is common to them V1 V2 are adjacent vertices but if we consider V1 and V4 they do not have a common edge therefore they are not adjacent V1 V4 are not adjacent vertices next we talk about adjacency of edges two edges are said to be adjacent they are incident on a common vertex so if we again look at our diagram we will see that the vertex each the edge E3 and E5 are in are adjacent because they have a common end point or end vertex V1 E3 and E5 are adjacent edges whereas E5 and E1 are not adjacent at this point we have to remember another thing that when we talk about degree of a vertex we have to consider the self loops are contributing degree 2 to each vertex the idea essentially is this that suppose we are at V2 over here and we have got a self loop E1 so it is coming out of V2 in two places or coming in two places that means the edge E1 is incident on V2 twice and therefore because both the ends are incident on V2 therefore when we are counting the degree of V2 even will contribute to and as we see from the diagram E3 and E2 will contribute one each so the degree of V2 is going to be 4 and not 3 next now we would like to see what happens if we sum all the degrees of all the vertices of a graph let us consider a graph with E edges and N vertices let us denote the vertices by V1 V2 and so on up to VN now if we sum the degrees of all the vertices we get a sum like this DVI I equal to 1 to N that degree of a vertex is the number of edges incident on it therefore each edge for each edge we will get degree 1 contribution of 1 to the degree of the vertex and for self loops we will get 2 and the edge that is incident on a vertex let us see like this suppose I have a vertex V and the edge E is incident on it now this edge will have another end point let us call that V dash and so this edge will contribute another degree to V dash in case this edge is a self loop then this will come back to V itself and therefore it will contribute degree to contribute to the degree of V because of this we can say that each edge is going to contribute to to this sum and therefore this sum is equal to twice the number of edges we can check this by examples let us look at one small graph like this so let us call it V1 V2 V3 and V4 now degree of V1 is equal to 2 degree of V2 is equal to 3 degree of V3 is equal to 2 and degree of V4 is equal to 1 now if I add all of them degree of V1 plus degree of V2 plus degree of V3 plus degree of V4 is equal to 2 plus 3 plus 2 plus 1 which gives me 8 and now if I count the number of edges this is 1 2 3 and 4 so the number of edges equal to 4 so the sum of degrees i equal to 1 to 4 d Vi is equal to 2 times the number of edges that is 2 times 4 equal to 8 this rather simple observation has another interesting consequence and that is the first theorem on graph theory that we are going to prove so we have this theorem this theorem states that the number of vertices of odd degree in a graph is always even now the question is why and that is what we will do when we check the proof now suppose that I have a set of edges and number of edges is n suppose G equal to V comma E is a graph where V equal to V1 up to Vn and the number of elements in E is small e now we already know that if I sum up all the degrees of the vertices sigma i equal to 1 to n d Vi is going to be 2 times of E now what we observe that in capital V that is a set of vertices there are two types of vertices the vertices which has got odd degree and the vertices which has got even degree now let us write over here let V odd is equal to the set of vertices odd degree and V even is the set of vertices with even degree now if we have this then the sum that we are considering can be split up into two partial sums one sum d Vi where this is over V odd and the other sum is again d V where this is over V even we can write all Vi belonging to V odd and all VJ belonging to V even and this is equal to 2 times E now at this point we realize that at this point we realize that this term is an even number the reason is that each of d VJ by definition is even because these degrees are even and if we sum up even numbers no matter how many of them we are going to get an even number and therefore we will have sigma Vi belongs to V odd d of Vi equal to twice E minus sigma V even d of VJ VJ belongs to be even this is equal to an even number now since it is an even number then the sum d Vi where Vi varies over V odd is going to be even even number but we know that individual d Vi's are odd now if I add some odd numbers odd number many times then I am going to get an odd number so the sum the number of terms in the sum here has to be even and that means that the cardinality of V odd is going to be an even positive I should write an even integer non-negative integer because of course it can be 0 completes the proof of the theorem so what we have proved that no matter whichever graph I take and if I compute the degrees of the vertices then we will see that number of vertices with odd degree will always be even with this we come to the end of today's lecture thank you.