Graph Coloring
Era      Definition
       Given    a      Graph G         the GRAPH COLORING
Problem   is to color the vertices of the graph
such   that    adjacent vertices have different                colors
 The minimum           number of         colors   need       to color
 a     graph    G      is     called   chromatic number
     dentoed XCG
                                             X G         3
                            Graph G
 Def            A        k coloring of             a       graph G is          a
     labeling        f VIGI                 1121       K
            A        k coloring is             Proper        it adjacent vertices
have different labels for colors
            A       graph is               k   colorable      if   it has          a
proper      k   coloring              The chromatic number                G        is
the least                k       such that       G is          k   colorable
       A     subset              of     vertices assigned to the Same Color
is called            a           color class
Rema                In       a        Proper coloring       each color class
is     an       independent set                 so         G is     k colorable
 if        and only if                   V16       is the union of
 k independent sets
     All     the graphs                considered in       this chapter   are simple
Example                           1
  Cs     Cycle              312                        5     3
                                      11
 Co Cycle
                    I
                            T2                    X 6        2
  In      general       X         even        2        and
                        X        Codd         3
       Complete Graph       kn             X kn         n
  Path Pn               X   Pn    2
       For any graph G                LEXIE       EN
   Applications
      Scheduling
suppose   we      want to Schedue                 classes for
 Cs     courses   for the        Courcees     A b C d e f       g
  god
            No     two courses with           a    common student are
           scheduled        at     same time
             we have to           use       minimum       of time slots
 we     convert this to a coloring Problem
 Courses represent Vertices             9 Two vertices       are    adjacent
  if the       corresponding      courses have        a common      student
  Exagple
  We      need     3 Slots to schedule the classes
Blue Slot 1            d g      a      red slots       b   c
Green    Slot 2        Leif
Remy          Labels   like Red Blue       etc   are   only used
when the number of colors is                small      and normally
the labels colors             are   drawn from the integers41,2
Other    Appitions
        Frequency assignment
         Sudoku
 Solving Sudoku Puzzles       9 9
          Puzzle                       solution
God   Fill in the blank cells so that               each   row
 Column   and 3 3 box has the numbers 1 to 9
 exactly once
 We construct      a   graph G from        a   given Puzzle
 G contains     one vertex    Per each cell
 Two vertices of       G    are    adjacent       it the corresponding
cells can't be     filled   with    same       number
      The        Problem of   solving a Sudoku puzzle can be
represented as                                   on the    graph G
                        Afgynentsion
Irecoloring      extension is the Problem    of extending            a
graphcoloring of          a   subset of the vertices of              a   graph
 with        a    given set of colors to        a Proper coloring
of the whole graph
 As      some        cells of Sudoku      are    filled         If       a
cell Ci           is filled with integer ni          the        we   assign
Ui      corresponding    vertex of si       the color Ni
our      goal is to extend Partial              Coloring   of        G
 to      a       proper coloring of the   whole graph using
colors           1121    9
      Coloring             of BipartiteGrads
Lemme                 A graph G                is        bipartite     iff it is 2       colorable
RI      F             G        AUB E               is    bipartite
         define            f    Vca           4112            as
                                               I         if UEA
                               flu
                                               2         if VEB
     clearly      f   is       a     2 Coloring         of G
 E           if        G is           a       2 colorable graph
       Let        f        UCG         721,2                 be    a     2   coloring   of G
         let           A             V Fae               I
                       13            617107              2
     Cheely       A and                   B        are        independent sets
     hence            G        AUB E               is        bipartite
theorem               A        graph          with       maximum            degree d
is        9   1      colorable
Prof                  Proof             by     induction          on        of vertices
   P      K            If          a         k vertex graph has                      max deg   d
          then            it       is        dtl       colorable
Basecase                   k       1               only          one    verten        1 colorable
                                                       max
                                                             degree        0
Inductive step                     assume          PCK           is true       for   IÉin
     we       need    to show that                     PK    1         is true
  Let          G be            a        graph      with K               vertices and
      has            max       degree              d
                                                                               0
                                                                 incident to
                           64 all edges
  remove an arbitrary veeten from G they
