-
-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Create Fleury's_Algorithm.py #3594
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
Create Fleury's_Algorithm.py #3594
Conversation
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: e7cb9d20-12df-11eb-8230-47bfa5f272e1 |
|
@TravisBuddy what is the log. is there any link? |
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: 602940f0-12e1-11eb-8230-47bfa5f272e1 |
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: 18684e90-12e2-11eb-8230-47bfa5f272e1 |
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: 69358250-12e4-11eb-8230-47bfa5f272e1 |
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: 2259bfd0-12e5-11eb-8230-47bfa5f272e1 |
|
@cclauss could you please help me.what is the error.I am new to this kind of issues. |
Travis tests have failedHey @DasithEdirisinghe, TravisBuddy Request Identifier: c7ae79c0-12f5-11eb-8230-47bfa5f272e1 |
|
@cclauss I cant find the issue as the code is locally working properly.What is the issue.could you please help me? |
cclauss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All functions need doctests, type hints on function parameters and return vaules, real variable names.
graphs/fleurys_algorithm.py
Outdated
| self.v = vertices | ||
| self.graph = defaultdict(list) | ||
|
|
||
| def addEdge(self, u, v): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def addEdge(self, u, v): | |
| def add_edge(self, universal: int, victorious: float) -> list[int]: |
Don't force your reader to guess. Type hints are required in this repo so the caller knows what datatypes the functions expect and what datatype they return.
Single -letter variable names for function parameters is the way that programs were written in the 1950's and 60's. In modern times, we no longer force users to guess what variables mean. Instead, we give them self-documenting names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay thank you
graphs/fleurys_algorithm.py
Outdated
|
|
||
| self.addEdge(u, v) | ||
|
|
||
| return False if count1 > count2 else True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return False if count1 > count2 else True | |
| return count1 <= count2 |
|
Remember to add the hacktoberfest tag in your fork repo. |
How to add that tag.could you please help me |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@algorithms-keeper review |
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will only modify the labels accordingly.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| self.v = vertices | ||
| self.graph = defaultdict(list) | ||
|
|
||
| def add_edge(self, u, v) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide doctest for the function: add_edge
| self.graph[u].append(v) | ||
| self.graph[v].append(u) | ||
|
|
||
| def remove_edge(self, u, v) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide doctest for the function: remove_edge
| if key == u: | ||
| self.graph[v].pop(index) | ||
|
|
||
| def depth_first_search_count(self, v, visited) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide doctest for the function: depth_first_search_count
| count = count + self.dfs_count(i, visited) | ||
| return count | ||
|
|
||
| def is_valid_next_edge(self, u, v) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide doctest for the function: is_valid_next_edge
|
|
||
| return count1 <= count2 | ||
|
|
||
| def print_euler_util(self, u) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide doctest for the function: print_euler_util
| self.graph[u].append(v) | ||
| self.graph[v].append(u) | ||
|
|
||
| def remove_edge(self, u, v) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the argument: v
| if key == u: | ||
| self.graph[v].pop(index) | ||
|
|
||
| def depth_first_search_count(self, v, visited) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the argument: v
| count = count + self.dfs_count(i, visited) | ||
| return count | ||
|
|
||
| def is_valid_next_edge(self, u, v) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the argument: u
| count = count + self.dfs_count(i, visited) | ||
| return count | ||
|
|
||
| def is_valid_next_edge(self, u, v) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the argument: v
|
|
||
| return count1 <= count2 | ||
|
|
||
| def print_euler_util(self, u) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the argument: u
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions! |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.