map-coloring icon indicating copy to clipboard operation
map-coloring copied to clipboard

Making The Used Algorithm Faster #hacktoberfest

Open Erfaniaa opened this issue 6 years ago • 0 comments

As it's noted on the README page: 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.

The second part of the algorithm is converting the input map to a simple planar graph: There will be a node for each region. Two nodes will be adjacent, if and only if their corresponding regions have a common border on the map.

If two regions like A and B have N and M vertices respectively, checking whether their corresponding graph nodes should have an edge between them or not takes O(N * M) time complexity. If anyone reduces this complexity by changing the used algorithm, he/she will gain some #hacktoberfest credits.

Erfaniaa avatar Oct 01 '19 13:10 Erfaniaa