-
Notifications
You must be signed in to change notification settings - Fork 117
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
Conversation
|
||
[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
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
|
||
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
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Forgot to add documentation for transitive reduction, so I've added here in this PR