{"id":48590459,"url":"https://github.com/roycoding8/the-sata-problem","last_synced_at":"2026-04-08T19:03:19.848Z","repository":{"id":180765545,"uuid":"647607498","full_name":"RoyCoding8/The-SATA-Problem","owner":"RoyCoding8","description":"This repo is an implementation for the SATA problem (Satisfaction-aware task assignment) in python3","archived":false,"fork":false,"pushed_at":"2026-03-04T19:04:15.000Z","size":229,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T01:32:17.780Z","etag":null,"topics":[],"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/RoyCoding8.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-31T06:32:06.000Z","updated_at":"2026-03-04T19:04:22.000Z","dependencies_parsed_at":"2023-07-12T19:39:21.893Z","dependency_job_id":null,"html_url":"https://github.com/RoyCoding8/The-SATA-Problem","commit_stats":null,"previous_names":["roycoding8/game-theoretic-approach-to-the-sata-problem","roycoding8/the-sata-problem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RoyCoding8/The-SATA-Problem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FThe-SATA-Problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FThe-SATA-Problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FThe-SATA-Problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FThe-SATA-Problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyCoding8","download_url":"https://codeload.github.com/RoyCoding8/The-SATA-Problem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FThe-SATA-Problem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31569400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","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":[],"created_at":"2026-04-08T19:02:56.259Z","updated_at":"2026-04-08T19:03:19.842Z","avatar_url":"https://github.com/RoyCoding8.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Note: This project has been maintained as a hobby project beyond the completion of the Internship\n---\n# Satisfaction-Aware Task Assignment Problem (SATA)\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Project Structure](#project-structure)\n- [Approaches](#approaches)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Introduction\nThe Task-Worker Assignment Optimization project aims to solve the task-worker assignment problem by maximizing the overall satisfaction score. The problem involves assigning workers to tasks based on various constraints like location (spatial), skills, range, budget, and travel costs. \n\nThis repository implements two core approaches: **Conflict-Aware Greedy (CAG)** and **Game-Theoretic (GT)** algorithm with threshold stop optimization. It handles both **deterministic** scenarios (complete worker info) and **probabilistic** scenarios (incomplete worker skill info via Monte Carlo sampling).\n\n**Key Features:**\n- **Modular Codebase**: Clean structure with separate packages for algorithms, utilities, and data.\n- **Monte Carlo Simulation**: Scalable probabilistic calculation (replaces exponential brute-force).\n- **Full Nash Equilibrium**: GT algorithm supports Join, Switch, and Leave moves.\n- **Comprehensive Tests**: Extensive test suite for verification.\n- **Visualization Scripts**: Ready-to-run experiment scripts with matplotlib plotting.\n\n## Project Structure\n\n```\nGame-theoretic-approach-to-the-SATA-problem/\n├── src/                            # Core Library\n│   ├── common/                     # classes.py, distance.py, utils.py\n│   ├── algorithms/                 # greedy.py, gt.py\n│   └── probabilistic/              # monte_carlo.py\n│\n├── data/\n│   ├── generators/\n│   │   ├── gen_data.py             # Generates random task/worker data\n│   │   ├── populate_csv.py         # Writes generated data to CSVs\n│   │   ├── gen_input.py            # Loads CSVs into memory\n│   │   └── start.py                # Helper functions\n│   └── raw/                        # 9 CSV files (task_*, worker_*)\n│\n├── experiments/\n│   ├── deterministic/              # effect_of_budget.py, etc.\n│   ├── probabilistic/              # main.py, effect_of_monte_carlo.py\n│   └── run_all.py                  # Runs all experiments\n│\n├── tests/\n│   └── test_sanity.py\n└── README.md\n```\n\n\n## Approaches\n\n### 1. Conflict-Aware Greedy (CAG)\nIteratively assigns workers to tasks based on maximum satisfaction increment. Resolves conflicts when multiple tasks compete for the same worker by comparing satisfaction losses.\n\n### 2. Game-Theoretic (GT) Algorithm\nBuilds upon CAG's initial assignment. Workers proactively optimize their assignments through:\n- **Join**: Unassigned worker joins a task\n- **Switch**: Worker moves from one task to another\n- **Leave**: Worker becomes unassigned\n\nThe process continues until a **Nash Equilibrium** is reached (no worker can improve by unilaterally changing).\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/RoyCoding8/Game-theoretic-approach-to-the-SATA-problem.git\n   cd Game-theoretic-approach-to-the-SATA-problem\n   ```\n\n2. Ensure **Python 3.8+** is installed.\n\n3. Install dependencies:\n   ```bash\n   pip install pandas matplotlib\n   ```\n\n## Usage\n\n### Run Tests\n```bash\n# Quick sanity check\npython tests/test_sanity.py\n```\n\n### Run Individual Experiments\n```bash\n# Effect of budget on performance\npython experiments/deterministic/effect_of_budget.py\n\n# Effect of worker count\npython experiments/deterministic/effect_of_workers.py\n\n# Monte Carlo probabilistic experiment\npython experiments/probabilistic/effect_of_monte_carlo.py\n```\n\n### Run All Experiments\n```bash\npython experiments/run_all.py\n```\nThis generates plots saved as PNG files in the respective experiment folders.\n\n### Probabilistic Main Entry Point\n```bash\npython experiments/probabilistic/main.py\n```\nRuns 500 Monte Carlo simulations and outputs expected satisfaction scores.\n\n## Output\nEach experiment script:\n- Prints detailed results to console\n- Generates 3 matplotlib plots:\n  - Assignments vs. Variable\n  - Satisfaction Score vs. Variable\n  - Runtime vs. Variable\n- Saves plots as PNG files in the experiment folder\n\n## Custom Input Data\n\n### Option 1: Generate Random Data\n```bash\npython data/generators/populate_csv.py   # Generate random data -\u003e write CSVs\npython experiments/run_all.py             # Run experiments with that data\n```\nEdit `data/generators/gen_data.py` to change N_TASKS, N_WORKERS, BUDGET ranges, etc.\n\n### Option 2: Create Your Own CSVs\n\nPlace these 9 files in `data/raw/`:\n\n| File | Columns |\n|------|---------|\n| `task_budget.csv` | task, budget |\n| `task_location.csv` | task, latitude, longitude |\n| `task_skills.csv` | task, req_skill (one row per skill) |\n| `worker_location.csv` | worker, latitude, longitude |\n| `worker_range.csv` | worker, range (km) |\n| `worker_cost.csv` | worker, cost |\n| `worker_skills.csv` | worker, skill (one row per skill) |\n| `worker_task_history.csv` | worker, task |\n| `worker_skills_incomplete.csv` | worker, probability, skill |\n\nIDs are 1-indexed integers. Then run `python experiments/run_all.py`.\n\n### Data Pipeline\n```\ngen_data.py → populate_csv.py → data/raw/*.csv → gen_input.py → experiments/\n  (generate)     (write CSVs)                       (load)        (run)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycoding8%2Fthe-sata-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froycoding8%2Fthe-sata-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycoding8%2Fthe-sata-problem/lists"}