{"id":23534978,"url":"https://github.com/tommaso-dognini/polimi_gpu101_courseproject","last_synced_at":"2026-04-10T16:41:26.014Z","repository":{"id":269212889,"uuid":"906741039","full_name":"tommaso-dognini/Polimi_gpu101_CourseProject","owner":"tommaso-dognini","description":"Polimi Passion In Action GPU101 course project. Implementation in CUDA of BFS algorithm","archived":false,"fork":false,"pushed_at":"2024-12-22T18:23:55.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T06:13:07.426Z","etag":null,"topics":["cpp","cuda","cuda-programming","parallel-computing"],"latest_commit_sha":null,"homepage":"","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/tommaso-dognini.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":"2024-12-21T19:07:19.000Z","updated_at":"2025-01-06T20:22:08.000Z","dependencies_parsed_at":"2024-12-21T20:22:25.994Z","dependency_job_id":"c64cf713-c641-47fa-8646-84c3413b8569","html_url":"https://github.com/tommaso-dognini/Polimi_gpu101_CourseProject","commit_stats":null,"previous_names":["tommaso-dognini/polimi_gpu101_courseproject"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommaso-dognini%2FPolimi_gpu101_CourseProject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommaso-dognini%2FPolimi_gpu101_CourseProject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommaso-dognini%2FPolimi_gpu101_CourseProject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommaso-dognini%2FPolimi_gpu101_CourseProject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommaso-dognini","download_url":"https://codeload.github.com/tommaso-dognini/Polimi_gpu101_CourseProject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239242112,"owners_count":19605954,"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","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","cuda","cuda-programming","parallel-computing"],"created_at":"2024-12-26T01:14:06.756Z","updated_at":"2025-11-01T00:30:27.453Z","avatar_url":"https://github.com/tommaso-dognini.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polimi Passion In Action GPU101 course Project\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://skillicons.dev\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=git,cpp,cmake,python\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/cuda-000000.svg?style=for-the-badge\u0026logo=nVIDIA\u0026logoColor=green\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[Polimi website](https://www.polimi.it/formazione/passion-in-action/dettaglio/gpu-101-2)\n\n### Assignment:\nGiven the sequential C++ version of the well-known BFS algorithm, develop a parallelized solution using CUDA.\n\n---\n# BFS algorithm\n### What is BFS and How It Works\n\nBreadth-First Search (BFS) is a graph traversal algorithm that explores all vertices of a graph level by level, starting from a given source node. It uses a queue data structure to keep track of the nodes to be explored and ensures that nodes closer to the source are visited before those farther away.\n\n#### Steps of the BFS Algorithm:\n1. Start at the source node and mark it as visited.\n2. Add the source node to a queue.\n3. While the queue is not empty:\n   - Dequeue the front node from the queue.\n   - Explore all its adjacent unvisited nodes:\n     - Mark them as visited.\n     - Enqueue them for further exploration.\n\n---\n\n### Example: BFS on a Graph Represented by an Adjacency Matrix\n\nConsider the following graph, represented as an adjacency matrix:\n\n|     | 0 | 1 | 2 | 3 | 4 | 5 |\n|-----|---|---|---|---|---|---|\n| **0** | 0 | 1 | 0 | 1 | 0 | 0 |\n| **1** | 1 | 0 | 1 | 0 | 0 | 0 |\n| **2** | 0 | 1 | 0 | 0 | 0 | 1 |\n| **3** | 1 | 0 | 0 | 0 | 1 | 0 |\n| **4** | 0 | 0 | 0 | 1 | 0 | 1 |\n| **5** | 0 | 0 | 1 | 0 | 1 | 0 |\n\n---\n\n### Running BFS Starting from Node 0\n\nSteps of the algorithm:\n\n| Iteration | Queue      | Visited Nodes       |\n|-----------|------------|---------------------|\n| 1         | [0]        | {0}                |\n| 2         | [1, 3]     | {0, 1, 3}          |\n| 3         | [3, 2]     | {0, 1, 2, 3}       |\n| 4         | [2, 4]     | {0, 1, 2, 3, 4}    |\n| 5         | [4, 5]     | {0, 1, 2, 3, 4, 5} |\n| 6         | []         | {0, 1, 2, 3, 4, 5} |\n\nThe BFS traversal order is: **0 → 1 → 3 → 2 → 4 → 5**\n\n---\n\n### BFS Animation\n\nBelow is the BFS animation, illustrating the algorithm's step-by-step traversal:\n\n![BFS Animation](bfs_animation.gif)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommaso-dognini%2Fpolimi_gpu101_courseproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommaso-dognini%2Fpolimi_gpu101_courseproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommaso-dognini%2Fpolimi_gpu101_courseproject/lists"}