Map coloring, using four colors
This program gets a map image as an input and produces all possible valid colorings of that map using backtracking.
The input image background and borders should be white.
Install numpy, matplotlib and opencv using pip.
pip install -r requirements.txt
python3 map_coloring.py map_image_file_name
python3 map_coloring.py iran.jpg
The original image:
A part of the program output:
python3 map_coloring.py tehran_province.jpg
The original image:
A part of the program output:
python3 map_coloring.py usa.png
The original image:
A part of the program output:
It runs slowly on large images. It can be improved by changing the second part of its algorithm (about setting the graph edges). Some computational geometry knowledge about polygons may be needed for this part.
Any contributions are welcomed.
Python Engineer Roadmap
Computer vision and Deep learning
Gets news from https://liveuamap.com/ and sends it to a Discord webhook.
FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
Build REST APIs with Neo4j and Flask, as quickly as possible!
Easy-to-use cryptocurrency trading strategy simulator and backtester
Custom mode for Mapbox GL Draw that adds snapping ability while drawing features.
Generative Art Generator