SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Maulana Azad NationalMaulana Azad National InstituteInstitute ofof
TechnologyTechnology
Department of Computer Science & EngineeringDepartment of Computer Science & Engineering
PresentationPresentation
OnOn
Graph ColoringGraph Coloring
Presented By:Presented By:
Priyank JainPriyank Jain
Shweta SaxenaShweta Saxena
What is Graph Coloring?What is Graph Coloring?
 Graph Coloring is an assignment of colorsGraph Coloring is an assignment of colors
(or any distinct marks) to the vertices of a(or any distinct marks) to the vertices of a
graph. Strictly speaking, a coloring is agraph. Strictly speaking, a coloring is a
proper coloring if no two adjacent verticesproper coloring if no two adjacent vertices
have the same color.have the same color.
Origin of the problemOrigin of the problem
Origin of the problemOrigin of the problem
Why Graph Coloring?Why Graph Coloring?
 Many problems can be formulated as aMany problems can be formulated as a
graph coloring problem including Timegraph coloring problem including Time
Tabling,Tabling, Channel AssignmentChannel Assignment etc.etc.
 A lot of research has been done in thisA lot of research has been done in this
area.area.
Channel AssignmentChannel Assignment
 Find a channel assignment to R radioFind a channel assignment to R radio
stations such that no station has a conflictstations such that no station has a conflict
(there is a conflict if they are in vicinity)(there is a conflict if they are in vicinity)
 Vertices – radio stations, edges – conflict,Vertices – radio stations, edges – conflict,
colors – available channelscolors – available channels
TerminologyTerminology
 K-ColoringK-Coloring
 A k-coloring of a graph G is a mapping ofA k-coloring of a graph G is a mapping of
V(G) onto the integers 1..k such that adjacentV(G) onto the integers 1..k such that adjacent
vertices map into different integers.vertices map into different integers.
 A k-coloring partitions V(G) into k disjointA k-coloring partitions V(G) into k disjoint
subsets such that vertices from differentsubsets such that vertices from different
subsets have different colors.subsets have different colors.
TerminologyTerminology
 K-colorableK-colorable
 A graph G is k-colorable if it has a k-coloring.A graph G is k-colorable if it has a k-coloring.
 Chromatic NumberChromatic Number
 The smallest integer k for which G is k-The smallest integer k for which G is k-
colorable is called the chromatic number of G.colorable is called the chromatic number of G.
TerminologyTerminology
 K-chromatic graphK-chromatic graph
 A graph whose chromatic number is k isA graph whose chromatic number is k is
called a k-chromatic graph.called a k-chromatic graph.
 ColoringColoring
 A coloring of a graph G assigns colors to theA coloring of a graph G assigns colors to the
vertices of G so that adjacent vertices arevertices of G so that adjacent vertices are
given different colorsgiven different colors
Types of Graph ColoringTypes of Graph Coloring
 Vertex ColoringVertex Coloring
 Edge ColoringEdge Coloring
ExampleExample
The chromatic number is four. Therefore this a 4-Chromatic Graph
ExampleExample
 Problem: A state legislature has aProblem: A state legislature has a
number of committees that meet eachnumber of committees that meet each
week for one hour. How can we scheduleweek for one hour. How can we schedule
the committee meetings times such thatthe committee meetings times such that
the least amount of time is used but suchthe least amount of time is used but such
that two committees with overlappingthat two committees with overlapping
membership do not meet at the samemembership do not meet at the same
time.time.
Example (cont)Example (cont)
The chromatic number of this graph is four. Thus four hours suffice to schedule
committee meetings without conflict.
An edge represents a conflict between to meetings
An vertex represents a meeting
Graph Colouring AlgorithmGraph Colouring Algorithm
 There is no efficient algorithm available forThere is no efficient algorithm available for
coloring a graph with minimum number ofcoloring a graph with minimum number of
colors.colors.
 Graph coloring problem is a known NPGraph coloring problem is a known NP
Complete problem.Complete problem.
NP Complete ProblemNP Complete Problem
 NP complete problems are problemsNP complete problems are problems
whose status is unknown.whose status is unknown.
 No polynomial time algorithm has yetNo polynomial time algorithm has yet
been discovered for any NP completebeen discovered for any NP complete
problemproblem
 It is not established that no polynomial-It is not established that no polynomial-
time algorithm exist for any of them.time algorithm exist for any of them.
NP Complete ProblemNP Complete Problem
 The interesting part is, if any one of theThe interesting part is, if any one of the
