Recently different approaches are developed to solve graph coloring - column generation method [
1], genetic and Tabu search methods [
2], branch and cut [
3], evolutionary operators [
4,7,8,10,11,13,14,15,16,1719,20], particle swarm optimization [
5], backtracking [
6,9], greedy and local search [
12,18,21,22,23,24,25,26,27].

Problem Description

Graph coloring finds the least number of colors used to color the vertex set of a graph G [
1,2,3,4,5]. Here the algorithm is developed for bipartite graph coloring. In a bipartite graph, the vertex set V(G) is split into two sets such that every vertex must be available in any one of the two sets. Clearly, the vertices in the same set are not connected by an edge. The bipartite graph and its partition are shown in figures 1 and 2.

Bipartite graphs

Bipartite graphs - Set 1 = {1, 3} and Set 2 = {2, 4}

Algorithm for bipartite graph coloring

The algorithm for bipartite graph coloring is defined as follows:

Traverse all vertices in G using the breadth-first search (BFS).

Choose a vertex and assign the color, say 1.

Assign the color 2 to all of its adjacent vertices.

Apply these steps until all vertices are assigned the colors.

Implementation in C++

The C++ implementation for bipartite graph coloring is given below:

Input n – number of vertices, e – number of edges.

Input all the edges.

Store the graph in adjacency list format.

Apply BFS using queue implementation and color V(G).

// Include header files bits/stdc++.h

int n, e, i, j;

vector<vector<int> > g;

vector<int> c;

bool v[
];

void c(int nodes, int n) {

queue<int> que;

if(v[nodes]) return;

c[nodes]=n;

v[nodes]=1;

for(i=0; i<n; i++) {

if(!v[g[nodes][i]]) {

q.push(g[nodes][i]);

      }

   }

while(!q.empty()) {

c(q.front(), (n+1)%2);

q.pop();

   }

return;

}

int main() {

int a,b;

cout<<"Enter n & e";

cin>>n>>e;

g.resize(n);

color.resize(n);

memset(v,0,sizeof(v));

for(i=0;i<e;i++) {

cout<<"\nEnter edge vertices of edge "<<i+1<<" :";

cin>>a>>b;

      a--; b--;

g[a].push_back(b);

g[b].push_back(a);

   }

c(0,1);

for(i=0;i<n;i++) {

if(color[i])

cout<<i+1<<" "<<'1'<<"\n";

else

cout<<i+1<<" "<<'2'<<"\n";

}

}

Results & Test Cases

Enter n & e:4 3

Color assignments: 1 2

Enter edges:

1 2

3 2

4 2

Colors:

1 1

2 2

3 2

4 2

Conclusions & Future Work

The graph coloring algorithm is developed to solve bipartite graphs. The algorithm is executed on sample graphs and the results are obtained. In the future, different soft computing, hybrid strategies [
28,29,30,31,32,33,34,35,36,37,38,39], and recommender systems with new strategies [
40,41,42,43,44,45,46,47,48,49,50] can be applied to find minimal coloring with reduced complexity.

