最短的通用超字符串算法? [英] Shortest Common Superstring algorithm?

查看:109
本文介绍了最短的通用超字符串算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在此处编码此问题:

I'm trying to code this problem here:

但我想找到一种算法,可以分解解决问题的步骤。我似乎在网上找不到任何有用的东西,所以我来这里问是否有人知道我可以用来指代解决该问题的算法的资源。

but I'd like to find an algorithm that breaks down the steps for solving the problem. I can't seem to find anything too useful online so I've come here to ask if anyone knows of a resource which I can use to refer to an algorithm that solves this problem.

推荐答案

这称为最短的常见超序列问题。这个想法是为了使超序列最短,我们希望找到尽可能多的a和b共享位。我们可以分两个步骤解决问题:

This is called the shortest common supersequence problem. The idea is that in order for the supersequence to be the shortest, we want to find as many shared bits of a and b as possible. We can solve the problem in two steps:


  1. 找到a和b的最长公共子序列。

  1. Find the longest common subsequence of a and b.

插入a和b的其余位,同时保留这些位的顺序。

Insert the remaining bits of a and b while preserving the order of these bits.

我们可以使用动态编程来解决最长的公共子序列问题

We can solve the longest common subsequence problem using dynamic programming.

这篇关于最短的通用超字符串算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