Create a recursive backtracking solution

Assignment Help Data Structure & Algorithms
Reference no: EM13802580

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.

Reference no: EM13802580

Questions Cloud

Convert it to a relational schema : Convert it to a relational schema, Database Management System
Advantages of using new technologies in training : List and detail several advantages of using new technologies in training and development
Semi-annual yields to maturity of the two bonds : Suppose you have the choice of investing in (A) a zero-coupon bond, which costs $500 today, pays no coupon during its life, compounds semi-annually, and then pays $1,000 after 10 years, or (B) a bond which costs $750 today, pays $25 in interest semi ..
Preliminary project scope incorporating all discrete tasks : Identify a project concept that could be implemented at either your workplace or home. The concept needs to fulfil project criteria including being of sufficient complexity to warrant a project manager to implement the task.
Create a recursive backtracking solution : 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 regi..
What was the semi-annual current yield of this bond : The City of Ames issued a new series of bonds on Jan 1, 2009. The bonds were sold at par ($1,000), have a 2.5% annual coupon rate and mature in 10 years, on Jan 1, 2019. Coupon interest payments are made semi-annually (on June 30 and December 31). Wh..
Using the dollar-cost-averaging approach : Suppose that you invested $10,000 dollars using the dollar-cost-averaging approach. Assume that on Feb-1-10, and on Feb-1-11, you purchased $5,000 worth of stock (each year). You then held the shares until they were sold on Feb-1-2014 (assume you rec..
Balance sheet as ordinary shares outstanding : Show and compute the following (don’t use Key Ratios precomputed from the site). Compute the ratios using the methods described in this class (which may not always give you the same number as shown in Key Ratios). Note that sales = Total Revenue, and..
Pros and cons of a budget deficit and the national debt : How will a cut in Government Spending of $300 billion with a MPC equal to .75 impact AD, inflation, and output? Why? Make sure to include the appropriate equations and graph. How does the cut in Government spending impact the budget deficit and the n..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd