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

#415 disjoint sets impl #421

Merged
merged 3 commits into from
Mar 21, 2020
Merged

#415 disjoint sets impl #421

merged 3 commits into from
Mar 21, 2020

Conversation

HDouss
Copy link
Contributor

@HDouss HDouss commented Mar 10, 2020

Resolving #415
Graph disjoint sets implementation.

@HDouss
Copy link
Contributor Author

HDouss commented Mar 10, 2020

@0crat status

@0crat
Copy link
Collaborator

0crat commented Mar 10, 2020

@0crat status (here)

@HDouss This is what I know about this job in C7JGJ00DP, as in §32:

  • The job #421 is in scope for 2hr
  • The role is REV
  • The job is not assigned to anyone
  • The budget is not set yet
  • These users are banned and won't be assigned:
  • Job footprint (restricted area)

@0crat
Copy link
Collaborator

0crat commented Mar 10, 2020

@paulodamaso/z everybody who has role REV is banned at #421; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@paulodamaso
Copy link
Collaborator

@0crat assign @fanifieiev

@0crat
Copy link
Collaborator

0crat commented Mar 11, 2020

@0crat assign @fanifieiev (here)

@paulodamaso This pull request #421 is assigned to @fanifieiev/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @paulodamaso/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

@0crat
Copy link
Collaborator

0crat commented Mar 16, 2020

@fanifieiev/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HDouss Please take a look at my comments

final List<Set<Node>> result = new ArrayList<>(unvisited.size());
while (!unvisited.isEmpty()) {
final Node node = unvisited.iterator().next();
final Set<Node> adding = new HashSet<>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HDouss Honestly adding variable is very confusing here, hard to catch what it is for.
Could you please rename so that others can easily understand?

throw new UnsupportedOperationException(this.graph.toString());
final Set<Node> unvisited = new HashSet<>(this.graph.nodes());
final List<Set<Node>> result = new ArrayList<>(unvisited.size());
while (!unvisited.isEmpty()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HDouss Sorry, I could catch the whole algorithm, but is it possible to use iterator.hasNext() for the unvisited?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fanifieiev it is not really possible, unless to get a new iterator from the set in each iteration. This set is getting shrinked (by more than one element) in each iteration. Even the element at which the iterator is pointing is being removed from the set.

@@ -38,7 +37,6 @@
public final class DisjointTest {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HDouss Could you please add one more test where the nodes in the graph are not connected at all?

@HDouss
Copy link
Contributor Author

HDouss commented Mar 19, 2020

@fanifieiev Fixed. Please review again.

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulodamaso Please merge

@HDouss
Copy link
Contributor Author

HDouss commented Mar 19, 2020

@paulodamaso ping

@paulodamaso
Copy link
Collaborator

@HDouss @fanifieiev Thank you guys

@paulodamaso
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Mar 21, 2020

@rultor merge

@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit aea16e7 into cqfn:master Mar 21, 2020
@rultor
Copy link
Collaborator

rultor commented Mar 21, 2020

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 17min)

@0crat
Copy link
Collaborator

0crat commented Mar 21, 2020

@sereshqua/z please review this job completed by @fanifieiev/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat
Copy link
Collaborator

0crat commented Mar 21, 2020

Code review was too long (9 days), architects (@paulodamaso) were penalized, see §55

@0crat 0crat removed the scope label Mar 21, 2020
@sereshqua
Copy link

@0crat quality good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants