Problem
A directed cycle is simply a cycle in a directed graph in which the head of one edge is equal to the tail of the next (so that every edge in the cycle is traversed in the same direction).
For a set of DNA strings and a positive integer , let denote the collection of all possible -mers of the strings in .
Given: A collection of (error-free) reads of equal length (not exceeding 50 bp). In this dataset, for some positive integer , the de Bruijn graph on consists of exactly two directed cycles.
Return: A cyclic superstring of minimal length containing every read or its reverse complement.
有向循环只是有向图中的一个循环,其中一个边的头部 等于下一个边的尾部(因此,循环中的每个边都沿相同的方向移动)。
对于一个组的DNA串 和一个正整数 ,让 表示所有可能的集合 -字符串中的-mers 。
鉴于:一个集合相同长度(不超过50 bp)的(无错)读取数。在这个数据集中,对于一些正整数,de Bruijn图 上 正好由两个定向周期组成。
返回值:最小长度的循环超级字符串,包含每个读取或其反向补码。
Sample Dataset
AATCT TGTAA GATTA ACAGA
Sample Output
GATTACA