Question
Write a program that will compute the chromatic number of a graph and color the verticies using the chromatic number of colors. The input to
Write a program that will compute the chromatic number of a graph and color the verticies using the chromatic number of colors. The input to the program is a file containing the graph. The input file contains the number of verticies and the number of edges at the top and the list of edges at in the subsequent lines. The output file contains the chromatic number at the top and the coloring of verticies using the chromatic number of colors in the subsequent lines. The verticies are named 1,2,3... and the colors are also named 1,2,3...
A brute force algorithm to solve the coloring problem is given. Translate the algorithm into a Java program. The program must be based on the algorithm.
The given psuedocode can be found here: https://pastebin.com/73msEv00
input file -----> output file
5 7 3
4 2 1 1
1 5 2 2
2 3 3 3
4 3 4 1
5 4 5 3
1 2
2 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started