{"id":16413261,"url":"https://github.com/hashirshoaeb/antenna-placement-problem","last_synced_at":"2026-06-14T12:33:10.910Z","repository":{"id":114276283,"uuid":"224418455","full_name":"hashirshoaeb/Antenna-placement-problem","owner":"hashirshoaeb","description":"In 5 antenna problem we have to place 5 antennas (a, b, c, d, e) on a 6x6 grid in such a way that maximum area is covered by their signals. To find the best solution we use Genetic Algorithm, upon a population of twenty random individuals/chromosomes.","archived":false,"fork":false,"pushed_at":"2019-11-27T13:22:54.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T07:48:06.510Z","etag":null,"topics":["chromosome","genetic-algorithm","genetic-algorithms","object-placement","problem","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/hashirshoaeb.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}},"created_at":"2019-11-27T11:47:09.000Z","updated_at":"2022-10-16T11:26:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e3e0d80-d752-44f8-8f94-10a478a8e296","html_url":"https://github.com/hashirshoaeb/Antenna-placement-problem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hashirshoaeb/Antenna-placement-problem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashirshoaeb%2FAntenna-placement-problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashirshoaeb%2FAntenna-placement-problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashirshoaeb%2FAntenna-placement-problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashirshoaeb%2FAntenna-placement-problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashirshoaeb","download_url":"https://codeload.github.com/hashirshoaeb/Antenna-placement-problem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashirshoaeb%2FAntenna-placement-problem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34322073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"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":["chromosome","genetic-algorithm","genetic-algorithms","object-placement","problem","python3"],"created_at":"2024-10-11T06:50:59.665Z","updated_at":"2026-06-14T12:33:10.895Z","avatar_url":"https://github.com/hashirshoaeb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Antenna-placement-problem\n\nIn 5 antenna problem we have to place 5 antennas (a, b, c, d, e) on a 6x6 grid in such a way that maximum area is covered by their signals. To find the best solution we use Genetic Algorithm, upon a population of twenty random individuals/chromosomes.\n\n## Chromosome:\n\nThe chromosome has 5 values, each representing the position of antenna (a,b,c,d,e) consecutively, on the grid. For example, the below chromosome shows the positions of a,b,c,d,e as shown. x is horizontal, and y is vertical. Area covered by each antenna is represented by 1. Similarly uncovered area is represented by 0.\n\n```python\n#             [x, y]\nchromosome = [[5, 4], [2, 2], [3, 4], [4, 1], [1, 1]]\n\n#     x= 1, 2, 3, 4, 5, 6\narea = [[1, 1, 1, 1, 1, 0], # y = 1\n        [1, 1, 1, 1, 0, 0], #     2\n        [0, 1, 1, 0, 1, 0], #     3\n        [0, 1, 1, 1, 1, 1], #     4\n        [0, 0, 1, 0, 1, 0], #     5\n        [0, 0, 0, 0, 0, 0]] #     6\n```\n\nEach antenna cover 5 blocks.\n\n```python\nantenna = [[0, 1, 0],  #  [N, N-1]\n           [1, 1, 1],  #  [N-1, N] , [N, N], [N+1, N]\n           [0, 1, 0]]  #  [N, N+1]\n```\n\n## Fitness evaluation:\nEach antenna covers 5 blocks on a grid. One its own, and four neighbours, up, down, left and right. So fitness value is the total area covered by all 5 antennas. Example is shown above. 5 antennas cover 19 blocks, so fitness value is 19.\n\n# Example\n\n```python\nfrom chromosome import chromosome\nchromosome1 = chromosome()\nprint(chromosome1.chrom)\nprint(chromosome1.area)\nprint(chromosome1.fitnessValue)\n```\n\n```bash\n[[4, 3], [6, 2], [2, 5], [5, 5], [2, 2]]\n[[0 1 0 0 0 1]\n [1 1 1 1 1 1]\n [0 1 1 1 1 1]\n [0 1 0 1 1 0]\n [1 1 1 1 1 1]\n [0 1 0 0 1 0]]\n24\n```\n\n```python\nchromosome1.mutate()\nprint(chromosome1.chrom)\nprint(chromosome1.fitnessValue)\n```\n```bash\n[[4, 3], [6, 2], [6, 2], [5, 5], [2, 2]]\n19\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashirshoaeb%2Fantenna-placement-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashirshoaeb%2Fantenna-placement-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashirshoaeb%2Fantenna-placement-problem/lists"}