{"id":20048461,"url":"https://github.com/aggstam/topology_shorting","last_synced_at":"2026-06-11T10:31:18.055Z","repository":{"id":155101800,"uuid":"424254961","full_name":"aggstam/topology_shorting","owner":"aggstam","description":"This program implements a Topology sorting algorithm, based on Kahn's algorithm.","archived":false,"fork":false,"pushed_at":"2023-05-16T15:31:49.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T08:24:19.560Z","etag":null,"topics":["c","graph-algorithms","topological-sort"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aggstam.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":"2021-11-03T14:23:23.000Z","updated_at":"2022-11-05T12:57:32.000Z","dependencies_parsed_at":"2025-01-12T20:33:21.649Z","dependency_job_id":"9ccd7bb5-d749-4481-a411-6df7e0aeda25","html_url":"https://github.com/aggstam/topology_shorting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aggstam/topology_shorting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftopology_shorting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftopology_shorting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftopology_shorting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftopology_shorting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aggstam","download_url":"https://codeload.github.com/aggstam/topology_shorting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftopology_shorting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34195112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["c","graph-algorithms","topological-sort"],"created_at":"2024-11-13T11:44:12.499Z","updated_at":"2026-06-11T10:31:18.050Z","avatar_url":"https://github.com/aggstam.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# topology_shorting\nThis program implements a Topology sorting algorithm, based on Kahn's algorithm [1].\n\u003cbr\u003e\nTwo implementations are included, one executing the algorithm in serial, and one using POSIX Threads.\n\u003cbr\u003e\nDirected Acyclic Graph(DAG) is read from an input file created by RandomGraph generator by S.Pettie and V.Ramachandran [2], using the following arguments:\n\u003cbr\u003e\n./RandomGraph directed_grph_\u003cN\u003e \u003cN\u003e 2 1 \u003cN/2\u003e\n\u003cbr\u003e\nwhere N is the Graph nodes count we want to generate.\n\n## Usage\nBoth version can be invocted via the Makefile, or by directly compiling and executing.\n\n### Make usage\n#### Normal code\n```shell\n$ make\n```\nTo include a different input file:\n```shell\n$ make FILE={file_path}\n```\nTo configure a different output file:\n```shell\n$ make OUTPUT={file_path}\n```\n\n#### Parallel code\n```shell\n$ make parallel\n```\nTo configure different how many threads to use:\n```shell\n$ make parallel THREADS={threads_count}\n```\nTo include a different input file:\n```shell\n$ make parallel FILE={file_path}\n```\nTo configure a different output file:\n```shell\n$ make parallel OUTPUT={file_path}\n```\n\n### Direct usage\n#### Normal code\nCompilation:\n```shell\n$ gcc -o topology_shorting topology_shorting.c\n```\nExecution:\n```shell\n$ ./topology_shorting {input_file} {output_file}\n```\n\n#### Parallel code\nCompilation:\n```shell\n$ gcc -o topology_shorting_parallel topology_shorting_parallel.c\n```\nExecution:\n```shell\n$ ./topology_shorting_parallel {threads_count} {input_file} {output_file}\n```\n\n## Execution examples\n### Normal code\n```shell\n$ make\nExecuting normal code...\ngcc -o topology_shorting topology_shorting.c\n./topology_shorting test_file output\nCalculating Topology sorting of Graph.\nGraph will be retrieved from input file: test_file\nTopology Matrix will be written in output file: output\nNodes count: 100\nAlgorithm started, please wait...\nAlgorithm finished!\nTime spend: 0.000043 secs\nWriting Topology Matrix to output file.\nProgram terminates.\n```\n\n### Parallel code\n```shell\n$ make parallel\nExecuting parallel code...\ngcc -o topology_shorting_parallel topology_shorting_parallel.c\n./topology_shorting_parallel 4 test_file output\nCalculating Topology sorting of Graph.\nThreads that will be used: 4\nGraph will be retrieved from input file: test_file\nTopology Matrix will be written in output file: output\nNodes count: 100\nAlgorithm started, please wait...\nAlgorithm finished!\nTime spend: 0.001094 secs\nWriting Topology Matrix to output file.\nProgram terminates.\n```\n\n## References\n[1] https://en.wikipedia.org/wiki/Topological_sorting\n\u003cbr\u003e\n[2] http://www.dis.uniroma1.it/challenge9/code/Randgraph.tar.gz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Ftopology_shorting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faggstam%2Ftopology_shorting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Ftopology_shorting/lists"}