A programmer is a person who passes as an exacting expert on the basis of being able to turn out, after innumerable punching, an infinite series of incomprehensive answers calculated with micrometric precisions from vague assumptions based on debatable figures taken from inconclusive documents and carried out on instruments of problematical accuracy by persons of dubious reliability and questionable mentality for the avowed purpose of annoying and confounding a hopelessly defenseless department that was unfortunate enough to ask for the information in the first place. Grid newsmagazine

Two color a map with no more than four colors

Language Java | Level Intermediate | Category Algorithms | August 3, 2015 9:43 pm


Algorithm Problem Description

Given any separation of a plane into contiguous regions, producing a figure called a map, no more than four colors are required to color the regions of the map so that no two adjacent regions have the same color.

Write a program to implement four color theorem?

Output

          	        
          	        

Number of vertices : 4
Number of colors : 3
Adjacency matrix : 
0 1 1 1 
1 0 1 0 
1 1 0 1 
1 1 1 0 

Coloring(V C) #  1-->	(1 1)	(2 2)	(3 3)	(4 2)
Coloring(V C) #  2-->	(1 1)	(2 3)	(3 2)	(4 3)
Coloring(V C) #  3-->	(1 2)	(2 1)	(3 3)	(4 1)
Coloring(V C) #  4-->	(1 2)	(2 3)	(3 1)	(4 3)
Coloring(V C) #  5-->	(1 3)	(2 1)	(3 2)	(4 1)
Coloring(V C) #  6-->	(1 3)	(2 2)	(3 1)	(4 2)
total number of solutions : 6

          	        
          	        				    


Comments



Please login to add comments.