Question: 2 0 . 1 2 Project 4 : Map Coloring Testing is complete. Please alert me if you encounter problems. Construct a 4 coloring of
Project : Map Coloring
Testing is complete. Please alert me if you encounter problems.
Construct a coloring of a map such that no two neighboring countries have the same color. For this project you will read in a map encoded as a text file. An example Follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~AABBBBBCCDDEFGGG~~HHIHHJJJKK~ ~~ABBBBBCCDDEFGGGGHHHIHHJJJKK~ ~AAAAAALLLLLEMMMMMHHHHHHHHHHH~ ~AAAAA~~LLLLEMMMM~~HHHHHHHHHH~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Are not part of any country and do not have to be colored.
Countries will be marked A though Z
While a coloring of the map might look like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~~ ~~ ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You are asked to produce a string in the following format:
Color : B F H Color : J L M Color : A D G K Color : C E
The grading engine will parse this string to verify your coloring. Valid colorings are not unique.
You must implement the following function:
std::string colormapstd:string filename
The input is the name of a file eg "map.txt and you return the coloring described above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
