Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for transitive reduction #313

Merged
merged 2 commits into from
May 29, 2023

Conversation

nrkramer
Copy link
Collaborator

Forgot to add documentation for transitive reduction, so I've added here in this PR

@nrkramer nrkramer requested a review from ZigRazor May 27, 2023 21:17
@nrkramer nrkramer self-assigned this May 27, 2023
@github-actions github-actions bot added the repo something about repo label May 27, 2023
@nrkramer nrkramer added documentation Improvements or additions to documentation Priority:Low Priority Label for low priority issue labels May 27, 2023
@ghost
Copy link

ghost commented May 27, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@github-actions github-actions bot removed the documentation Improvements or additions to documentation label May 27, 2023
@nrkramer nrkramer added the documentation Improvements or additions to documentation label May 27, 2023

[Transitive Reduction](https://en.wikipedia.org/wiki/Transitive_reduction)

This algorithm is used to construct a directed graph with the same reachability and satisfies transitive closure, with as few edges as possible. More concretely, it creates a minimum equivalent graph with as few edges as possible, removing "short-circuit" paths through the graph.

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 280

Expected: 80; Actual: 280
foreach z in graph.vertices
delete edge xz if edges xy and yz exist

Our implementation has if gates that do early checking for edges in multiple places, which gives it a slightly faster runtime than the cubic pseudocode here.

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 157

Expected: 80; Actual: 157

This algorithm is used to construct a directed graph with the same reachability and satisfies transitive closure, with as few edges as possible. More concretely, it creates a minimum equivalent graph with as few edges as possible, removing "short-circuit" paths through the graph.

This is done by iterating through each node-pair, checking to see if two edges exist that leads out of the first node OR out of the last node, removing the node-pair edge if it exists.

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 184

Expected: 80; Actual: 184
@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Merging #313 (7e16a6f) into master (a5a8acb) will decrease coverage by 0.11%.
The diff coverage is 94.05%.

@@            Coverage Diff             @@
##           master     #313      +/-   ##
==========================================
- Coverage   97.71%   97.61%   -0.11%     
==========================================
  Files          52       53       +1     
  Lines        7355     7449      +94     
==========================================
+ Hits         7187     7271      +84     
- Misses        168      178      +10     
Flag Coverage Δ
unittests 97.61% <94.05%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/Graph/Graph.hpp 96.63% <80.64%> (-0.16%) ⬇️
test/TransitiveReductionTest.cpp 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@ZigRazor ZigRazor merged commit d218e13 into ZigRazor:master May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Priority:Low Priority Label for low priority issue repo something about repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants