![Page 1: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/1.jpg)
1
Graph Coloring with Ants
ThanhVu H. NguyenDepartment of Computer Science
Penn State Harrisburg(Advisor: Dr. Thang N. Bui)
![Page 2: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/2.jpg)
2
Outline
PreliminariesProblem DefinitionReal Life ApplicationsOur AlgorithmResults
![Page 3: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/3.jpg)
3
A Graph With 6 Vertices and 8 Edges
A Vertex
An Edge
Preliminaries
![Page 4: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/4.jpg)
4
Preliminaries
Adjacent vertices
![Page 5: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/5.jpg)
5
A
Preliminaries
Adjacent vertices
![Page 6: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/6.jpg)
6
A
B
C
B and C are adjacent to A
Preliminaries
Adjacent vertices
![Page 7: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/7.jpg)
7
The Graph Coloring Problem
Objective: Assign colors to vertices so that adjacent vertices do not have the same color and use as few colors as possible
![Page 8: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/8.jpg)
8
The Graph Coloring Problem
Objective: Assign colors to vertices so that adjacent vertices do not have the same color and use as few colors as possible
A Valid Coloring
![Page 9: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/9.jpg)
9
The Graph Coloring Problem
Conflict
Objective: Assign colors to vertices so that adjacent vertices do not have the same color and use as few colors as possible
An Invalid Coloring
![Page 10: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/10.jpg)
10
Objective: Minimize the number of colors used
Total Colors Used: 5 Total Colors Used: 3
The Graph Coloring Problem
![Page 11: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/11.jpg)
11
Coloring Graphs Naïvely
Question: Can an n-vertex graph be colored with k colors? (This question is equivalent to the graph coloring problem.)
Naïve algorithm: try all possible ways of assigning k colors to the n vertices If a valid coloring is found then answer yes. Otherwise,
answer no Time: there are kn possible colorings to check Example: Can a 30-vertex graph be colored with 3 colors?
330 possible colorings 106 colorings per second 6 MILLION YEARS !!!
![Page 12: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/12.jpg)
12
Complexity of Graph Coloring
Complexity: NP-Hard
(That is, it is believed that any algorithm for finding the optimal solution requires exponential time.)
Heuristics: Find good solutions in a reasonable amount of time
![Page 13: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/13.jpg)
13
An Application of Graph ColoringClass Scheduling
Math
Bio
Chem
Art
Music
Econ
Cannot be offered at the same time
• Math – Bio• Math – Chem• Bio – Music• Bio – Econ• Music – Chem• Music – Econ• Chem – Art• Art – Econ
![Page 14: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/14.jpg)
14
Math
Bio
Chem
Art
Music
Econ
An Application of Graph ColoringClass Scheduling
Cannot be offered at the same time
• Math – Bio• Math – Chem• Bio – Music• Bio – Econ• Music – Chem• Music – Econ• Chem – Art• Art – Econ
![Page 15: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/15.jpg)
15
Math
Bio
Chem
Art
Music
Econ
An Application of Graph ColoringClass Scheduling
Cannot be offered at the same time
• Math – Bio• Math – Chem• Bio – Music• Bio – Econ• Music – Chem• Music – Econ• Chem – Art• Art – Econ
![Page 16: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/16.jpg)
16
Math
Bio
Chem
Art
Music
Econ
Cannot be offered at the same time
• Math – Bio• Math – Chem• Bio – Music• Bio – Econ• Music – Chem• Music – Econ• Chem – Art• Art – Econ
An Application of Graph ColoringClass Scheduling
![Page 17: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/17.jpg)
17
Math
Bio
Chem
Art
Music
Econ
Goal : minimize the number of periods (colors) used
An Application of Graph ColoringClass Scheduling
![Page 18: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/18.jpg)
18
Math
Bio
Chem
Art
Music
Econ
Schedule
• Period 1 • Period 2
• Period 3
An Application of Graph ColoringClass Scheduling
![Page 19: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/19.jpg)
19Radio Network
Football gamesCPU Registers
Classroom/Final Schedules
Other Applications of Graph Coloring
![Page 20: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/20.jpg)
20
More constraints• Colors used are actually
numbers
• Colors assigned to adjacent vertices must differ by a certain amount
• Each vertex is assigned a set of colors not just one
Cell Phone Network• Assigning channels to cell
phones
Generalizations of Graph Coloring
![Page 21: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/21.jpg)
21
Mimic natural evolution Evolutionary Computations
Evolutionary Algorithms Genetic algorithm Evolutionary programming
Swarm Intelligence Ant systems
Ants Social insects Cooperative behaviors Great success on many problems
From Natural to Artificial Ants
![Page 22: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/22.jpg)
22
Return the best valid coloring found
Ants are placed on the graph Ants move around the graph and collaborate to recolor the vertices so that fewer colors are used
while stopping criteria not met
end-while
Use a simple and quick method to find a valid coloring (which may not be of good quality)
Ant Based Optimization for Graph Coloring
ABOGC Algorithm Highlights
![Page 23: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/23.jpg)
23
Implementation C++ Machine: Pentium 4, 3.0 GHz, 2GB ram, Linux
Tested with over 100 standard instances (graphs)
Perform very well against other algorithms Mostly BETTER than other algorithms in both
quality and efficiency (speed)
Experimental Result
![Page 24: 1 Graph Coloring with Ants ThanhVu H. Nguyen Department of Computer Science Penn State Harrisburg (Advisor: Dr. Thang N. Bui)](https://reader033.vdocuments.us/reader033/viewer/2022050714/56649e7e5503460f94b824fd/html5/thumbnails/24.jpg)
24
Conclusion
Graph coloring and its generalizations Difficult Many real world applications
ABOGC: ant based optimization for graph coloring Ant-based approach Ants cooperate to find solution
Competitive results Future Directions
Parallelism