# Backtracking algorithms

A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer. Bill Gates

## 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
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

```