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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!