Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Issue 784001: AU: Cycle Breaker for directed graphs. (Closed)

Created:
10 years, 9 months ago by adlr
Modified:
9 years ago
Reviewers:
Daniel Erat
CC:
chromium-os-reviews_googlegroups.com
Visibility:
Public.

Description

AU: Cycle Breaker for directed graphs. A new class CycleBreaker that uses Johnson's elementary circuit finding algorithm to find cycles in a directed graph. This class goes beyond Johnson's algorithm to also break them using a simple greedy algorithm. Like Johnson's elementary circuit finding algorithm, this is not intended to find cycles that contain only one node (i.e., a node that points to itself).

Patch Set 1 #

Total comments: 8

Patch Set 2 : fixes for review #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -0 lines) Patch
M src/platform/update_engine/SConstruct View 2 chunks +2 lines, -0 lines 0 comments Download
A src/platform/update_engine/cycle_breaker.h View 1 1 chunk +50 lines, -0 lines 2 comments Download
A src/platform/update_engine/cycle_breaker.cc View 1 1 chunk +143 lines, -0 lines 2 comments Download
A src/platform/update_engine/cycle_breaker_unittest.cc View 1 1 chunk +130 lines, -0 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
adlr
10 years, 9 months ago (2010-03-10 00:06:05 UTC) #1
Daniel Erat
I'll try to find some time soon to read/understand the algorithm so I can double-check ...
10 years, 9 months ago (2010-03-10 01:15:44 UTC) #2
adlr
ready for another look, thanks. http://codereview.chromium.org/784001/diff/1/3 File src/platform/update_engine/cycle_breaker.cc (right): http://codereview.chromium.org/784001/diff/1/3#newcode19 src/platform/update_engine/cycle_breaker.cc:19: // Make a copy, ...
10 years, 9 months ago (2010-03-10 19:06:05 UTC) #3
Daniel Erat
LGTM You were right about that paper -- I gave up on interpreting the pseudocode. ...
10 years, 9 months ago (2010-03-10 22:50:01 UTC) #4
adlr
10 years, 9 months ago (2010-03-11 00:41:42 UTC) #5
fixed and submitted. thanks!

http://codereview.chromium.org/784001/diff/6001/7002
File src/platform/update_engine/cycle_breaker.cc (right):

http://codereview.chromium.org/784001/diff/6001/7002#newcode71
src/platform/update_engine/cycle_breaker.cc:71: out_cut_edges->swap(cut_edges_);
On 2010/03/10 22:50:01, Daniel Erat wrote:
> nit: DCHECK(stack_.empty()) here?

Done.

http://codereview.chromium.org/784001/diff/6001/7003
File src/platform/update_engine/cycle_breaker.h (right):

http://codereview.chromium.org/784001/diff/6001/7003#newcode8
src/platform/update_engine/cycle_breaker.h:8: // This is a modified
implemenation of Donald B. Johnson's algorithm for
On 2010/03/10 22:50:01, Daniel Erat wrote:
> s/implemenation/implementation/

Done.

http://codereview.chromium.org/784001/diff/6001/7004
File src/platform/update_engine/cycle_breaker_unittest.cc (right):

http://codereview.chromium.org/784001/diff/6001/7004#newcode69
src/platform/update_engine/cycle_breaker_unittest.cc:69:
utils::SetContainsKey(broken_edges, make_pair(n_h, n_g)));
On 2010/03/10 22:50:01, Daniel Erat wrote:
> also check that there are exactly three edges in the set?

Done.

Powered by Google App Engine
This is Rietveld 408576698