NP complete problems can be solved inNP complete problems can be solved in
polynomial time, then all of them can bepolynomial time, then all of them can be
solved.solved.
 Although Graph coloring problem is NPAlthough Graph coloring problem is NP
Complete problem there are someComplete problem there are some
approximate algorithms to solve the graphapproximate algorithms to solve the graph
coloring problem.coloring problem.
Basic Greedy AlgorithmBasic Greedy Algorithm
1.1. Color first vertex with first color.Color first vertex with first color.
2. Do following for remaining V-1 vertices.2. Do following for remaining V-1 vertices.
a)a) Consider the currently picked vertexConsider the currently picked vertex
and color it with the lowest numberedand color it with the lowest numbered
color that has not been used on anycolor that has not been used on any
previously colored vertices adjacent to it.previously colored vertices adjacent to it.
If all previously used colors appear onIf all previously used colors appear on
vertices adjacent to v, assign a new colorvertices adjacent to v, assign a new color
to it.to it.
Analysis of Greedy AlgorithmAnalysis of Greedy Algorithm
The above algorithm doesn’t always useThe above algorithm doesn’t always use
minimum number of colors. Also, theminimum number of colors. Also, the
number of colors used sometime dependnumber of colors used sometime depend
on the order in which vertices areon the order in which vertices are
processedprocessed
Example:Example:
 For example, consider the following twoFor example, consider the following two
graphs. Note that in graph on right side,graphs. Note that in graph on right side,
vertices 3 and 4 are swapped. If wevertices 3 and 4 are swapped. If we
consider the vertices 0, 1, 2, 3, 4 in leftconsider the vertices 0, 1, 2, 3, 4 in left
graph, we can color the graph using 3graph, we can color the graph using 3
colors. But if we consider the vertices 0, 1,colors. But if we consider the vertices 0, 1,
2, 3, 4 in right graph, we need 4 colors2, 3, 4 in right graph, we need 4 colors
Analysis of Basic AlgorithmAnalysis of Basic Algorithm
WelshWelsh PowellPowell AlgorithmAlgorithm
 Find the degree of each vertexFind the degree of each vertex
 ListList the vericesthe verices in order of descendingin order of descending
valence i.e.valence i.e. degree(v(i))>=degree(v(i+1))degree(v(i))>=degree(v(i+1))
 ColourColour the first vertex in the listthe first vertex in the list
 Go down the sorted list and color everyGo down the sorted list and color every
vertex not connected to the coloredvertex not connected to the colored
vertices above the same color then crossvertices above the same color then cross
out all colored vertices in the list.out all colored vertices in the list.
Welsh Powell AlgorithmWelsh Powell Algorithm
 Repeat the process on the uncoloredRepeat the process on the uncolored
vertices with a new color-always workingvertices with a new color-always working
in descending order of degree until allin descending order of degree until all
vertices are colored.vertices are colored.
 ComplexityComplexity of above algorithm =of above algorithm = O(nO(n22
))
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Welsh Powell Algorithm:Welsh Powell Algorithm:
ExampleExample
Any QueriesAny Queries
Thank YouThank You

Weitere ähnliche Inhalte

Was ist angesagt?

Graph Coloring and Its Implementation
Graph Coloring and Its ImplementationGraph Coloring and Its Implementation
Graph Coloring and Its ImplementationIJARIIT
 
GRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONSGRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONSManojit Chakraborty
 
Introduction to Graph and Graph Coloring
Introduction to Graph and Graph Coloring Introduction to Graph and Graph Coloring
Introduction to Graph and Graph Coloring Darwish Ahmad
 
CS6702 Unit III coloring ppt
CS6702   Unit III coloring pptCS6702   Unit III coloring ppt
CS6702 Unit III coloring pptAbilaasha Ganesan
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithmsDr Geetha Mohan
 
04 brute force
04 brute force04 brute force
04 brute forceHira Gul
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph TheoryYosuke Mizutani
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplicationMegha V
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithmsSaga Valsalan
 
Chromatic Number of a Graph (Graph Colouring)
Chromatic Number of a Graph (Graph Colouring)Chromatic Number of a Graph (Graph Colouring)
Chromatic Number of a Graph (Graph Colouring)Adwait Hegde
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesFahim Ferdous
 

Was ist angesagt? (20)

Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Coloring graphs
Coloring graphsColoring graphs
Coloring graphs
 
graph.ppt
graph.pptgraph.ppt
graph.ppt
 
Graph Coloring and Its Implementation
Graph Coloring and Its ImplementationGraph Coloring and Its Implementation
Graph Coloring and Its Implementation
 
GRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONSGRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONS
 
Introduction to Graph and Graph Coloring
Introduction to Graph and Graph Coloring Introduction to Graph and Graph Coloring
Introduction to Graph and Graph Coloring
 
CS6702 Unit III coloring ppt
CS6702   Unit III coloring pptCS6702   Unit III coloring ppt
CS6702 Unit III coloring ppt
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
04 brute force
04 brute force04 brute force
04 brute force
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Backtracking
BacktrackingBacktracking
Backtracking
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Chromatic Number of a Graph (Graph Colouring)
Chromatic Number of a Graph (Graph Colouring)Chromatic Number of a Graph (Graph Colouring)
Chromatic Number of a Graph (Graph Colouring)
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 

Ähnlich wie Graph Coloring : Greedy Algorithm & Welsh Powell Algorithm

Extended online graph edge coloring
Extended online graph edge coloringExtended online graph edge coloring
Extended online graph edge coloringijcsa
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxHome
 
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple GraphsGreedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphsinventionjournals
 
An FPT Algorithm for Maximum Edge Coloring
An FPT Algorithm for Maximum Edge ColoringAn FPT Algorithm for Maximum Edge Coloring
An FPT Algorithm for Maximum Edge ColoringNeeldhara Misra
 
On sum edge coloring of regular, bipartite and split graphs
On sum edge coloring of regular,  bipartite and split graphsOn sum edge coloring of regular,  bipartite and split graphs
On sum edge coloring of regular, bipartite and split graphs政謙 陳
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Deepak John
 
Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring Heman Pathak
 
SATISFIABILITY METHODS FOR COLOURING GRAPHS
SATISFIABILITY METHODS FOR COLOURING GRAPHSSATISFIABILITY METHODS FOR COLOURING GRAPHS
SATISFIABILITY METHODS FOR COLOURING GRAPHScscpconf
 
Topology-Preserving Ordering of the RGB Space with an Evolutionary Algorithm
Topology-Preserving Ordering of the RGB Space with an Evolutionary AlgorithmTopology-Preserving Ordering of the RGB Space with an Evolutionary Algorithm
Topology-Preserving Ordering of the RGB Space with an Evolutionary AlgorithmFrancisco (Paco) Florez-Revuelta
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cyclevarun arora
 
A study-of-vertex-edge-coloring-techniques-with-application
A study-of-vertex-edge-coloring-techniques-with-applicationA study-of-vertex-edge-coloring-techniques-with-application
A study-of-vertex-edge-coloring-techniques-with-applicationIjcem Journal
 
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxbcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxB.T.L.I.T
 
data structure and algorithms Unit 5
data structure and algorithms Unit 5data structure and algorithms Unit 5
data structure and algorithms Unit 5infanciaj
 
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...mathsjournal
 

Ähnlich wie Graph Coloring : Greedy Algorithm & Welsh Powell Algorithm (20)

Extended online graph edge coloring
Extended online graph edge coloringExtended online graph edge coloring
Extended online graph edge coloring
 
Graph Coloring
Graph ColoringGraph Coloring
Graph Coloring
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptx
 
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple GraphsGreedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
 
An FPT Algorithm for Maximum Edge Coloring
An FPT Algorithm for Maximum Edge ColoringAn FPT Algorithm for Maximum Edge Coloring
An FPT Algorithm for Maximum Edge Coloring
 
On sum edge coloring of regular, bipartite and split graphs
On sum edge coloring of regular,  bipartite and split graphsOn sum edge coloring of regular,  bipartite and split graphs
On sum edge coloring of regular, bipartite and split graphs
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4
 
Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring
 
SATISFIABILITY METHODS FOR COLOURING GRAPHS
SATISFIABILITY METHODS FOR COLOURING GRAPHSSATISFIABILITY METHODS FOR COLOURING GRAPHS
SATISFIABILITY METHODS FOR COLOURING GRAPHS
 
Topology-Preserving Ordering of the RGB Space with an Evolutionary Algorithm
Topology-Preserving Ordering of the RGB Space with an Evolutionary AlgorithmTopology-Preserving Ordering of the RGB Space with an Evolutionary Algorithm
Topology-Preserving Ordering of the RGB Space with an Evolutionary Algorithm
 
Coding
CodingCoding
Coding
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
 
M-coloring.pptx
M-coloring.pptxM-coloring.pptx
M-coloring.pptx
 
Wg qcolorable
Wg qcolorableWg qcolorable
Wg qcolorable
 
