graph/topo: add transitive reduction for DAGs#2070
Conversation
b48bfbc to
27a7220
Compare
27a7220 to
2ecabdb
Compare
|
“CI failed in stat/...: TestImportance (covariance matrix mismatch). I can’t reproduce locally; rerunning CI.” |
|
Hi @kortschak, |
Co-authored-by: Dan Kortschak <[email protected]>
391dda7 to
516e30e
Compare
|
Hi @kortschak, |
Co-authored-by: Dan Kortschak <[email protected]>
1378570 to
598379f
Compare
Co-authored-by: Dan Kortschak <[email protected]>
kortschak
left a comment
There was a problem hiding this comment.
Minor issue only, then LGTM.
| }, | ||
| check: func(t *testing.T, before, after graph.Directed) { | ||
| if after.HasEdgeFromTo(1, 4) { | ||
| t.Fatalf("expected redundant edge 1->4 to be removed") |
There was a problem hiding this comment.
| t.Fatalf("expected redundant edge 1->4 to be removed") | |
| t.Errorf("expected redundant edge 1->4 to be removed") |
Also for the check functions below. This is explained in https://go.dev/wiki/TestComments#keep-going.
| t.Fatalf("expected redundant edge 0->2 to be removed") | ||
| } | ||
| if !after.HasEdgeFromTo(10, 11) { | ||
| t.Fatalf("expected edge 10->11 to remain") |
There was a problem hiding this comment.
| t.Fatalf("expected redundant edge 0->2 to be removed") | |
| } | |
| if !after.HasEdgeFromTo(10, 11) { | |
| t.Fatalf("expected edge 10->11 to remain") | |
| t.Errorf("expected redundant edge 0->2 to be removed") | |
| } | |
| if !after.HasEdgeFromTo(10, 11) { | |
| t.Errorf("expected edge 10->11 to remain") |
(these are why)
This PR implements transitive reduction for directed acyclic graphs (#1978).
Implementation notes
Result
Fixes #1978