ReferencesAnuj Mehrotra; Michael A. Trick: A Column Generation Approach for Graph Coloring. INFORMS Journal on Computing 8, 344-354 (1995)
Marappan, R., Sethumadhavan, G. Solution to Graph Coloring Using Genetic and Tabu Search Procedures. Arab J Sci Eng 43, 525-542 (2018). https://doi.org/10.1007/s13369-017-2686-9
Isabel Méndez-Díaz; Paula Zabala: A Branch and Cut algorithm for graph coloring. Discrete Applied Mathematics 154, 826-847 (2006)
Marappan, R.; Sethumadhavan, G. Complexity Analysis and Stochastic Convergence of Some Well-known Evolutionary Operators for Solving Graph Coloring Problem. Mathematics 2020, 8, 303. https://doi.org/10.3390/math8030303
Marappan, R., Sethumadhavan, G. Solving Graph Coloring Problem Using Divide and Conquer-Based Turbulent Particle Swarm Optimization. Arab J Sci Eng (2021). https://doi.org/10.1007/s13369-021-06323-x
Remi Monasson: On the Analysis of Backtrack Procedures for the Coloring of Random Graphs. Lect.Notes Phys. 650, 235-254 (2004)
R. Marappan and G. Sethumadhavan, "A New Genetic Algorithm for Graph Coloring," 2013 Fifth International Confer-ence on Computational Intelligence, Modelling and Simulation, 2013, pp. 49-54, doi: 10.1109/CIMSim.2013.17.
G. Sethumadhavan and R. Marappan, "A genetic algorithm for graph coloring using single parent conflict gene crossover and mutation with conflict gene removal procedure," 2013 IEEE International Conference on Computational Intelligence and Computing Research, 2013, pp. 1-6, doi: 10.1109/ICCIC.2013.6724190.
Marappan, R., & Sethumadhavan, G. (2015). Solution to graph coloring problem using heuristics and recursive back-tracking. International Journal of Applied Engineering Research, 10(10), 25939-25944.
Lixia Han; Zhanli Han: A Novel Bi-objective Genetic Algorithm for the Graph Coloring Problem. 2nd International Con-ference on Computer Modeling and Simulation (2010)
Marappan, R., & Sethumadhavan, G. (2015). Solution to Graph Coloring Problem using Evolutionary Optimization through Symmetry-Breaking Approach. International Journal of Applied Engineering Research, 10(10), 26573-26580.
Tamás Szép; Zoltán Ádám Mann: Graph coloring: The more colors, the better? 11th International Symposium on Com-putational Intelligence and Informatics (CINTI) (2010)
Marappan, R., & Sethumadhavan, G. (2015). Solving graph coloring problem for large graphs. Global Journal of Pure and Applied Mathematics, 11(4), 2487-2494.
Raja Marappan, Gopalakrishnan Sethumadhavan. Solving Fixed Channel Allocation using Hybrid Evolutionary Method MATEC Web of Conferences 57 02015 (2016) DOI: 10.1051/matecconf/20165702015
R. Marappan and G. Sethumadhavan, "Divide and conquer based genetic method for solving channel allocation," 2016 International Conference on Information Communication and Embedded Systems (ICICES), 2016, pp. 1-5, doi: 10.1109/ICICES.2016.7518914
R. Marappan and G. Sethumadhavan, "Solution to graph coloring problem using divide and conquer based genetic method," 2016 International Conference on Information Communication and Embedded Systems (ICICES), 2016, pp. 1-5, doi: 10.1109/ICICES.2016.7518911.
R. Marappan and G. Sethumadhavan, "Solving channel allocation problem using new genetic algorithm with clique par-titioning method," 2016 IEEE International Conference on Computational Intelligence and Computing Research (ICCIC), 2016, pp. 1-4, doi: 10.1109/ICCIC.2016.7919671
S. Balakrishnan, T. Suresh and R. Marappan, "Solving Graph Coloring Problem Using New Greedy and Probabilistic Method," 2022 8th International Conference on Advanced Computing and Communication Systems (ICACCS), 2022, pp. 1992-1995, doi: 10.1109/ICACCS54159.2022.9785139
A.E. Eiben; J.K. Van Der Hauw; J.I. Van Hemert: Graph Coloring with Adaptive Evolutionary Algorithms. Journal of Heuristics 4, 25-46 (1998)
Marappan, R., Bhaskaran, S. New evolutionary operators in coloring DIMACS challenge benchmark graphs. Int. j. inf. tecnol. (2022). DOI: https://doi.org/10.1007/s41870-022-01057-x
Raja Marappan, Gopalakrishnan Sethumadhavan, R.K. Srihari, New approximation algorithms for solving graph color-ing problem - An experimental approach, Perspectives in Science, Volume 8, 2016, Pages 384-387, ISSN 2213-0209, https://doi.org/10.1016/j.pisc.2016.04.083.
Philippe Galinier; Alain Hertz: A survey of local search methods for graph coloring. Computers & Operations Research 33(9), 2547-2562 (2006)
Raja Marappan, Gopalakrishnan Sethumadhavan, U. Harimoorthy, Solving channel allocation problem using new ge-netic operators - An experimental approach, Perspectives in Science, Volume 8, 2016, Pages 409-411, ISSN 2213-0209, https://doi.org/10.1016/j.pisc.2016.04.091
S. Balakrishnan, Tamilarasi Suresh, Raja Marappan: Analysis of Recent Trends in Solving NP Problems with New Re-search Directions Using Evolutionary Methods. International Journal of Research Publication and Reviews Vol (2) Issue (8) (2021) Page 1429-1435
S. Balakrishnan, Tamilarasi Suresh, Raja Marappan. (2021) A New Multi-Objective Evolutionary Approach to Graph Coloring and Channel Allocation Problems. Journal of Applied Mathematics and Computation, 5(4), 252-263. DOI: http://dx.doi.org/10.26855/jamc.2021.12.003
David S. Johnson; Cecilia R. Aragon; Lyle A. McGeoch; Catherine Schevon: An Experimental Evaluation; Part II, Graph Coloring and Number Partitioning. Operations Research 39(3) (1991)
Raja Marappan: A New Multi-Objective Optimization in Solving Graph Coloring and Wireless Networks Channels Al-location Problems. Int. J. Advanced Networking and Applications Volume: 13 Issue: 02 Pages: 4891-4895 (2021)
Bhaskaran, S., Marappan, R. Design and analysis of an efficient machine learning based hybrid recommendation system with enhanced density-based spatial clustering for digital e-learning applications. Complex Intell. Syst. (2021). https://doi.org/10.1007/s40747-021-00509-4
Kazunori Mizuno; Seiichi Nishihara: Constructive generation of very hard 3-colorability instances. Discrete Applied Mathematics 156, 218-229 (2008)
Raja Marappan, S. Bhaskaran, N. Aakaash, S. Mathu Mitha. (2022) Analysis of COVID-19 Prediction Models: Design & Analysis of New Machine Learning Approach. Journal of Applied Mathematics and Computation, 6(1), 121-126. DOI: http://dx.doi.org/10.26855/jamc.2022.03.013
Yongquan Zhou; Hongqing Zheng; Qifang Luo; Jinzhao Wu: An improved Cuckoo Search Algorithm for Solving Planar Graph Coloring Problem. Applied Mathematics & Information Sciences 7(2), 785-792 (2013)
Raja Marappan, S. Bhaskaran, S. Ashwadh, H. Aathi Raj. (2022) Extraction of Drug Review Polarity Using Sentimental Analysis. Journal of Applied Mathematics and Computation, 6(2), 167-177. DOI: http://dx.doi.org/10.26855/jamc.2022.06.001
Soma Saha; Rajeev Kumar; Gyan Baboo: Characterization of graph properties for improved Pareto fronts using heuristics and EA for bi-objective graph coloring problem. Applied Soft Computing 13(5), 2812-2822 (2013)
Marappan, R., & Bhaskaran, S. (2022). Analysis of Network Modeling for Real-world Recommender Systems. Interna-tional Journal of Mathematical, Engineering, Biological and Applied Computing, 1(1), 1-7. DOI: 10.31586/ijmebac.2022.283
Steven Prestwich: Generalised graph colouring by a hybrid of local search and constraint programming. Discrete Applied Mathematics 156, 148-158 (2008)
Marappan, R., & Bhaskaran, S. (2022). Movie Recommendation System Modeling Using Machine Learning. International Journal of Mathematical, Engineering, Biological and Applied Computing 2022, 1(1), 12-16. DOI: 10.31586/ijmebac.2022.291
Raja Marappan, S. Bhaskaran. (2022). Analysis of Recent Trends in E-Learning Personalization Techniques. The Educa-tional Review, USA, 6(5), 167-170. DOI: http://dx.doi.org/10.26855/er.2022.05.003
Thang N. Bui; ThanhVu H. Nguyen; Chirag M. Patel; Kim-Anh T. Phan: An ant-based algorithm for coloring graphs. Discrete Applied Mathematics 156, 190-200 (2008)
Ling-Yuan Hsu; Shi-Jinn Horng; Pingzhi Fan; Muhammad Khurram Khan; Yuh-Rau Wang; Ray-Shine Run; Jui-Lin Lai; Rong-Jian Chen: MTPSO algorithm for solving planar graph coloring problem. Expert Systems with Applications 38, 5525-5531 (2011)
Marappan, R. (2022). Classification and Analysis of Recommender Systems. International Journal of Mathematical, Engi-neering, Biological and Applied Computing, 1(1), 17-21. DOI: 10.31586/ijmebac.2022.331
Raja Marappan, S Bhaskaran. Datasets Finders and Best Public Datasets for Machine Learning and Data Science Appli-cations. COJ Rob Artificial Intel. 2(1). COJRA. 000530. 2022.
Marappan, R. (2022). Graph Coloring Solutions to Queen Graphs. International Journal of Mathematical, Engineering, Biological and Applied Computing, 1(1), 40-41. Retrieved from https://www.scipublications.com/journal/index.php/ijmebac/article/view/335
Angelini P.; Bekos M. A.; De Luca F.; Didimo W.; Kaufmann M.; Kobourov S.; Montecchiani F.; Raftopoulou C. N.; Ro-selli V.; Symvonis A.: Vertex-Coloring with Defects. Journal of Graph Algorithms and Applications (2017)
Marappan, R. (2022). Recommender System for Movielens Datasets using an Item-based Collaborative Filtering in Py-thon. International Journal of Mathematical, Engineering, Biological and Applied Computing, 1(1), 42-43.
Severino F. Galán: Simple decentralized graph coloring. Computational Optimization and Applications (2017)
Marappan, R. (2022). Create a Book Recommendation System using Collaborative Filtering. International Journal of Mathematical, Engineering, Biological and Applied Computing, 1(1), 44-46.
Franjic, S., & Marappan, R. (2022). Role of Electronic Components in Computing. International Journal of Mathematical, Engineering, Biological and Applied Computing, 1(1), 47-48.
Bhaskaran, S.; Marappan, R.; Santhi, B. Design and Comparative Analysis of New Personalized Recommender Algo-rithms with Specific Features for Large Scale Datasets. Mathematics 2020, 8, 1106. https://doi.org/10.3390/math8071106
Bhaskaran, S.; Marappan, R.; Santhi, B. Design and Analysis of a Cluster-Based Intelligent Hybrid Recommendation Sys-tem for E-Learning Applications. Mathematics 2021, 9, 197. https://doi.org/10.3390/math9020197
Murat Aslan; Nurdan Akhan Baykan: A Performance Comparison of Graph Coloring Algorithms. International Journal of Intelligent Systems and Applications in Engineering (2016)