{"id":22080483,"url":"https://github.com/sreecharanv/prolog-based-graph-traversal-bfs-implementation","last_synced_at":"2026-01-05T01:49:43.291Z","repository":{"id":242171919,"uuid":"808882603","full_name":"SreecharanV/Prolog-Based-Graph-Traversal-BFS-Implementation","owner":"SreecharanV","description":"An implementation of graph traversal algorithms in Prolog, focusing on breadth-first search (BFS). The project finds the shortest path between nodes in a graph, covering both directed and undirected graphs with extensive test cases.","archived":false,"fork":false,"pushed_at":"2024-06-01T04:13:46.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T04:24:14.335Z","etag":null,"topics":["bfs-algorithm","bfs-search","graphtraversal","prolog","prolog-programming-language"],"latest_commit_sha":null,"homepage":"","language":"Prolog","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/SreecharanV.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-06-01T04:08:52.000Z","updated_at":"2024-06-01T04:14:34.000Z","dependencies_parsed_at":"2024-06-01T04:41:22.597Z","dependency_job_id":"b975f7b3-e0ba-4c3c-b4ac-1d561fa4b807","html_url":"https://github.com/SreecharanV/Prolog-Based-Graph-Traversal-BFS-Implementation","commit_stats":null,"previous_names":["sreecharanv/prolog-based-graph-traversal-bfs-implementation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SreecharanV%2FProlog-Based-Graph-Traversal-BFS-Implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SreecharanV%2FProlog-Based-Graph-Traversal-BFS-Implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SreecharanV%2FProlog-Based-Graph-Traversal-BFS-Implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SreecharanV%2FProlog-Based-Graph-Traversal-BFS-Implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SreecharanV","download_url":"https://codeload.github.com/SreecharanV/Prolog-Based-Graph-Traversal-BFS-Implementation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168810,"owners_count":20571799,"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":["bfs-algorithm","bfs-search","graphtraversal","prolog","prolog-programming-language"],"created_at":"2024-11-30T23:14:47.705Z","updated_at":"2026-01-05T01:49:43.260Z","avatar_url":"https://github.com/SreecharanV.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prolog-Based Graph Traversal: BFS Implementation\n\n## Project Overview\n\nThis project implements graph traversal algorithms using Prolog, specifically focusing on breadth-first search (BFS). It allows finding the shortest path between nodes in both directed and undirected graphs.\n\n## Features\n\n- **Graph Representation**: The graph is represented using Prolog predicates to define the edges between nodes.\n- **Breadth-First Search (BFS)**: Implements BFS algorithm recursively to find the shortest path between two nodes in a given graph.\n- **Test Cases**: Includes several test cases to validate the correctness of the BFS implementation.\n\n## Process Steps\n\n1. **Graph Representation**: Define the graph using predicates for the edges between different nodes.\n2. **BFS Algorithm**: Implement the BFS algorithm to explore the graph level by level using a queue to manage the traversal.\n3. **Testing**: Run test cases to ensure the BFS implementation correctly finds the shortest paths in various graph configurations.\n\n## Key Functions\n\n- **Graph Representation**: Predicates to define edges.\n- **BFS Implementation**: Recursive BFS function to find shortest paths.\n- **Test Cases**: Predefined test cases to validate the algorithm.\n\n## Prerequisites\n\n- Ensure a Prolog interpreter is installed on your system. Common Prolog interpreters include SWI-Prolog and GNU Prolog.\n\n## Setup Instructions\n\n1. **Download or Copy Code**:\n   Download or copy the code from `main.pl`.\n\n2. **Open Terminal/Command Prompt**:\n   Open your terminal or command prompt.\n\n3. **Navigate to Directory**:\n   Use `cd` to navigate to the directory containing `main.pl`.\n\n4. **Launch Prolog Interpreter**:\n   Enter the command to launch the Prolog interpreter:\n   ```sh\n   swipl\n5. **Load the File**:\n   Once inside the Prolog interpreter, load the main.pl file using the following command:\n   ```sh\n    ?- [main].\n7. **Run the Test**:\n   After loading the file, you can run the predefined test cases by typing:\n   ```sh\n   ?- test.\n\n## Explanation\nUsing Breadth-First Search (BFS), this Prolog implementation finds the shortest path among all paths between two nodes in a graph. The graph is defined using predicates for edges, and BFS is implemented recursively, exploring nodes level by level with a queue. The project tests BFS on both directed and undirected graphs, providing correct results across various test cases, demonstrating Prolog's effectiveness and flexibility for graph traversal problems.\n\n## References\nhttps://www.swi-prolog.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsreecharanv%2Fprolog-based-graph-traversal-bfs-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsreecharanv%2Fprolog-based-graph-traversal-bfs-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsreecharanv%2Fprolog-based-graph-traversal-bfs-implementation/lists"}