{"id":18964267,"url":"https://github.com/lorransutter/radar-positioning","last_synced_at":"2026-05-10T16:40:43.101Z","repository":{"id":114624632,"uuid":"262462482","full_name":"LorranSutter/Radar-positioning","owner":"LorranSutter","description":"Solve a radar positioning problem using linear programming","archived":false,"fork":false,"pushed_at":"2022-05-20T01:29:58.000Z","size":996,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-17T12:16:19.111Z","etag":null,"topics":["gurobi","gurobipy","linear-programming","opengl","problem-solving","pyopengl","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LorranSutter.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-09T01:20:52.000Z","updated_at":"2023-03-20T16:12:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8dc039e-6da2-4f43-9f0d-4ec405991fed","html_url":"https://github.com/LorranSutter/Radar-positioning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LorranSutter/Radar-positioning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorranSutter%2FRadar-positioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorranSutter%2FRadar-positioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorranSutter%2FRadar-positioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorranSutter%2FRadar-positioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LorranSutter","download_url":"https://codeload.github.com/LorranSutter/Radar-positioning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorranSutter%2FRadar-positioning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32864084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"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":["gurobi","gurobipy","linear-programming","opengl","problem-solving","pyopengl","python3"],"created_at":"2024-11-08T14:23:30.570Z","updated_at":"2026-05-10T16:40:43.084Z","avatar_url":"https://github.com/LorranSutter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Radar Positioning\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Project created to solve a radar positioning problem using linear programming concepts, part of Operations Research course of \u003ca href='http://www.ufjf.br/ufjf/'\u003eUniversidade Federal de Juiz de Fora\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  You can also check a linear solution to solve Sudoku \u003ca href='https://github.com/LorranSutter/Sudoku'\u003ehere\u003c/a\u003e.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#satellite-problem-presentation\"\u003eProblem presentation\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#pencil-dependencies\"\u003eDependencies\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#runner-how-to-run\"\u003eHow to run\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#pencil2-what-is-linear-programming\"\u003eLinear programming\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#triangular_ruler-radar-positioning-model\"\u003eLinear model\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#book-resources-and-technologies-computer\"\u003eResources\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n\n## :satellite: Problem presentation\n\nWe have a 2D region with signal demands to be met by a set of radars. We want to maximize the number of demands met and with better signal quality.\n\nAs seen in the images below, we have two solutions for a region with 100 (left) and 2500 (right) points that radars can be positioned (black dots), 20 (left) and 1000 (right) demands to be met and a limit of 10 (left) and 200 (right) radars (blue circles). The red dots represents demands that could not be met and the green dots demands that were met.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src='https://res.cloudinary.com/lorransutter/image/upload/v1589066290/radarSolution01.png'\u003e\n    \u003cimg src='https://res.cloudinary.com/lorransutter/image/upload/v1589061094/radarSolution02.png'/\u003e\n\u003c/p\u003e\n\nThere are two possible variations for this problem:\n\n1. Fixed number of radars to cover demands.\n2. No limit of radar to cover demands. In this case, in addition than maximize the number of demands met with better signal, we also minimize the number of radars needed to cover all demands.\n\n## :pencil: Dependencies\n\nBesides, of course, [Python](https://www.python.org/), gurobipy library must be installed too. Installation instructions in [Gurobi](https://www.gurobi.com/documentation/9.0/quickstart_mac/py_python_interface.html).\n\nIf you want to visualize the results as in the image above, you will need [PyOpenGL](http://pyopengl.sourceforge.net/).\n\n## :runner: How to run\n\nOpen your terminal in the folder you want to clone the project\n\n```sh\ngit clone https://github.com/LorranSutter/Radar-positioning.git\n```\n\nThe script **Instance_generator.py** generates a random instance to be solved and the inputs are as follows:\n\n- Int → Number of demands\n- Int → Max number of radars (optional)\n- Float → Max reach radius of radar signal (optional) [1-50]\n- Int → Number of points in x direction\n- Int → Number of points in y direction\n\n```sh\npython3 Instance_generator.py \u003clist of inputs\u003e\n```\n\nThe script **Radar_max.py** is the main variation of the problem, with a fixed number of radars. There is only one input, which are the files in *Instances* folder.\n\n```sh\npython3 Radar_max.py Instances/\u003cfile\u003e\n```\n\nThe script **Radar_min.py** is the second variation of the problem, with no limit of radars. The input is the same as the above.\n\n```sh\npython3 Radar_min.py Instances/\u003cfile\u003e\n```\n\nFinally, the script **Display_terrain.py** uses OpenGL to show the results of the previous scripts. Inputs needs two files, one from *InstancesPoints* folder and other from *Solutions* folder. Both must have the same suffixes, for example, instance_Points49_10_5 and instance49_10_5_out.sol\n\n```sh\npython3 Display_terrain.py InstancesPoints/\u003cfile\u003e Solutions/\u003cfile\u003e\n```\n\n## :pencil2: What is linear programming?\n\nLinear programming is a technique used to solve optimization problems where the elements have a linear relationship.\n\nLinear programs aims to maximize a **objective function** made of **decision variables** subject to **constraints** which ensures that all the elements have a linear relationship and all variables are non-negative.\n\n## :triangular_ruler: Radar positioning model\n\nFor this problem, we want to maximize the number of demands met and with better signal quality. The meaning of the variables and parameters is as follows:\n\n- $xj$ → Radar j in the position j\n- $yi$ → Demand i\n- $zij$ → It says whether the demand i has been me by the radar j\n- $Aij$ → It says the signal quality of the radar j fot the demand i\n\n- $m$ → Number of demands\n- $n$ → Number of locations where the radars may be positioned\n- $p$ → Max number of radars\n\n\u003cdiv align=\"center\"\u003e\n\n$$\\qquad\\qquad\\\\\u003e \\ \\text{Max} \\quad \\sum_{i=1}^{m}y_i \\ + \\\\sum_{i=1}^{m}\\sum_{j=1}^{n}A_{ij}z_{ij}$$\n\n$$\\text{Subject to} \\ \\sum_{j=1}^{n}z_{ij} \\ = \\ y_{i} \\ \\forall i$$\n\n$$\\qquad\\\\\u003e\\\\\u003e\\\\\u003e\\sum_{j=1}^{m}x_{j} \\ = \\ p$$\n\n$$\\qquad\\qquad\\qquad\\qquad\\quad \\ x_j\\ge z_{ij} \\quad \\forall{i} \\forall{j} \\ \\text{and} \\ A_{ij} \\ \\neq \\ 0$$\n\n$$\\qquad\\qquad\\quad\\\\\u003ex_j,y_i,z_{ij} \\ \\in \\ [0,1]$$\n\n\u003c/div\u003e\n\nEach row of the model above is explained as follows:\n\n1. Objective function that aims to maximize the sum of demands met and the signal quality on demand.\n2. Number of demands met must be equals to number of demands.\n3. Number of radars in position j must be equals to the max number of radars available.\n4. Number of radars in position j must be grater or equals to the demands met by this radar in the position j.\n5. All radars, demand and demand met must be 0 or 1.\n\n## :book: Resources and technologies :computer:\n\n- [Gurobi](https://www.gurobi.com/documentation/9.0/quickstart_mac/py_python_interface.html) - mathematical optimization solver\n- [Python](https://www.python.org/) - interpreted, high-level, general-purpose programming language\n- [PyOpenGL](http://pyopengl.sourceforge.net/) - rendering library to run OpenGL API using Python\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florransutter%2Fradar-positioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florransutter%2Fradar-positioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florransutter%2Fradar-positioning/lists"}