Opened 8 months ago

Last modified 2 months ago

#2959 reviewing defect

Issues with the bottom-up similarity calculator

Reported by: bburlacu Owned by: gkronber
Priority: medium Milestone: HeuristicLab 3.3.16
Component: Problems.DataAnalysis.Symbolic Version: trunk
Keywords: Cc:


The bottom-up tree distance was developed by G. Valiente as an efficient and more flexible alternative to the edit distance. The HL implementation SymbolicExpressionTreeBottomUpSimilarityCalculator follows in detail the algorithm described in the paper, but suffers currently from two issues:

1) The returned similarity incorrectly takes into account the ProgramRootSymbol and StartSymbol for each tree, even though these are always the same, leading to artificially inflated similarity measures

2) No option for loose matching of constants and variable weights

3) The paper suggests handling unordered trees (which is the case when we deal with commutative symbols) by sorting the list of graph nodes associated with the children of the two tree nodes being compared for equality. However, any kind of such sorting may deliver incorrect results in rare cases when a shallow comparison (eg by node label or similar property) does not produce the correct order when the children are same. In such cases when the children appear in different respective orders under the two parent nodes being compared sorting fails to produce a consistent ordering and the matching fails.

Change History (7)

comment:1 Changed 8 months ago by bburlacu

  • Status changed from new to accepted

r16278: Address the issues described in the ticket.

r16279: Simplify code, improve performance, fix another potential bug in relation with 3).

r16283: Refactor bottom-up similarity calculator methods (main logic stays the same, better implementation), update unit tests (more tests will be added).

Last edited 8 months ago by bburlacu (previous) (diff)

comment:2 Changed 6 months ago by gkronber

  • Version changed from 3.3.16 to trunk

Please complete your changes to the trunk until the end of the year.

comment:3 Changed 6 months ago by bburlacu

The similarity calculator is done. I need to add more unit tests and then this ticket will be ready for review.

comment:4 Changed 3 months ago by gkronber

Please add the unit tests.

comment:5 Changed 2 months ago by gkronber

Please make required changes and move to review phase.

comment:6 Changed 2 months ago by bburlacu

  • Owner changed from bburlacu to gkronber
  • Status changed from accepted to reviewing

r16867: Add more unit tests for tree matching, and test bottom-up calculator against hash-based calculator for consistency.

In my opinion, the bottom-up calculator is ready for review. Aside from added unit tests, the calculator successfully validates against the hash-based approach, producing exactly the same average similarity.

comment:7 Changed 2 months ago by bburlacu

r16869: Fix compilation errors.

Note: See TracTickets for help on using tickets.