Posted on Categories:数学代写, 理论计算机

# 数学代写|理论计算机代写THEORETICAL COMPUTER SCIENCE代写|CSCI270 A polynomial-time algorithm for paths with a bounded number of colors

avatest™

avatest.org理论计算机Theoretical computer science代写，免费提交作业要求， 满意后付款，成绩80\%以下全额退款，安全省心无顾虑。专业硕 博写手团队，所有订单可靠准时，保证 100% 原创。avatest.org™， 最高质量的理论计算机Theoretical computer science作业代写，服务覆盖北美、欧洲、澳洲等 国家。 在代写价格方面，考虑到同学们的经济条件，在保障代写质量的前提下，我们为客户提供最合理的价格。 由于统计Statistics作业种类很多，同时其中的大部分作业在字数上都没有具体要求，因此理论计算机Theoretical computer science作业代写的价格不固定。通常在经济学专家查看完作业要求之后会给出报价。作业难度和截止日期对价格也有很大的影响。

avatest.org™ 为您的留学生涯保驾护航 在网课代修方面已经树立了自己的口碑, 保证靠谱, 高质且原创的网课代写服务。我们的专家在理论计算机Theoretical computer science代写方面经验极为丰富，各种理论计算机Theoretical computer science相关的作业也就用不着 说。

## 数学代写|理论计算机代写THEORETICAL COMPUTER SCIENCE代写|A polynomial-time algorithm for paths with a bounded number of colors

We complement here the results of the two preceding sections by showing that the MIN-CC problem for paths is polynomial-time solvable in case the motif is built upon a fixed number of colors. Observe, however, that each color may still have an unbounded number of occurrences in the motif.

In what follows we describe a dynamic programming algorithm for this case. The basic idea of our approach is as follows. Suppose we are left by the algorithm with the problem of finding an occurrence of a submotif $\mathcal{M}^{\prime} \subseteq \mathcal{M}$ in the subpath $G^{\prime}$ of $G$ induced by ${i, i+1, \ldots, j}, 1 \leq i<j \leq n$. Furthermore, suppose that any occurrence of $\mathcal{M}^{\prime}$ in $G^{\prime}$ results in at least $k^{\prime}$ connected components. This minimum number of occurrences $k^{\prime}$ can be computed as follows. Assume that we have found one leftmost connected component $C_{\text {left }}$ of the occurrence of $\mathcal{M}^{\prime}$ in $G^{\prime}$ and let $i_{2}, i \leq i_{2}<j$, be the rightmost (according to the natural order of the vertices) vertex of $C_{\text {left }}$. Let $\mathcal{M}^{\prime \prime}$ be the motif obtained from $\mathcal{M}^{\prime}$ by subtracting to each color $c_{\ell} \in \mathcal{C}$ the number of occurrences of color $c_{\ell}$ in the leftmost connected component $C_{\text {left }}$. Then the occurrence of $\mathcal{M}^{\prime}$ in $G^{\prime}$ is given by $\left{i_{2}+1, i_{2}+2, \ldots, j\right}$, which results in $k^{\prime}-1$ connected components. From an optimization point of view, the problem thus reduces to finding a subpath $\left{i_{1}, i_{1}+\right.$ $\left.1, \ldots, i_{2}\right}, i \leq i_{1} \leq i_{2}<j$, such that the occurrence of the motif $\mathcal{M}^{\prime \prime}$ modified according to the colors in $\left{i_{1}, i_{1}+1, \ldots, i_{2}\right}$ in the subpath induced by $\left{i_{2}+\right.$ $\left.1, i_{2}+2, \ldots, j\right}$ results in a minimum number of connected components.

Let $(G, \mathcal{M})$ be an instance of the MıN-CC problem where $G$ is a (vertexcolored) path built upon the set of colors $\mathcal{C}$. For ease of exposition, write $\mathbf{V}(G)=$ ${1,2, \ldots, n}$ and $q=|\mathcal{C}|$. We denote by $m_{i}$ the number of occurrences of color $c_{i} \in \mathcal{C}$ in $\mathcal{M}$. Clearly, $\sum_{c_{i} \in \mathcal{C}} m_{i}=|\mathcal{M}|$. We now introduce our dynamic programming table $T$. Define $T\left[i, j ; p_{1}, p_{2}, \ldots, p_{q}\right], 1 \leq i \leq j \leq n$ and $0 \leq p_{\ell} \leq m_{\ell}$ for $1 \leq \ell \leq q$, to be the minimum number of connected components in the subpath of $G$ that starts at node $i$, ends at node $j$ and that covers $p_{\ell}$ occurrences of color $c_{\ell}, 1 \leq \ell \leq q$. The base conditions are as follows:

