{"id":48505286,"url":"https://github.com/steleman/quadratic-assignment","last_synced_at":"2026-04-07T16:02:59.571Z","repository":{"id":344491304,"uuid":"1181999521","full_name":"steleman/quadratic-assignment","owner":"steleman","description":"Research on the Quadratic Assignment Problem with CUDA Acceleration","archived":false,"fork":false,"pushed_at":"2026-04-04T22:57:47.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T00:42:16.375Z","etag":null,"topics":["cuda","cuda-kernels","cuda-programming","cuda-programming-project","quadratic-assignment","quadratic-assignment-problem"],"latest_commit_sha":null,"homepage":"","language":"Cuda","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/steleman.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T22:51:23.000Z","updated_at":"2026-04-04T22:57:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/steleman/quadratic-assignment","commit_stats":null,"previous_names":["steleman/quadratic-assignment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steleman/quadratic-assignment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steleman%2Fquadratic-assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steleman%2Fquadratic-assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steleman%2Fquadratic-assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steleman%2Fquadratic-assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steleman","download_url":"https://codeload.github.com/steleman/quadratic-assignment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steleman%2Fquadratic-assignment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31518646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cuda","cuda-kernels","cuda-programming","cuda-programming-project","quadratic-assignment","quadratic-assignment-problem"],"created_at":"2026-04-07T16:02:58.683Z","updated_at":"2026-04-07T16:02:59.560Z","avatar_url":"https://github.com/steleman.png","language":"Cuda","readme":"My own research on the Quadratic Assignment Problem\n===================================================\n\nThis is some of my own research on the Quadratic Assignment Problem (QAP).\nThe main program is `qap`. `genrandomdata` is a random data generator to be used with `qap`.\nThe CUDA-accelerated program is `cudaqap`. See more below.\n\nThis is Work-In-Progress. I haven't touched these in over a year. I've been working on other things since then. I'm just using Github as a file backup. :-)\n\nThere are two `Makefiles` here: `Makefile.gcc` and `Makefile.clang`. It should be pretty obvious what they are and what they do. :-)\n\nThe `sample-data` directory contains sample data.\n\nSaying `\u003cprogram-name\u003e --help` will show you how to use each program.\n\nAll of this work was done on Linux (Fedora).\n--------------------------------------------\n\nQuadratic Assignment Problem\n============================\n\nThis repo contains a Proof-Of-Concept implementation of the brute-force approach to the Quadratic Assignment Problem. The program name is `qap`.\n\n```\n%\u003e ./qap --help\nUsage: qap [-h | --help]\n           [ -f \u003cflow-input-file\u003e | --flinput \u003cflow-input-file\u003e]\n           [ -d \u003cdistance-input-file\u003e | --dstinput \u003cdistance-input-file\u003e]\n           [-p | --print]\n           (print vector contents).\n```\n\nExample:\n\n```\n%\u003e ./qap -f ./fldata-100.dat -d ./dstata-100.dat -p\nMinimum cost: 165908\nIterations: 3628800\nFlow Graph Vector:\n{ { 6, 7, 22, 23, 30, 52, 65, 68, 73, 77 },\n  { 2, 5, 20, 39, 48, 52, 57, 76, 79, 82 },\n  { 3, 4, 16, 18, 30, 41, 43, 45, 60, 75 },\n  { 6, 14, 49, 55, 61, 62, 65, 67, 76, 97 },\n  { 22, 26, 30, 39, 41, 47, 51, 61, 75, 82 },\n  { 9, 24, 46, 53, 62, 68, 74, 76, 97, 98 },\n  { 8, 12, 13, 16, 20, 44, 69, 73, 78, 83 },\n  { 2, 10, 15, 25, 50, 52, 67, 73, 76, 85 },\n  { 23, 60, 72, 76, 78, 82, 87, 88, 90, 95 },\n  { 17, 25, 27, 29, 30, 64, 74, 85, 99, 100 } }\n\nDistance Vector:\n{ { 1, 4, 6, 20, 21, 60, 61, 63, 70, 78 },\n  { 5, 13, 15, 41, 46, 50, 56, 59, 64, 75 },\n  { 2, 19, 24, 49, 52, 53, 73, 78, 81, 91 },\n  { 2, 4, 26, 34, 38, 45, 59, 91, 95, 100 },\n  { 23, 26, 36, 41, 45, 47, 74, 87, 93, 95 },\n  { 1, 17, 30, 34, 49, 53, 71, 88, 95, 96 },\n  { 3, 10, 15, 27, 30, 45, 58, 59, 86, 93 },\n  { 15, 21, 26, 35, 65, 72, 82, 88, 93, 99 },\n  { 3, 7, 16, 19, 24, 53, 69, 82, 93, 100 },\n  { 3, 11, 17, 19, 21, 37, 78, 92, 93, 95 } }\n\nAssignment Vector:\n{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }\n\nClock Resolution: 0.000000001.\nCPU time: 0.000000000128 second(s).\n```\n\nThe auxiliary program `genrandomdata` can be used to generate random data to be used by the `qap` program. Example usage of `genrandomdata`:\n\n```\n%\u003e ./genrandomdata -q -f -o ./fldata-1000.dat -u 100 -m 10 -M 10 -n 1000\n%\u003e ./genrandomdata -q -f -o ./dstdata-1000.dat -u 100 -m 10 -M 10 -n 1000\n```\n\nThe use case above will generate Flow Graph and Distance Graph input files for the `qap` program.\n\n\n```\n%\u003e ./genrandomdata --help\nUsage: genrandomdata  [--help | -h]\n                      (print this message)\n                      [--quiet | -q]\n                      (nothing printed to stdout)\n                      [--auto | -a]\n                      (auto-fill the generated sets to cover the full universe)\n                      [--fixed | -f]\n                      (constant (fixed) set size. maxsize == minsize).\n                      [--output \u003cfilename\u003e | -o \u003cfilename\u003e]\n                      (output filename)\n                      [--usize \u003cuniverse-size\u003e | -u \u003cuniverse-size\u003e]\n                      (number of elements in the universe)\n                      [--minsize \u003cminimum-subset-size\u003e | -m \u003cminimum-subset-size\u003e]\n                      (minimum size of a generated subset)\n                      [--maxsize \u003cmaximum-subset-size\u003e | -M \u003cmaximum-subset-size\u003e]\n                      (maximum size of a generated subset)\n                      [--nsets \u003cnumber-of-sets\u003e | -n \u003cnumber-of-sets\u003e]\n```\n\nNote: `genrandomdata` is *very* slow, because it has to fit the randomly generated set element numbers within the boundary constraints indicated on command-line.\n\nThe files suffixed with `*.dat` - included here - are sample input files suitable for use by `qap`.\n\nFiles with names beginning with `fldata` are Flow Graph input files. Files with names beginning with `dstdata` are Distance Graph input files.\n\nCUDA Acceleration\n=================\n\n`cudaqap.cu` is the CUDA-Accelerated version of `qap.cpp`. `Makefile.cuda` is the Makefile for building with CUDA.\n\nI tested it with CUDA 12.9. It should work with any CUDA version higher than that.\n\nSample results:\n\n```\n%\u003e ./cudaqap -d ./dstdata-100.dat -f ./fldata-100.dat\nMinimum cost: 319571\nIterations:   67840\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-100.dat -f ./fldata-100.dat\nMinimum cost: 319571\nIterations:   67840\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-100.dat -f ./fldata-100.dat\nMinimum cost: 319571\nIterations:   67840\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-144.dat -f ./fldata-144.dat\nMinimum cost: 1627159\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-144.dat -f ./fldata-144.dat\nMinimum cost: 1627159\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-144.dat -f ./fldata-144.dat\nMinimum cost: 1627159\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-256.dat -f ./fldata-256.dat\nMinimum cost: 5517628\nIterations:   69376\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-256.dat -f ./fldata-256.dat\nMinimum cost: 5517628\nIterations:   69376\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-256.dat -f ./fldata-256.dat\nMinimum cost: 5517628\nIterations:   69376\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-400.dat -f ./fldata-400.dat\nMinimum cost: 20216534\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-400.dat -f ./fldata-400.dat\nMinimum cost: 20216534\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-400.dat -f ./fldata-400.dat\nMinimum cost: 20216534\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-625.dat -f ./fldata-625.dat\nMinimum cost: 79571576\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-625.dat -f ./fldata-625.dat\nMinimum cost: 79571576\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-625.dat -f ./fldata-625.dat\nMinimum cost: 79571576\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-900.dat -f ./fldata-900.dat\nMinimum cost: 234319635\nIterations:   72960\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000001 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-900.dat -f ./fldata-900.dat\nMinimum cost: 234319635\nIterations:   72960\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000001 second(s).\n\n%\u003e ./cudaqap -d ./dstdata-900.dat -f ./fldata-900.dat\nMinimum cost: 234319635\nIterations:   72960\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000001 second(s).\n\n%\u003e ./cudaqap -s ./chr12a.dat\nMinimum cost: 40172\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr12a.dat\nMinimum cost: 40172\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr12a.dat\nMinimum cost: 40172\nIterations:   68352\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr20a.dat\nMinimum cost: 10478\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr20a.dat\nMinimum cost: 10478\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr20a.dat\nMinimum cost: 10478\nIterations:   70400\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr25a.dat\nMinimum cost: 19750\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr25a.dat\nMinimum cost: 19750\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n%\u003e ./cudaqap -s ./chr25a.dat\nMinimum cost: 19750\nIterations:   71680\nCPU Clock Resolution: 0.000000001.\nGPU time: 0.000000000000 second(s).\n\n```\n\nEach test was run on the same sample data 3 times sequentially to prove the consistency of the results.\n\nThe test results were obtained on a Corei9 laptop with a NVIDIA 4080 GPU.\n\nThe `chr20a.dat` sample data does not finish after running continuously for 48 hours with the CPU-only version (`qap.cpp`). The improvement with CUDA is noticeable.\n\nThe CUDA Acceleration part is Work-In-Progress. It probably needs some cleanup.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteleman%2Fquadratic-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteleman%2Fquadratic-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteleman%2Fquadratic-assignment/lists"}