Is there any algorithm to address the longest common subsequent problem with different weights for each character?
问题 I'm looking for an algorithm that addresses the LCS problem for two strings with the following conditions: Each string consists of English characters and each character has a weight. For example: sequence 1 (S1): "ABBCD" with weights [1, 2, 4, 1, 3] sequence 2 (S2): "TBDC" with weights [7, 5, 1, 2] Suppose that MW(s, S) is defined as the maximum weight of the sub-sequence s in string S with respect to the associated weights. The heaviest common sub-sequence (HCS) is defined as: HCS = argmin