{"id":19252742,"url":"https://github.com/tomaszrewak/bmcp","last_synced_at":"2025-08-23T03:04:28.364Z","repository":{"id":125409442,"uuid":"96255106","full_name":"TomaszRewak/BMCP","owner":"TomaszRewak","description":"Bandwidth Multi Coloring Problem slover written in C++. The metaheuristic is based on genetic and greedy algorithms. ","archived":false,"fork":false,"pushed_at":"2017-07-04T21:59:56.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T16:53:14.293Z","etag":null,"topics":["bandwidth","genetic-algorithm","graph-algorithms","graph-coloring","greedy-algorithm","metaheuristics","optimization","tabu-search"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomaszRewak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-04T21:46:19.000Z","updated_at":"2023-12-31T19:24:17.000Z","dependencies_parsed_at":"2023-08-11T10:31:34.914Z","dependency_job_id":null,"html_url":"https://github.com/TomaszRewak/BMCP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomaszRewak/BMCP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomaszRewak%2FBMCP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomaszRewak%2FBMCP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomaszRewak%2FBMCP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomaszRewak%2FBMCP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomaszRewak","download_url":"https://codeload.github.com/TomaszRewak/BMCP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomaszRewak%2FBMCP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271736791,"owners_count":24812006,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bandwidth","genetic-algorithm","graph-algorithms","graph-coloring","greedy-algorithm","metaheuristics","optimization","tabu-search"],"created_at":"2024-11-09T18:28:16.344Z","updated_at":"2025-08-23T03:04:28.319Z","avatar_url":"https://github.com/TomaszRewak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BMCP\nBandwidth Multi Coloring Problem slover written in C++\n\nThe metaheuristic is based on genetic and greedy algorithms. \n\nIt consists of separate modules:\n\n# Genetic algorithm\nAbstract genetic algorithm, that can be also used for sloving any other problem due to its modular structure.\nHere is an example of initializing and running created GA:\n```\nGA::GeneticAlgorithm ga;\nga\n\t.withInitialPopulation\u003cBMCP_GA::InitialPopulation\u003e(graph, 1000)\n\t.with([\u0026](GA::ComponentChainBuilder\u0026 builder) { builder\n\t\t.with\u003cBMCP_GA::RingSelection\u003e(10)\n\t\t.with\u003cBMCP_GA::Mutation\u003e(0.2)\n\t\t.with\u003cBMCP_GA::Fitness\u003e(graph)\n\t\t.with\u003cBMCP_GA::NewPopulation\u003e()\n\t\t.with\u003cFitnessLog\u003e(graph, logScope); });\nga.start();\n```\nNew components can be created by inheriting ```Component``` class. Components are used in a pipeline to transform one population into another.\n\n# BMCP\nThe main component here is ```Greedy``` class that enables user to compute a coloring based on a graph definition and a vector containing an order of colors assigning. \n\nGraph class is able to store a BMCP graph definition. \nAlso implemented is ```std::ostream\u0026 operator\u003c\u003c(std::ostream\u0026 stream, Graph\u0026 graph)``` operator, so new graphs can be easily read from a file input. It requires a graph definition structure as in examples in ```In/``` directory.\n\n# Tabu\nHere defined is a fast and low memory consuming tabu table. Main operations that one can do on it is to insert a new vector of numbers, check if a provided vector already exists and remove the oldes vector from the table. By default it searches for exactly the same vector when asked, but you can creat a tabu table (by specifying ```maxDiff``` parameter) that will treat elements as same when a sum of differences between next values is less then a bandwidth.\nIn a standars scenario (when the bandwidth = 0) all main (adding, checking and removing) operations have pessimistic complexity of ```N*M```, where ```N``` is a length of a vector and ```M``` is maximum number of values that a single node can have. An expected complexity is closer to the O(N) tho, as the whole thing is based on a tree structure (that is stored inside of on array, so it's not too memory consuming). \n\nI have tested it for sloving BMCP, but it doesn't seem to have any impact to results. So I'm not using it anymore, but the structure as it is might be used for different projects in the future. \n\n# BMCP_GA\nThis project defines some classes that combine BMCP\n with genetic algorithms.\n\n# Test\nThis project uses all previously defined modules to compute graphs stored in ```In/``` directory.\n\n# Compilation\nI have created this project in a VS, so I'm shipping it with all files necessary to compile the code in it. The compilation process produces a Test.exe file inside a Release directory. The project itself doesn't use any platform-specific operations, so it can be easily ported, compiled and reused with other IDEs/compilers on other platforms.\n\n# Testing\nTo test the program on provided test cases located in ```In``` directory you have to run Release/Test.exe file from within solution directory. It will log some information on the console and output more details into ```Out``` directory. You might want to create the ```Out``` directory yourself, as it might not get created automatically (also within the main solution directory). Test.exe executable requires just one parameter to run, a number specifying which test scenario should be used for this test. For more info see main.cpp file in Test project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaszrewak%2Fbmcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaszrewak%2Fbmcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaszrewak%2Fbmcp/lists"}