Gku has at most k veetics       max deg d
        GK is        d colorable
 Now      add    the       vertex    v to      G
 observe that        U      has d neighbors           and available
 colors   are    d   l      so      we   can   pick   a     color    for v
 that is        different from the colors of all these
 adjacent vertices               neighbors
    i      we        get    a
                                  coloring   of G         with     at most
    d      colors
 Élan.ee ygiiyagritumsw'graena
using DCG            1
                              many          colors
           where         DCG denote the                         maximum deg ofG
 Algorithm
       A graph G and an ordering vertices                                h or      Un
Ilp
Otp    A       k vertex coloring of G for some                            k
                                                                 where    KE ACG
           Color     vertex re         with        1
           Suppose       61,62         Ui     are          colored       using t
      colors    say       I      t          let        T be          the set      of
color used to color              the        vertices            adjacent        with    bit
                                 ta           if       T    Li       t
         colluity
                                                                     otherwise
                                 Min    1,2        t       IT
        STOP         when        Un     is         colored
Example
                Us
                           Note the   Chromatic number
                        of G    varies according to the
                                               vertices
                         ordering of the input
    For the ordering   V V2 V3 Vy V5 V6 the
    greedy algorithm uses Two    colors
    For the ordering U v6 Us by U2V5      the
    greedy algorithm uses Four colors
     Recap
cue              A     subgraph      Q of        a    graph   G is called
 a       clique if           any     two    vertices in Q        are      adjacent
The clique number                    of G is the integer
     W    G          Max          VQ           Q is    a   cliane
          If    H is         a     subgraph    of G    then      G           H
                      G          W   G
               For    which        graphs      X G         W G       or
      G         W    G       1             XCG         f   WCG   for some f
Mycielski            1955         showed    that       for any KEIN
there exists             a       graph     G    with       WG    2          G    L
     Desk's term
          For any given integer k                                7,1     there exists
 a                                    graph Gk              with Chromatic        number      k
        inglfree
            has No kg as              a     Subgraph
Proof           We construct                 Gk by induction on k
      For       k 1           and 2             G           KI         Ga Kz
      suppose        we       have constructed               a   triangle free     graph
                                                                         sad
     Gk         on    n vertices               u tea             In            11 14      on
             Construct                Get         from       Gk         as   follows
  1         Add               Ntl      new      vertices         a uz        Un        2 to   Gk
 2          Join      Ui             If i Sn        to      all those        vertices
             which                                               in GK
                                                                                  say
      to                        Ui     is    adjacent                          U Lui an
 3          Join          2     to        every        Ui
                              vs
us
             us
o
We    need   to   show    Gets is triangle free
and     XCGKA        KH
Claire                  Gkn          is    triangle free
         proof          by contradiction
   suppose              Gkn         has      a     triangle T
  Since          original graph Gk is                   triangle free at
                               of
least        one      veeter T            must     be    is   2    or    Ui for
some         E
        if       ZET           then       other    two vertices must be
  from           U         but this is contradiction          as    no   two
 vertices          in      0    are       adjacent
       if 24T 9 Ui ET                       their other two vertices
 of          T       are
                               Up 80g for          some P.EE En
         But            then         vi Up Vq forms           a    triangle
  in     GK          which          is     again     a   contradiction
       Therefore Gkt                 is triangle free
Claire           X Gkn                  KH
            Since         Gk       is Subgraph           of Gatt
            we        have          X Gai                    XCGic           k
  if        f V Gic                Li        k          is     a     k    coloring      of Gk
 then       g    V Gkn                   Ll            Kika        defined as
                                                       Isis n
                     gcoiffloi
                     91mi          f Ui                Isi en
                     g    z             KH
 clearly         g   is        a     KH           coloring         of Gkn
  We also        have to show that                      X Gkt            K
 Suppose         XCGkH              k             h V Giap                   Lii       k
 is     a    k   Coloring          of Gkn
  WLOG           ht       hc2        k            ie     hai             k for         ietn
 define          g V Gic                  Li            K I
                                                 hoi          if     hai           K
                          glad
                                                                     hail          k
                                              h Ui            if
 It   is   easy to     see that
                                  g   is   K   D coloring
of Gis     This   is   a   contradiction to X Gk      k
           X Gkn           Ktl