{"id":26214584,"url":"https://github.com/muhammadsaadx/vertexorderingoptimization","last_synced_at":"2025-09-21T07:06:48.336Z","repository":{"id":246480316,"uuid":"821258208","full_name":"muhammadsaadx/VertexOrderingOptimization","owner":"muhammadsaadx","description":"This project implements search algorithms (BFS, DFS, UCS, and Greedy) to find the optimal ordering of vertices in a network, minimizing the total cost. It reads data files with vertices and associated costs, calculates the cost of different orderings, and outputs the optimal ordering and its cost.","archived":false,"fork":false,"pushed_at":"2024-06-28T06:50:42.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T07:31:43.740Z","etag":null,"topics":["bfs","dfs","greedy","jupternotebook","pyhon","ucs"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadsaadx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-28T06:37:55.000Z","updated_at":"2024-06-28T06:50:45.000Z","dependencies_parsed_at":"2024-06-28T08:09:43.600Z","dependency_job_id":null,"html_url":"https://github.com/muhammadsaadx/VertexOrderingOptimization","commit_stats":null,"previous_names":["muhammadsaadhasan/vertexorderingoptimization","muhammadsaadhsn/vertexorderingoptimization","muhammadsaadx/vertexorderingoptimization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadx%2FVertexOrderingOptimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadx%2FVertexOrderingOptimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadx%2FVertexOrderingOptimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadx%2FVertexOrderingOptimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadsaadx","download_url":"https://codeload.github.com/muhammadsaadx/VertexOrderingOptimization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196646,"owners_count":20251861,"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","dfs","greedy","jupternotebook","pyhon","ucs"],"created_at":"2025-03-12T10:17:50.628Z","updated_at":"2025-09-21T07:06:43.313Z","avatar_url":"https://github.com/muhammadsaadx.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vertex Ordering Optimization\n\nThis repository contains the implementation of various search algorithms (BFS, DFS, UCS, and Greedy) to find the optimal ordering of vertices in a network, minimizing the total cost of the network. This project is inspired by the optimization problem commonly found in Bayesian Network Learning.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Data Format](#data-format)\n- [Usage](#usage)\n- [Algorithms](#algorithms)\n- [Example](#example)\n- [License](#license)\n\n## Introduction\n\nThe goal of this project is to determine a vertex ordering with the minimum cost given a set of vertices and their possible parent sets with associated costs. The problem can be simplified as finding a vertex ordering that minimizes the total cost of the network.\n\n## Data Format\n\nThe input data is provided in text files where each line represents a vertex, its parent set, and the associated cost. The format of each line is as follows:\n```\nvertex, {parent_set}, cost\n```\n\nExample:\n```\n1,{},153.466\n1,{3},96.093\n1,{4},97.913\n1,{5},99.835\n2,{},141.023\n...\n```\n\n## Usage\n\nTo run the search algorithms on the provided datasets, execute the following command:\n```\npython VertexOrderingOptimization.py\n```\n\n## Algorithms\n\n### Breadth-First Search (BFS)\nBFS explores all possible orderings level by level and finds the minimum cost ordering by visiting each vertex exactly once.\n\n### Depth-First Search (DFS)\nDFS explores each possible ordering path to its depth, backtracking when a complete ordering is found, and finds the minimum cost ordering.\n\n### Uniform Cost Search (UCS)\nUCS explores the search space similar to BFS but prioritizes paths with lower costs using a priority queue.\n\n### Greedy Search\nGreedy search selects the next vertex that leads to the lowest cost incrementally until all vertices are ordered.\n\n## Example\n\nConsider the ordering (5, 3, 1, 4, 2). With respect to vertex 1, the parent set {4} is not consistent with the ordering. The parent sets {}, {3}, and {5} are consistent with the ordering. The ordering (5, 3, 1, 4, 2) has a total cost of 465.435.\n\n### Running the Example\n\n1. Place your data files (e.g., `data0.txt`, `data1.txt`, `data2.txt`) in the project directory.\n2. Execute the script to process the files and find the optimal ordering:\n   ```\n   python main.py\n   ```\n3. The script will output the orderings and their costs for each dataset.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request with your improvements.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadsaadx%2Fvertexorderingoptimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadsaadx%2Fvertexorderingoptimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadsaadx%2Fvertexorderingoptimization/lists"}