A study-of-vertex-edge-coloring-techniques-with-application
A study-of-vertex-edge-coloring-techniques-with-applicationA study-of-vertex-edge-coloring-techniques-with-application
A study-of-vertex-edge-coloring-techniques-with-application
 
Graph Coloring
Graph ColoringGraph Coloring
Graph Coloring
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxbcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
 
data structure and algorithms Unit 5
data structure and algorithms Unit 5data structure and algorithms Unit 5
data structure and algorithms Unit 5
 
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...
MODIFIED ALPHA-ROOTING COLOR IMAGE ENHANCEMENT METHOD ON THE TWO-SIDE 2-DQUAT...
 

Kürzlich hochgeladen

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 

Kürzlich hochgeladen (20)

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 

Graph Coloring : Greedy Algorithm & Welsh Powell Algorithm

  • 1. Maulana Azad NationalMaulana Azad National InstituteInstitute ofof TechnologyTechnology Department of Computer Science & EngineeringDepartment of Computer Science & Engineering PresentationPresentation OnOn Graph ColoringGraph Coloring Presented By:Presented By: Priyank JainPriyank Jain Shweta SaxenaShweta Saxena
  • 2. What is Graph Coloring?What is Graph Coloring?  Graph Coloring is an assignment of colorsGraph Coloring is an assignment of colors (or any distinct marks) to the vertices of a(or any distinct marks) to the vertices of a graph. Strictly speaking, a coloring is agraph. Strictly speaking, a coloring is a proper coloring if no two adjacent verticesproper coloring if no two adjacent vertices have the same color.have the same color.
  • 3. Origin of the problemOrigin of the problem
  • 4. Origin of the problemOrigin of the problem
  • 5. Why Graph Coloring?Why Graph Coloring?  Many problems can be formulated as aMany problems can be formulated as a graph coloring problem including Timegraph coloring problem including Time Tabling,Tabling, Channel AssignmentChannel Assignment etc.etc.  A lot of research has been done in thisA lot of research has been done in this area.area.
  • 6. Channel AssignmentChannel Assignment  Find a channel assignment to R radioFind a channel assignment to R radio stations such that no station has a conflictstations such that no station has a conflict (there is a conflict if they are in vicinity)(there is a conflict if they are in vicinity)  Vertices – radio stations, edges – conflict,Vertices – radio stations, edges – conflict, colors – available channelscolors – available channels
  • 7. TerminologyTerminology  K-ColoringK-Coloring  A k-coloring of a graph G is a mapping ofA k-coloring of a graph G is a mapping of V(G) onto the integers 1..k such that adjacentV(G) onto the integers 1..k such that adjacent vertices map into different integers.vertices map into different integers.  A k-coloring partitions V(G) into k disjointA k-coloring partitions V(G) into k disjoint subsets such that vertices from differentsubsets such that vertices from different subsets have different colors.subsets have different colors.
  • 8. TerminologyTerminology  K-colorableK-colorable  A graph G is k-colorable if it has a k-coloring.A graph G is k-colorable if it has a k-coloring.  Chromatic NumberChromatic Number  The smallest integer k for which G is k-The smallest integer k for which G is k- colorable is called the chromatic number of G.colorable is called the chromatic number of G.
  • 9. TerminologyTerminology  K-chromatic graphK-chromatic graph  A graph whose chromatic number is k isA graph whose chromatic number is k is called a k-chromatic graph.called a k-chromatic graph.  ColoringColoring  A coloring of a graph G assigns colors to theA coloring of a graph G assigns colors to the vertices of G so that adjacent vertices arevertices of G so that adjacent vertices are given different colorsgiven different colors
  • 10. Types of Graph ColoringTypes of Graph Coloring  Vertex ColoringVertex Coloring  Edge ColoringEdge Coloring
  • 11. ExampleExample The chromatic number is four. Therefore this a 4-Chromatic Graph
  • 12. ExampleExample  Problem: A state legislature has aProblem: A state legislature has a number of committees that meet eachnumber of committees that meet each week for one hour. How can we scheduleweek for one hour. How can we schedule the committee meetings times such thatthe committee meetings times such that the least amount of time is used but suchthe least amount of time is used but such that two committees with overlappingthat two committees with overlapping membership do not meet at the samemembership do not meet at the same time.time.
  • 13. Example (cont)Example (cont) The chromatic number of this graph is four. Thus four hours suffice to schedule committee meetings without conflict. An edge represents a conflict between to meetings An vertex represents a meeting
  • 14. Graph Colouring AlgorithmGraph Colouring Algorithm  There is no efficient algorithm available forThere is no efficient algorithm available for coloring a graph with minimum number ofcoloring a graph with minimum number of colors.colors.  Graph coloring problem is a known NPGraph coloring problem is a known NP Complete problem.Complete problem.
  • 15. NP Complete ProblemNP Complete Problem  NP complete problems are problemsNP complete problems are problems whose status is unknown.whose status is unknown.  No polynomial time algorithm has yetNo polynomial time algorithm has yet been discovered for any NP completebeen discovered for any NP complete problemproblem  It is not established that no polynomial-It is not established that no polynomial- time algorithm exist for any of them.time algorithm exist for any of them.
  • 16. NP Complete ProblemNP Complete Problem  The interesting part is, if any one of theThe interesting part is, if any one of the NP complete problems can be solved inNP complete problems can be solved in polynomial time, then all of them can bepolynomial time, then all of them can be solved.solved.  Although Graph coloring problem is NPAlthough Graph coloring problem is NP Complete problem there are someComplete problem there are some approximate algorithms to solve the graphapproximate algorithms to solve the graph coloring problem.coloring problem.
  • 17. Basic Greedy AlgorithmBasic Greedy Algorithm 1.1. Color first vertex with first color.Color first vertex with first color. 2. Do following for remaining V-1 vertices.2. Do following for remaining V-1 vertices. a)a) Consider the currently picked vertexConsider the currently picked vertex and color it with the lowest numberedand color it with the lowest numbered color that has not been used on anycolor that has not been used on any previously colored vertices adjacent to it.previously colored vertices adjacent to it. If all previously used colors appear onIf all previously used colors appear on vertices adjacent to v, assign a new colorvertices adjacent to v, assign a new color to it.to it.
  • 18. Analysis of Greedy AlgorithmAnalysis of Greedy Algorithm The above algorithm doesn’t always useThe above algorithm doesn’t always use minimum number of colors. Also, theminimum number of colors. Also, the number of colors used sometime dependnumber of colors used sometime depend on the order in which vertices areon the order in which vertices are processedprocessed
  • 19. Example:Example:  For example, consider the following twoFor example, consider the following two graphs. Note that in graph on right side,graphs. Note that in graph on right side, vertices 3 and 4 are swapped. If wevertices 3 and 4 are swapped. If we consider the vertices 0, 1, 2, 3, 4 in leftconsider the vertices 0, 1, 2, 3, 4 in left graph, we can color the graph using 3graph, we can color the graph using 3 colors. But if we consider the vertices 0, 1,colors. But if we consider the vertices 0, 1, 2, 3, 4 in right graph, we need 4 colors2, 3, 4 in right graph, we need 4 colors
  • 20. Analysis of Basic AlgorithmAnalysis of Basic Algorithm
  • 21. WelshWelsh PowellPowell AlgorithmAlgorithm  Find the degree of each vertexFind the degree of each vertex  ListList the vericesthe verices in order of descendingin order of descending valence i.e.valence i.e. degree(v(i))>=degree(v(i+1))degree(v(i))>=degree(v(i+1))  ColourColour the first vertex in the listthe first vertex in the list  Go down the sorted list and color everyGo down the sorted list and color every vertex not connected to the coloredvertex not connected to the colored vertices above the same color then crossvertices above the same color then cross out all colored vertices in the list.out all colored vertices in the list.
  • 22. Welsh Powell AlgorithmWelsh Powell Algorithm  Repeat the process on the uncoloredRepeat the process on the uncolored vertices with a new color-always workingvertices with a new color-always working in descending order of degree until allin descending order of degree until all vertices are colored.vertices are colored.  ComplexityComplexity of above algorithm =of above algorithm = O(nO(n22 ))
  • 23. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample
  • 24. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample
  • 25. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample
  • 26. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample
  • 27. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample
  • 28. Welsh Powell Algorithm:Welsh Powell Algorithm: ExampleExample

Hinweis der Redaktion

  1. Note: Each color defines an independent set of vertices ( vertices with no edges between them. ). Note: In order to verify that the chromatic number of a graph is a number k, we must also show that the graph can not be properly colored with k-1 colors. In other words the goal is to show that the (k-1)-coloring we might construct for the graph must force two adjacent vertices to have the same color.
  2. Look at previous example. Simply state that the since we found the chromatic number to be N the graph is N-chromatic.
  3. For k-colorable: look at example and say that since it has a 6-coloring therefore it is 6-colorable. For chromatic number: Look at previous example. See if students can find a better coloring of G and state its chromatic number. This is a k-chromatic graph!