1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

4 color theorem software

Discussion in 'JavaScript' started by stellatus, Mar 15, 2017.

  1. #1
    We have a JavaScript applet: https://www.kleemans.ch/four-color-theorem-map-solver
    We draw a contour only by thick black straight lines. When you press "Solve" button, areas are colored, according to the 4 colors theorem, no more than 4 colors. Under the table for painting, there are several prepared examples. The program can be downloaded here:
    https://github.com/akleemans/fourcolors
    It seems that everything is working properly. The problem arises when we put another contours into the folder "examples". Here is the version with contours, which I created in Paint:
    https://drive.google.com/file/d/0B-u7dqmskzd5c0lDdDRGc1dMY1E/view
    The program colors my contours areas (the first five examples), more than four colors. I don't know why it happens. I wrote in this matter to the author, but he isn't responding. I completely don't know JavaScript. I only know that this code line stops procedure after 10 seconds:
    if (millis () - start> 10 * 1000) {break; }
    Code (markup):
    If we delete this line, the browser crashes error. I will be grateful for any help. Maybe someone of you knows any simpler way to realize idea of coloring the contours areas using 4 colors theorem? Maybe there are any other programs? It seems to me that this applet has everything what I need and it's necessary to modify it only just a little.
     
    Last edited by a moderator: Mar 15, 2017
    stellatus, Mar 15, 2017 IP