 We will be discussing graph of a relation now first let us see what is a graph if we have a pair of sets G V e where V e are two sets we call it is directed graph or in short a digraph if this set E is a subset of V x V the elements of V are called vertices and the elements of E are called edges and edge x y is said to be from x to y and is represented in a diagram with an arrow with a tail with tail at x and of course the head at y now let us look at examples of such graphs. So first we will be writing the vertices as points on a plane so let us say I draw a point call it a another point let us say I write B another point I write C and let us say D is another point now we can in fact draw any directed edges from any vertex to another so starting from a let us suppose we write a B so it is a directed line from a to B this is what we will call a directed edge and this is exactly what we will denote by the ordered pair a B now let us draw one more AC and we can also write an edge from C to A then possibly B to D and C to D to C and also C to D and B to C so what we have done here is that we have drawn some arbitrary directed edges from the vertices we can write them as ordered pairs as the first one as I have already written a to B and then a to C then let us see nothing more on a then we go to B then we have an edge from B to C then we have an edge from B to D BD then from C we can go to A and also to D and finally we have an edge from D to C now the set of vertices are the set of vertices is A B C and D and the set of edges is a B AC BD C A then CD and DC we combine these two sets to write the directed graph which is V E what we note here is that this is naturally a relation because let us recall suppose we have the set V which is as we see A B CD and suppose we we talk about relations on a sorry relations on V so a relation on V is nothing but a subset of V cross V and the set E is exactly a subset of V cross V therefore it is a relation on V thus a directed graph gives me a relation on the set of vertices on the other hand it is quite natural that if I have a relation then I can I can take the set on which the relation is defined and then take the the that relates the relation itself will give me the set of edges of the directed graph so with respect to a relation we always get a directed graph now we here there is something we have to note that sometimes instead of a relation on a set A we would like to look at more general a more general situation where we are talking about relations from A to B and that also does not make any make much difference over here because what we can do is the set of vertices can be chosen to be the union of the two sets A and B that is suppose I have a relation from A to B I may choose the set of vertices to be union of A and B and then I can consider are not as a subset of A cross B but a subset of A union B cross A union B and it is not difficult to see that a subset of A cross B can be embedded in a subset of A union B cross A union B and thus from there we can get the digraph corresponding to the graph to the relation from A to B now let us try to build graphs of some relations now let us take one graph sorry let us take one relation on set of people let us call that relation is parent of suppose we denote a set of people by A B C D E F and up to k and the relation R is parent of relation and suppose we have a listing like this so we have R which is which is a subset of ordered pairs like AE AF and so on up to IK here AE means A is parent of E AF means A is parent of F BE means B is parent of E B F means B is parent of F and so on now we would like to draw a graph of this relation first we write the set AB set S now see this is A the vertex A and the vertex B and then the vertex C and the vertex B and now let us write the listing over here here we see that R is equal to AE AF BE B F CG CH then we have DG DH F I FJ GI GJ JK and IK so let us look at these two ordered pairs so AE and AF are in the relation that means that we draw two more vertices name them as E and F and join A to E that means A is parent of A is a parent of E and then join A to F which means that A is a parent of F then we see that we have BE and BF therefore we join B and D draw a line over here B and F draw a line and an arrow so this means there is B is a parent of F and B is a parent of E now we come to the next two pairs this is CG and CH and after that we have DG and DH so we write G over here and H over here so we join CG and CH which means that C is a parent of G and C is a parent of H and then we join DG and DH and that exhausts the relations up to this now then next we have F I and FJ and GI and GJ so we draw I over here F I and we draw a point J over here we have FJ then we join GI and GJ and lastly we have JK and IK so we draw another vertex over here which is K and join I to K this is IK and this is JK thus we have a graph corresponding to the relation is parent of and where the listing of the people is given in the set S now let us look at another example here we are asked to draw the digraph of the relation divides defined by A divides B if and only if there exists a positive integer C such that A into C is equal to B and the set of integers on which this relation is defined is 1 2 3 4 5 6 7 8 so that is integer positive integers from 1 to 8 now this divides is a usual division on the set of integers so first thing that we have to do in order to solve a problem like this is to write all the ordered pairs corresponding to this relation so we shall do that shortly let us consider the set let us call it for the time being S this is 1 2 3 4 5 6 7 and 8 and we write the relation in this way A divides B if and only if A divides B we are denoting the relation by a vertical line now let us start to to list all the ordered pairs corresponding to this relation so we have got R now let us start with 1 1 divides all the integers in the set S so 1, 2 1, 3 1, 4 then 1, 5 1, 6 1, 7 and lastly 1, 8 then if we start with 2 we have 2 2 does not divide 1 but 2 divides 4 it does not divide 3 either 2 does not divide 5 but 2 divides 6 so we have got 2 6 2 does not divide 7 but 2 divides 8 so we have got 2 8 so we finish up with 2 then we start with 3 so 3 3 divides 6 and nothing else then we come to 4 4 divides 8 and 5 5 divide any other num any other number in S 6 does not divide any other number in S neither does 7 or does 8 so we have the complete listing over here now we have to be bit careful about drawing the graph because it may become very messy if we are casual about putting the vertices so first let us observe 1 is related to many elements and no element is related to 1 therefore what we do is that we draw first the point 1 over here at the very bottom and write 1 then we see that all the other elements 2 3 4 5 6 7 and 8 are related to 1 so first we write 2 like this 2 and draw an arrow then this we try to see from here whether 2 is related to something else yes here 2 is related to 4 so we write 4 over here and join by an arrow so 1 2 2 2 4 and then 6 is also there and 8 is also there but here we see that 4 is also related to 8 so what we do is that we draw a point the point 8 over here join from 4 to 8 and also join 2 to 8 so we have completed 1 going to 2 2 going to 4 4 going to 8 and 2 going to 8 and now we start off with 3 and 6 see 3 is related to 6 and 2 is also related to 6 so we have to keep space for that so we may like to draw 3 over here all right and possibly it will be a good idea to draw 6 over here and join 2 to 6 and 3 to 6 at the same time I have to join 1 to 6 because that is also there and we must remember to join 1 and 8 because it is also in the relation therefore see we have done 1 3 then 2 6 then 3 6 then 1 6 and we have also taken care of 1 8 so we have not taken care of 1 4 but we shall take care of that shortly this is 1 4 and after that we are left with 1 5 and 1 7 that we can do by drawing two other points 5 and 7 and joining 1 to 5 and 1 to 7 this is the graph corresponding to the relation a divides b on the set 1 2 3 4 5 6 7 8 now let us look at more examples on graphs of relations namely this now our set is 0 1 2 the 3 elements set 0 1 2 and a digraph we have a relation is defined on it which is the subset of relation not on the set 0 1 2 but on the set of all non-empty subsets of 0 1 2 so our problem is to draw the digraph of the relation subset of or equal to on the non-empty subsets of the set 0 1 2 let us try to do that now here let us write the set 0 1 2 the first step over here to is to list all the non-empty subsets of 0 1 2 if we call this set S then the set of all non-empty subsets will be PS- the set containing Phi the empty set now let us start listing first we will write the all the singleton subsets then we will write the the subsets of size 2 or subset of card in subsets of cardinality 2 0 1 0 2 and 1 2 and finally we write the subset 0 1 2 now let us write the elements which are contained in the relation subset equal let we are we are denoting the relation by the symbol this is after all a subset of the power set minus the set containing Phi so it is equal to ordered pairs let us see let us start with the element set 0 this element is a subset of 0 1 then 0 2 and 0 1 2 so therefore in the ordered pairs we will have 0 1 0 1, 0 set 0, set 0 1 then we will have set 0, set 0 2 then we will have set 0, set 0 1 2 next we will start with the singleton 1 and then the singleton 1 is a subset of again 0 1 next we consider the singleton 1 it is a subset of 1 2 then we will consider the singleton 1 again and of course this is a subset of 0 1 2 alright then we have got singleton 2, 2 is a subset of 0 2 then 2, 2 is a subset of 1 2 right and then 2, 2 is a subset of 0 1 2 finally we start taking the we have exhausted by starting with the singleton sets and then we take sets containing two elements so we have now 0 1 and we see that 0 1 is contained in 0 1 2 so the pair 0 1 0 1 so the pair 0 1 0 1 2 will appear over here and then we will have 0 2 that is contained in 0 1 2 and finally we have 1 2 which is contained in 0 1 2 and we close the bracket so these are the relation these are the elements of the relation subset equal on the set containing all the non-empty subsets of the set 0 1 2 and now we would like to draw the digraph corresponding to this relation here again in practice we start from an element which is related to all the elements but no other element is related to itself and that element in fact there is no single element like that over here there are three elements like that which are essentially the so see we have written 0 over here alright and 1 over here and 2 over here then we have written 0 1 over here and we have joined these lines okay the 0 2 we will write over here we will join 0 2 0 2 and here 2 to 0 2 and then we will write 1 2 over here this is the point and join 1 to 1 2 and 2 to 1 2 thus we have a nice shape in fact when we are drawing a digraph of a relation we have to take this into mind as well that we have to keep in mind that whatever diagram we are drawing it should look nice and now we have only one element left that is that is again let me remove this we have got only one element left that is 0 that is 0 1 2 and then we see that 0 1 is a subset of 0 1 2 0 2 is a subset of 0 1 2 and 0 1 2 is also a subset of 0 1 2 thus we get the digraph corresponding to the relation wait a moment it is not complete yet there are some more things that we have to do we have missed out few things for example we have missed out this one so we have to connect 0 2 0 1 2 because they are related yes we have to connect 1 2 0 1 2 and we have to connect 2 to 0 1 2 now we have got all we can check that because we have got we starting from 0 to 0 1 we have done this 0 to 0 2 we have done this then 0 to 0 1 2 we have done this then 1 1 2 0 1 we have done this 1 2 1 2 we have done this and 1 2 0 1 2 we have done this also then 2 to 0 2 we have done this 2 to 1 2 we have done this and then 2 to 0 1 2 we have also done this now 0 1 is related to 0 1 2 0 2 is related to 0 1 2 and 1 2 is related to 0 1 2 thus we have completed or we have completed the scanning the whole list and drawing the corresponding directed edges. Now let us look at another example we are asked to draw the digraph corresponding to the relation not equal to on the set 0 1 2 how will we do that here we are starting from the set let us call it as which is 0 1 2 and our relation is not equal to. So if we try to write the set corresponding to the relation that are well let us write like this so 0 is related to 1 and 1 is related to 0 then we have 0 is related to 2 and 2 is related to 0 then 1 is related to 2 and 2 is related to 1 then we have got three points on the set so we write the three points suppose like this this is 0 this is 1 this is 2 so here we see that 0 is related to 1 so we have to write an edge like this 0 to 1 I also write an edge like this 1 to 0 then 0 is related to 2 and 2 is related to 0 so I write 2 more edges and then we see that 1 is related to 2 because 1 is not equal to 2 and 2 is related to 1 since 2 is not equal to 1 thus we have got a nice shape over here of the digraph now we look at some examples of digraphs sorry now we will check some definitions related to digraphs and edge from a vertex to itself is called a loop so we will see examples of loops a digraph with no loops is called a loop free digraph or a simple digraph next next we will try to write down some relations from a graph but let us let us check now we have already seen this digraph so in the last example we have already seen this digraph 0 1 2 like this now this is loop free because there is no edge which starts from a vertex to another vertex but if we have an edge like this for example in this way so then it is it is a digraph with a loop this is a loop similarly we have a loop like this here we have to we observe that suppose we have a relation which is reflexive reflexive then each of the vertices of that relation will have a loop around it for example if we make another loop over here then the corresponding relation will become reflexive because that will mean that each element is related to itself now we may also have some problems where we are given a digraph on a set of vertices and ask to write down the corresponding relation for example here we are starting with the set of vertices a b c d e and then we are given a digraph now it is quite straightforward problem because we see that we can start with a and of course a b the pair a b is in the relation and no other pair starting from a so we write a b over here then we start from b there is no edge coming out from b therefore we have we do not list anything then we come to see we see that there are four edges coming out of C so C a C b C e and C d so we write over here and then we have got d a and then e b and e d so we have the relation corresponding to this digraph there are some more definitions related to digraph that is in degree and out degree suppose we have a vertex x in a digraph the number of edges coming out of x is called its out degree and number of edges incident on x is called its in degree so if we look at a graph that we have already studied let us see let us say this one all right so we have a graph now let us consider the vertex a so number of edges emanating from a is one so out degree of a is one and in degree is the number of edges incident on a here we see that this is 1 2 so this is 2 similarly we can make a list of out in degrees and out degrees in degree out degree and vertices a b c d and e we have seen that for e a it is 2 and 1 for b let us consider b b there is only in degree so that it is 3 and out degree is 0 then in C all are out degrees so we have got 4 and no in degree d in degree is 2 out degree is 1 and e in degree is 1 and out degree is 2 finally we come to the idea of isomorphism of digraphs suppose we have two digraphs g1 given by the pair v1 e1 and g2 given by the pair v2 e2 now we will call it call the two graphs isomorphic if there exists a one to one function f from the set of vertices of g1 namely v1 to v2 the set of vertices of g2 such that the ordered pair vw belongs to e1 if and only if the ordered pair f v and f w belongs to e2 and this function f is said to be a graph isomorphism in general it is a difficult problem to decide whether two graphs are isomorphic or not but there are some properties of graphs which are called invariance through which we can make these decisions at least towards one direction so here we introduce an idea of invariance and invariant of a graph is a function g on digraphs such that g1 equal to gg2 whenever g1 and g2 are isomorphic now the invariance can be number of vertices the number of edges or the degree spectrum which is the collection of all in degree out degree pairs of all the vertices so this means that given a graph I can always compute these things for example I for I can always compute the number of vertices or number of edges or the degree spectrum suppose there are two graphs for which these numbers do not match then we are sure that these graphs are not isomorphic but if they match we cannot be sure we cannot take any decision however it is known that if two graphs are isomorphic then then all the numbers will match therefore if the numbers do not match we can say they are not isomorphic but the if the numbers match we can we cannot say anything because there are examples of non-isomorphic graphs for which all the num all these numbers match so in this area it is an important problem to find out different invariance so that we have got good resolution among the set of graphs I will stop the lecture now we have studied how to build digraphs from relations and we have also seen given a relation we have also seen we given a graph how to convert that to a relation we have also seen some examples of graphs of relations and relations from digraphs and finally we have discussed certain properties of this digraphs this is all for today thank you