Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

The four-color theorem states that any map in a plane can be colored using four-colors in such a way that regions sharing a common boundary (other than a single point) do not share the same color. This problem is sometimes also called Guthrie's problem after F. Guthrie, who first conjectured the theorem in 1852. 

The problem at hand is to take a map separated into regions as expressed in an adjacency matrix and using four colors, color the map such that no two contiguous regions share the same color. We will use an adjacency matrix to encode which region borders on which other region. The columns and rows of the matrix are the regions while the cells contain a 0 if the two regions are not adjacent and a 1 if they border. Create a recursive backtracking solution which accepts as interactive input from the user the number of regions in the map and the filename of the adjacency matrix expressing the maps makeup. Your output should be similar to

Region    Color 

A              red 

B              Green 

C              yellow 

D              Blue 

Or whatever four colors you choose (and if you want you could have the user choose the four colors but that it not mandatory). 

Consider the following map with four regions: 

87_img1.png

Its adjacency matrix would be 

 

A

B

C

D

A

0

1

0

1

B

1

0

1

0

C

0

1

0

1

D

1

0

1

0

Consider the following map of central Europe with 9 regions:

1990_img2.png

The solution to these maps do not require backtracking 

Consider this final map with 6 regions it will require backtracking

1820_img3.png

While these three maps will not fully test your solution they will be a start. Nithin and Billy will be creating a map(s) to test your program when you turn it in. You are to write module specifications (JavaDoc) all methods in the class except main. In addition to turning in a gnulist printout, you are also to email your class to your lab instructor (and only your lab instructor). Use the subject line.

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M91372583
  • Price:- $35

Guranteed 24 Hours Delivery, In Price:- $35

Have any Question?


Related Questions in Data Structure

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As