1 / 61

Graph Colouring & Tress in Graph Theory

Learn about graph colouring, chromatic numbers, and trees in graph theory. Discover applications in compiler optimization, aircraft scheduling, GSM mobile phone networks, and more.

jackeline
Download Presentation

Graph Colouring & Tress in Graph Theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graph Colouring & Tress in Graph Theory

  2. Chromatic numbers • Graph colouring Problem • Colouring vertices of a graph such that no adjacent vertices have same colour.(Proper colouring). • If n colours are required.. We say that graph is n-colourable. • Minimum number of colours required such that no adjacent vertices have same colour is called Chromatic number of a graph. • If k is minimum number of colours then the graph is k-chromatic.

  3. The chromatic number of a isolated vertex is one. • The chromatic number of path graph Pnis 2 for n>=2. • The chromatic number of a cycle graph Cnis 2 when n is even and 3 when n is odd. • Chromatic number of a complete bipartite graph Km,nis 2. • Every Bipartite graph is 2-colourable. • Chromatic number of a complete graph Knis n.

  4. Welsh-powell Algorithm for graph colouring.

  5. Find the Chromatic number for Petersen graph

  6. Grpahcoloring references • https://youtu.be/VuqeI6TMqNk • https://youtu.be/G35_wHqyHzM • https://youtu.be/3JLEsIGOD68 • https://youtu.be/Woz2XewiF_4 • https://youtu.be/TvuVnnJQF-A • https://youtu.be/CHfljIZYrBg

  7. Graph colouring Applications • Register Allocation: • A compiler is a computer program that translates one computer language into another. To improve the execution time of the resulting code, one of the techniques of compiler optimization is register allocation, where the most frequently used values of the compiled program are kept in the fast processor registers. Ideally, values are assigned to registers so that they can all reside in the registers when they are used. • The approach to this problem is to model it as a graph coloringproblem. The compiler constructs an interference graph, where vertices are variables and an edge connects two vertices if they are needed at the same time. If the graph can be colored with kcolors then any set of variables needed at the same time can be stored in at most k registers.

  8. The problem of coloring a graph arises in many practical areas such as pattern matching, sports scheduling, designing seating plans, exam timetabling, the scheduling of taxis, and solving Sudokupuzzles. • https://www.youtube.com/watch?v=y4RAYQjKb5Y

  9. Aircraft Scheduling: Assuming that there are k Aircrafts and they have to be assigned n flights. • The ithflight should be during the time interval (ai,bi). If two flights overlap, then the same aircraft cannot be assigned to both the flights. • Thevertices of the graph correspond to the flights. Two vertices will be connected .If the corresponding time intervals overlap. • Therefore, the graph is an interval graph that can be colored optimally in polynomial time.

  10. GSM Mobile Phone Networks: GSM (Groups special Mobile) is a mobile phone Network where the geographical area of this network is divided in to hexagonal regions or cells. • Each cell has a communication tower which connects with mobilephoneswithin the cells. All mobile phones connect to the GSM network by searching for cells in the neighbors. • Since GSM operate only in four different frequency ranges, it is clear by the concept of graph theory that only four colors can be usedtocolor the cellular regions. • These four diffrentcolors are used for proper coloring of the regions. Therefore, the vertex coloringalgorithm may be used to assign at most four different frequencies for any GSM mobile phone net work.

  11. Four color theorem • In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane intocontiguousregions, producing a figure called a map, no more than four colors are required to color the regions of the map so that no two adjacent regions have the same color.

  12. Trees • A graph G is called a Tree if it is connected and has no cycles.(Connected Acyclic) • That means, a tree has to be a simple graph, because loops and parallel edges forms cycles.

  13. Examples Each of the above trees contains at least two pendant vertices, called leafs.

  14. Below graphs are not trees Each component of the second graph is a tree. Such a graph is called Forest.

  15. Properties of Trees • In a tree there is one and only one path between every pair if vertices. • Proof: Let T be a tree. Then T is a Connected Simple Graph. Since T is connected, there must be at least one path between every two vertices. If there are two path between every pair of vertices of T, then union of the paths will become a cycle, and T cannot be a tree.Thus, between every pair of vertices in a tree there must exist one and only one path.

  16. Properties of Trees • If in graph G there is one and only one path between every pair of vertices, then G is a tree. • A tree with n vertices has n-1 edges. • Any connected graph with n vertices and n-1 edges is a Tree. • A graph with n vertices and n-1 edges need not be a tree. • A graph with n vertices is a tree, iff it is connected and has n-1 edges.

  17. Properties of Trees Cayley's formula :In mathematics, Cayley's formula is a result in graph theory named after Arthur Cayley. It states that for every positive integer n, the number of trees on nlabeled vertices is  nn-2.

  18. Number of tree with 2,3,4 labelled vertices

  19. Minimally connected Graphs • A Connected graph is said to be minimally connected if the removal of any one edge from it, disconnects the graph. • Following graphs are minimally connected. A Connected Graph is a tree if and only if it is minimally connected.

  20. Properties of Trees • Complete graph Kn is not a tree when n>2 • Complete bipartite graph Kr,s is not a tree when r>=2.

  21. Properties of Trees Let F be a forest with k components(trees). If n is the number of vertices and m is the number of edges in F, prove that n=m+k. Proof: Let H1,H2,H3…..HK be the components of F. Since each component is a tree, if ni is the number of vertices in Hi and mi is the number of edges in Hi then we have mi= ni-1 for i=1,2,3,…..k That is m1+m2+m3+……mk= (n1-1)+(n2-1)+….(nk-k) = n1+n2+……+nk-k m1+m2+m3+….mk=m and n1+n2+……+nk-k=n Therefore m=n-k or n=m+k.

  22. Properties of Trees • In a tree with two or more vertices, there are at least two leaves(pendant vertices). • If a tree has exactly two pendant vertices, the degree of every other vertex is two. • In a tree, if the degree of every non-pendant vertex is 3, the number of vertices in the tree is even.

  23. Suppose that a Tree has two vertices of degree 2, four vertices of degree 3 and three vertices of degree 4. find the number of pendant vertices in T. • Let F1=(V1,E1) be a forest of seven trees where |E1|=40. what is |V1|? • Let F2=(V2,E2) is a forest with |V2|=62 and |E2|=51. How many tress determine F2?

  24. Rooted Trees • A Directed tree is a directed graph whose underlying graph is a tree. • A directed Tree T is called a Rooted Tree if it contains a unique vertex called the Root, whose in-degree is equal to zero and in-degree of all other vertices of T are equal to 1.

  25. Examples Both are directed trees. But (a) is not rooted tree and (b) is a rooted Tree. In a Rooted tree , From the root we draw the tree downward from upper level to lower level ,so that arrows can be dropped.

  26. A vertex v of a rooted tree is said to be at the k-th level or has level number k if the path form root to v is of length k.

  27. V1 and v2 at Level 1 V3 and v4 at Level 2 V5 ,v6 and v7 at Level 3 V8 and v9 at Level 4 Except Leaf nodes all other vertices are called Internal vertices.

  28. Binary tree • A rooted Tree T is called Binary Tree if every internal vertex of T is of out-degree 1 or 2.that is every internal vertex has at most two children. • A rooted tree T is called Complete Binary tree if every internal vertex of T is of our-degree 2.that every internal vertex has two children.

  29. Below tree is a binary tree, but not complete Binary tree.

  30. Below tree is Complete Binary Tree

  31. Balanced Tree • If T is rooted tree and h is the largest level number achieved by a leaf of T, then T is said to have height h. • A rooted tree of height h is said to be balanced if the level number of every leaf is h or h-1.

  32. The tree shown below is of height 4 and balanced too.

  33. Below tree is of height 4 but not balanced

  34. Full Binary Tree • Let T be a complete Binary Tree of height h. then T is called a full binary tree if all the leaves in T are at level h. • Below tree is not a full binary tree.

  35. Below tree is a full binary tree.

  36. m-ary Tree • A rooted tree is called an m-ary tree if every internal vertex of T is of out-degree<=m. that is if every vertex if T has at most m children. • A rooted tree is called a complete m-ary tree if every internal vertex of T has exactly m children.

  37. First Theorem of the Diagraph theory • In every Digraph D, the sum of out-degrees of all vertices is equal to the sum of in-degrees of all vertices, each sum being equal to the number of edges in D.

  38. Procedure to solve • Total number of vertices= leaf+internal • Find sum of out-degrees(Every leaf has out degree 0) • Find sum of indegrees(indegree of root is zero and in degree of remaining vertices is 1) • Use First Theorem of the Diagraph theory

  39. Problems • Find the number of vertices and the number of leaves in a complete binary tree having 10 internal vertices. • The Computer lab of school has 10 computers that are to be connected to a wall socket that has 2 outlets. Connections are made by using extension cords that have 2 outlets each. Find the least number of cords needed to get these computers set up for use.

  40. Consider the complete binary tree having the wall socket as the root, computers as the leaves, and the internal vertices, other than the root as extension cords.

  41. A complete binary tree has 20 leaves. Find the number of vertices? (39) • Find the number of vertices in a complete binary tree if it has 29 vertices.(15)

  42. Spanning Trees • Let G be a connected graph • A subgraph T of G is called a Spanning tree of G if • T is a tree • T contains all vertices of G • In other words, a spanning tree is a spanning subgraph that is also tree. • Also called Maximal tree since it contains all the vertices of G. • The edges of spanning tree are called branches.

  43. If T is spanning tree of a graph G,then the edges of G that are not in T are called Chords of G w.r.t. T. • The set of all chords of G is the Compleimient of T in G. • This set is called Chord-set or cotree.

  44. Spanning tree is defined only for connected graph. • In a disconnected graph of n vertices we cannot find a spanning tree with n vertices. • But each component of disconnected graph can have spanning tree. These spanning trees together form a spanning forest. • Every tree is a spanning tree to itself.

  45. A connected graph can have more than one spanning tree. The following are the spanning trees of K3.

More Related