• for all $1 \leq i \leq j \leq n, T[i, j ; 0,0, \ldots, 0]=0$ and $T\left[i, i ; p_{1}, p_{2}, \ldots, p_{q}\right]=\infty$ if $\sum_{1 \leq \ell \leq q} p_{\ell}>1$
• for all $1 \leq i \leq n, T\left[i, i ; p_{1}, p_{2}, \ldots, p_{q}\right]=\infty$ if $\sum_{1 \leq \ell \leq q} p_{\ell}=1$ and $\lambda(i) \neq c_{\ell}$ and $p_{\ell}=1$, and $T\left[i, i ; p_{1}, p_{2}, \ldots, p_{q}\right]=1$ if $\sum_{1 \leq \ell \leq q} p_{\ell}=$ 1 and $\lambda(i)=c_{\ell}$ and $p_{\ell}=1$.

## 数学代写|理论计算机代写THEORETICAL COMPUTER SCIENCE代写|Hardness of approximation for trees

We investigate in this section approximation issues for restricted instances of the MIN-CC problem. Unfortunately, as we shall now prove, it turns out that, even if $\mathcal{M}$ is a set and $G$ is a tree, the MıN-CC problem cannot be approximated within ratio $c \log n$ for some constant $c>0$, where $n$ is the size of the target graph $G$. As a side result, we prove that the MIN-CC problem is W[2]-hard when parameterized by the number of connected components of the occurrence of $\mathcal{M}$ in the target graph $G$.

At the core of our proof is an L-reduction [12] from the SET-COVER problem. Let $I$ be an arbitrary instance of the SET-COVER problem consisting of a universe set $X(I)=\left{x_{1}, x_{2}, \ldots, x_{n}\right}$ and a collection of sets $\mathcal{S}(I)=S_{1}, S_{2}, \ldots, S_{m}$, each over $X(I)$. For each $1 \leq i \leq m$, write $t_{i}=\left|S_{i}\right|$ and denote by $e_{j}\left(S_{i}\right)$, $1 \leq j \leq t_{i}$, the $j$-th element of $S_{i}$. For ease of exposition, we present the corresponding instance of the MIN-CC problem as a rooted tree $G$. We construct the tree $G$ as follows (see Fig. 1). Define a root $r$ and vertices $S_{1}^{\prime}, S_{2}^{\prime}, \ldots, S_{m}^{\prime}$ such that each vertex $S_{i}^{\prime}$ is connected to the root $r$. For each $S_{i}^{\prime}$ define the subtree $G\left(S_{i}^{\prime}\right)$ rooted at $S_{i}^{\prime}$ as follows: each vertex $S_{i}^{\prime}$ has a unique child $S_{i}$ and each vertex $S_{i}$ has children $e_{1}\left(S_{i}\right), e_{2}\left(S_{i}\right), \ldots, e_{t_{i}}\left(S_{i}\right)$. The set of colors $\mathcal{C}$ is defined as follows: $\mathcal{C}=\left{c\left(S_{i}\right): 1 \leq i \leq m\right} \cup\left{c\left(x_{j}\right): 1 \leq j \leq n\right} \cup{c(r)}$. The coloring mapping $\lambda: \mathbf{V}(G) \rightarrow \mathcal{C}$ is defined by: $\lambda\left(S_{i}\right)=\lambda\left(S_{i}^{\prime}\right)=c\left(S_{i}\right)$ for $1 \leq i \leq m$, $\lambda\left(x_{j}\right)=c\left(x_{j}\right)$ for $1 \leq j \leq n$ and $\lambda(r)=c(r)$. The motif $\mathcal{M}$ is the set defined as follows: $\mathcal{M}=\left{c\left(S_{i}\right): 1 \leq i \leq m\right} \cup\left{c\left(x_{i}\right): 1 \leq i \leq n\right} \cup{c(r)}$.

## 数学代写|理论计算机代写 THEORETICAL COMPUTER SCIENCE代写|A polynomial-time algorithm for paths with a bounded number of colors

\left 的分隔符缺失或无法识别，，这样主题的出现 $\mathcal{M}^{\prime \prime}$ 根据颜色修改
lleft 的分隔符缺失或无法识别

\left 的分隔符笡失或无法识别

## 数学代写|理论计算机代写 THEORETICAL COMPUTER SCIENCE代写|Hardness of approximation for trees

\left 的分隔符缺失或无法识别 $\quad$ 着色映射 $\lambda: \mathbf{V}(G) \rightarrow \mathcal{C}$ 定义为: $\lambda\left(S_{i}\right)=\lambda\left(S_{i}^{\prime}\right)=c\left(S_{i}\right)$ 为了 $1 \leq i \leq m, \lambda\left(x_{j}\right)=c\left(x_{j}\right)$ 为了 $1 \leq j \leq n$ 和 $\lambda(r)=c(r)$. 主 题, $\mathcal{M}$ 是定义如下的集合：\left 的分隔符筷失或无法识别

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。