nasa / bingo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AGraph.Distance

tylertownsend opened this issue · comments

The Distance function compares row-wise for each element to see if they match. However, how does this reflect to AGraphs with the same equation tree, but with different command arrays. For example let,

command_array_1 = [[LOADX, 0, 0],
                   [LOADX, 1, 1],
                   [LOADC, 0, 0],
                   [MULTI, 0, 2]]

and

command_array_2 = [[LOADX, 0, 0],
                   [LOADC, 0, 0],
                   [MULTI, 0, 1],
                   [LOADX, 1, 1]]

And distance(command_array_1, command_array_2) = 8 since the first row is the same, and the 0 in the 1st column-index of the 2nd row-index is in both arrays. However they both describe an equation f(x) = c_0 * x_0. Should the distance reflect the AGraphs or the command arrays?

Ideally distance is a measure of dissimilarity between the AGraphs. It was implemented in the current way mainly based on a need for fast evaluation. We could try a different (and likely slower) implementation and see if the reduction in evaluation speed is made up in quicker evolutionary convergence.

I just read a paper on alternative, hash-based distance metric:
https://arxiv.org/abs/1902.00882
this could be worth implementing and comparing