{"id":31538406,"url":"https://github.com/abdulrehman-baloch/parallel-ist-bubble-sort_network","last_synced_at":"2025-10-04T08:20:14.877Z","repository":{"id":291819370,"uuid":"969294238","full_name":"Abdulrehman-Baloch/Parallel-IST-Bubble-Sort_Network","owner":"Abdulrehman-Baloch","description":"This project implements a novel parallel algorithm for constructing n-1 independent spanning trees (ISTs) in bubble-sort networks. It solves an open problem from previous research by Kao et al. by enabling each vertex to determine its parent in constant time without using recursion.","archived":false,"fork":false,"pushed_at":"2025-05-16T05:24:30.000Z","size":1465,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T22:32:53.160Z","etag":null,"topics":["cpp","openmp-parallelization","openmpi","threads"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Abdulrehman-Baloch.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":"2025-04-19T20:26:39.000Z","updated_at":"2025-05-27T19:04:59.000Z","dependencies_parsed_at":"2025-05-06T18:23:33.444Z","dependency_job_id":"0a0b45cd-c796-41b3-9b14-5c126306f5cd","html_url":"https://github.com/Abdulrehman-Baloch/Parallel-IST-Bubble-Sort_Network","commit_stats":null,"previous_names":["abdulrehman-baloch/pdc-project","abdulrehman-baloch/parallel-ist-bubble-sort_network"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abdulrehman-Baloch/Parallel-IST-Bubble-Sort_Network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrehman-Baloch%2FParallel-IST-Bubble-Sort_Network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrehman-Baloch%2FParallel-IST-Bubble-Sort_Network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrehman-Baloch%2FParallel-IST-Bubble-Sort_Network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrehman-Baloch%2FParallel-IST-Bubble-Sort_Network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abdulrehman-Baloch","download_url":"https://codeload.github.com/Abdulrehman-Baloch/Parallel-IST-Bubble-Sort_Network/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrehman-Baloch%2FParallel-IST-Bubble-Sort_Network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278284044,"owners_count":25961422,"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-10-04T02:00:05.491Z","response_time":63,"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":["cpp","openmp-parallelization","openmpi","threads"],"created_at":"2025-10-04T08:20:09.550Z","updated_at":"2025-10-04T08:20:14.862Z","avatar_url":"https://github.com/Abdulrehman-Baloch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IST-BubbleSort-Parallel\n\n**A Parallel Algorithm for Constructing Multiple Independent Spanning Trees in Bubble-Sort Networks**\n\n## Overview\n\nThis project implements a novel **parallel algorithm** for constructing **n-1 independent spanning trees (ISTs)** in bubble-sort networks. It solves an open problem from previous research by Kao et al. by enabling each vertex to determine its parent in **constant time** without using recursion.\n\nOur implementation uses a **hybrid parallel approach**:\n- **MPI** for distributed computing across multiple nodes\n- **OpenMP** for thread-level parallelism within each node\n\n---\n\n## Background\n\n**Bubble-sort networks** are a class of interconnection networks represented as graphs where:\n- **Vertices** are permutations of numbers (e.g., `1234`, `4231`)\n- **Edges** connect permutations that differ by one adjacent swap\n\n**Independent spanning trees** have significant applications in:\n- Fault-tolerant network communication\n- Secure message distribution\n- Enhancing reliability of interconnection networks\n\n---\n\n## Algorithm\n\nThe algorithm allows each vertex to independently compute its parent in each spanning tree using a set of rules based on:\n- The vertex's permutation representation\n- The last digits of the permutation\n- The tree index being constructed\n\n### Key Features\n- **Non-recursive approach**\n- **Constant-time** parent determination per vertex\n- **Optimal total time complexity**: `O(n · n!)`\n- **Tree height**: at most `D(Bn) + n - 1`\n\n---\n\n## Implementation\n\nImplemented in **C++** using:\n- **MPI** (e.g., MPICH or OpenMPI) for distributed memory parallelism\n- **OpenMP** for shared memory parallelism\n\n### Key Components\n- **Permutation Class**: Represents vertices in the bubble-sort network and supports permutation operations\n- **Parent Finding Algorithm**: Implements Algorithm 1 from the reference paper\n- **Hybrid Parallelism**:\n  - MPI distributes permutations across processes\n  - OpenMP computes parents in parallel within each process\n- **Result Collection**: Master process gathers and formats all outputs\n\n---\n\n## Prerequisites\n\n- C++ compiler with OpenMP support\n- MPI library (MPICH or OpenMPI)\n- CMake (for build system)\n\n---\n\n## Building\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n---\n\n## Running\n\n```bash\nmpirun -np \u003cnum_processes\u003e ./ist_bubble_sort -n \u003cdimension\u003e\n```\n\n- `\u003cnum_processes\u003e`: Number of MPI processes\n- `\u003cdimension\u003e`: Dimension of the bubble-sort network (n)\n\n---\n\n## Performance\n\n- Efficient scaling with constant-time parent determination per vertex\n- Distributed workload for large-scale computation\n- OpenMP-based parallel processing within each MPI process\n\n**Note:** For large networks (n ≥ 7), distributed computing is crucial due to factorial growth (`n!`) in vertex count.\n\n---\n\n## Output Files\n\nFor `n \u003c 10`, the program generates the following files:\n- `bubble_sort_ist_table_n\u003cdimension\u003e.txt`: Table of parents for each vertex in each tree\n- `bubble_sort_ist_vertices_n\u003cdimension\u003e.txt`: Mapping of vertices to MPI processes\n- `bubble_sort_ist_log_n\u003cdimension\u003e.txt`: Performance statistics\n\n---\n\n## Implementation Details\n\n### Parallel Workflow\n\n#### Permutation Distribution\n- Each MPI process receives roughly `n!/p` permutations\n- Ensures balanced workload distribution\n\n#### OpenMP Parallelization\n- Parent computations run in parallel within MPI processes\n- Uses thread-local storage to reduce contention\n\n#### Result Collection\n- Results sent from all processes to the master\n- Master combines and formats outputs\n\n### Key Optimizations\n- Thread-local intermediate results (no synchronization)\n- Dynamic scheduling for thread load balancing\n- Efficient, non-recursive permutation processing\n- Minimized MPI communication overhead\n\n---\n\n## Contributors\n\n- **Sana Mir**\n- **Ayesha Kiani**\n- **Abdulrehman**\n\n---\n\n## Citation\n\nThis work is based on the paper:\n\n\u003e Kao, Shih-Shun, et al.  \n\u003e \"A parallel algorithm for constructing multiple independent spanning trees in bubble-sort networks.\"  \n\u003e *Journal of Parallel and Distributed Computing*, vol. 117, 2023, pp. 139–145.\n\n```bibtex\n@article{kao2023parallel,\n  title={A parallel algorithm for constructing multiple independent spanning trees in bubble-sort networks},\n  author={Kao, Shih-Shun and Klasing, Ralf and Hung, Ling-Ju and Lee, Chia-Wei and Hsieh, Sun-Yuan},\n  journal={Journal of Parallel and Distributed Computing},\n  volume={117},\n  pages={139--145},\n  year={2023}\n}\n```\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrehman-baloch%2Fparallel-ist-bubble-sort_network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulrehman-baloch%2Fparallel-ist-bubble-sort_network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrehman-baloch%2Fparallel-ist-bubble-sort_network/lists"}