-
Notifications
You must be signed in to change notification settings - Fork 1
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
Extend the ZhangUnorderedTreeEditDistance to Return the Optimal Node Mapping #33
Conversation
The fields forestDistances and treeDistances are both a HashMap. A HashMap is initially empty we don't need to fill it with "-1" values to represent a empty HashMap.
Kudos, SonarCloud Quality Gate passed! |
* This reduces the cognitive complexity of minCostMaxFlow method to be below a suggested threshold of 15
* this abstract method is already defined in the interface NodeMapping that the class AbstractNodeMapping implements
…odon.mamut.treesimilarity.util
* Make the reason for the Runtime exception that may occur in this method more explicit and suggest the solution for it.
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.
This PR nicely adds node-mapping between two given trees based on the Zhang unordered edit distance, which is a highly useful feature.
There are some open questions - cf. below. Most important question relates to the number of mappings that created in a specific test case which does not relate to the number of nodes contained in the given trees.
I created a PR that contains suggestions how to improved this PR.
- It moves all existing util classes for ZhangUnordered to separate package and makes required methods public
- It contains some javadoc improvements.
- It contains suggestions regarding the code smells detected by sonarcloud: https://sonarcloud.io/project/issues?id=mastodon-sc_mastodon-deep-lineage&pullRequest=33&resolved=false&types=CODE_SMELL
src/main/java/org/mastodon/mamut/treesimilarity/NodeMappings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/mastodon/mamut/treesimilarity/NodeMappings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/mastodon/mamut/treesimilarity/NodeMappings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/mastodon/mamut/treesimilarity/NodeMappings.java
Outdated
Show resolved
Hide resolved
src/test/java/org/mastodon/mamut/treesimilarity/NodeMappingTest.java
Outdated
Show resolved
Hide resolved
I just see that I created a PR with suggestions, mentioned it, but did not explicitly link it. Thus, you may not have seen it: |
Compute node mapping review
Kudos, SonarCloud Quality Gate passed! 0 Bugs 98.0% Coverage The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
The zhang unordered tree edit distance is always associated with a respective mapping between the nodes of the two trees. This PR extends the ZhangUnorderedTreeEditDistance class to also return the optimal node mapping.
This PR is required for mastodon-sc/mastodon-tomancak#26