Closed Johnnyeee closed 2 months ago
It is expected behavior. The method returns the matches that have no overlap (if overlap=0) without recomputing the paths. Thus if the path that leads to that number in the matching (in this case [2,5]) overlaps with an earlier path (in this case [2,4]), it does not retain that path. If you would set overlap higher, then the match ending at position 5 is also returned.
To get the segment [5,5] returned, we would have to recompute the possible paths each time after finding a segment. That would be too expensive.
Thanks for your quick response.
Hi,
I tried to figure out the algorithm of finding matches, so I run:
I got result like:
My question is why segment [5,5] didn't get recorded? Based on your codes, the matching array after finding the best match will be like: [0.74535599 0.74535599 0.74535599 inf inf 0.66666667]. So why the next best index is 0 instead of 5 since 0.666<0.745?
Sorry that my question might be too basic but it confuses me so much. Thanks for your help!