{"id":23431963,"url":"https://github.com/keremtan/coloringmapalgorithm-csp-","last_synced_at":"2025-04-13T00:30:26.309Z","repository":{"id":162767218,"uuid":"444766907","full_name":"KeremTAN/ColoringMapAlgorithm-CSP-","owner":"KeremTAN","description":"Graphical Coloring of Countries with Condition Satisfaction Algorithm.","archived":false,"fork":false,"pushed_at":"2022-01-08T14:57:34.000Z","size":116,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T18:22:29.808Z","etag":null,"topics":["algorithm","coloring-algorithm","coloring-graph","computer-algorithm","csp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeremTAN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-05T10:49:02.000Z","updated_at":"2024-12-07T15:30:07.000Z","dependencies_parsed_at":"2023-05-27T10:15:41.440Z","dependency_job_id":null,"html_url":"https://github.com/KeremTAN/ColoringMapAlgorithm-CSP-","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"54d71aa32523d313772cc3e9a5c490dc5080b78d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FColoringMapAlgorithm-CSP-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FColoringMapAlgorithm-CSP-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FColoringMapAlgorithm-CSP-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FColoringMapAlgorithm-CSP-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeremTAN","download_url":"https://codeload.github.com/KeremTAN/ColoringMapAlgorithm-CSP-/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650591,"owners_count":21139670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","coloring-algorithm","coloring-graph","computer-algorithm","csp"],"created_at":"2024-12-23T10:51:51.200Z","updated_at":"2025-04-13T00:30:26.284Z","avatar_url":"https://github.com/KeremTAN.png","language":"Python","readme":"# ColoringMapAlgorithm-CSP-\n## Condition Satisfaction Algorithm\n### Output\n![UML](https://github.com/KeremTAN/ColoringMapAlgorithm-CSP-/blob/master/img/countries.png)\n### Condition\n![UML](https://github.com/KeremTAN/ColoringMapAlgorithm-CSP-/blob/master/img/condition.png)\n\n\u003cb\u003eOur 1st method\u003c/b\u003e has 2 parameters and does the sorting of the countries. \u003c/br\u003e\nIn its parameter, it takes the graph structure of the countries and the list of names of the unsorted countries. \u003c/br\u003e\nNote: the graph structure of countries is defined as a local variable dictionary. \u003c/br\u003e\nIt is important that we sort our countries from the most to the least number of neighbors, because if we don't do this and  \u003c/br\u003e\ncolor the countries with the fewest neighbors first, the colors of the countries with  \u003c/br\u003e\nthe fewest neighbors will coincide with those of the neighboring countries. \u003c/br\u003e \nOur method returns the sorted countries after sorting.  \u003c/br\u003e \u003c/br\u003e\n\u003cb\u003eOur 2nd method\u003c/b\u003e has 2 parameters and checks for correct coloring of country colors.  \u003c/br\u003e\nIn its parameter, it takes the graph structure of the countries and the color dictionary of the countries.  \u003c/br\u003e\nFirst of all, it checks the countries that are on our graph and have not yet been added to our dictionary.  \u003c/br\u003e\nThen, we compare the colors of the countries and their neighbors in our dictionary through our graph.  \u003c/br\u003e\nIf a country and any of its neighbors have the same color, we return the wrong value.  \u003c/br\u003e \u003c/br\u003e\n\u003cb\u003eOur 3rd method\u003c/b\u003e has 3 parameters and does the coloring of the countries.  \u003c/br\u003e\nIn its parameter, it takes the graph structure of the countries, an empty dictionary for us to color, and an unsorted list of countries' names.  \u003c/br\u003e\nThis method first calls our 1st method and sorts our unordered countries.  \u003c/br\u003e\nOur method traverses the sorted lists of countries and colors with indices to color our countries.  \u003c/br\u003e\nAfter coloring a country, it performs control with our 2nd method.  \u003c/br\u003e\nIf it returns a false value to us, it colors the same country again, reducing the index it uses to hover by 1.  \u003c/br\u003e\nIt also increments our solver-counter by 1.  \u003c/br\u003e\nWhen the number of elements of our solver-counter and our colors list are equal, it gives the message \"unsolved problem\".  \u003c/br\u003e\nAfter that, our method returns a false value with an empty dictionary and ends our program.  \u003c/br\u003e\nIf our 2nd method returns true, it resets our solver-counter and continues coloring the countries.  \u003c/br\u003e\nAfter all countries are colored, our method returns two values. One is the colored dictionary of countries and the other is the correct value.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremtan%2Fcoloringmapalgorithm-csp-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeremtan%2Fcoloringmapalgorithm-csp-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremtan%2Fcoloringmapalgorithm-csp-/lists"}