Given an undirected graph $G=(V,E)$ and vertices $s,t,w_1,w_2\in V$, we study finding whether there exists a simple path $P$ from $s$ to $t$ such that $w_1,w_2 \in P$. As a sub-problem, we study the question: given an undirected graph and three of its edges, does there exist a simple cycle containing all those edges? We provide necessary and sufficient conditions for the existence of such paths and cycles, and develop efficient algorithms to solve this and related problems.
翻译:鉴于一个未指导的图表$G=(V,E)$和顶点$t,w_1,w_2美元,我们研究是否有一条从美元到美元(t)的简单路径。作为一个次级问题,我们研究的问题是:鉴于一个未指导的图表及其三个边缘,是否存在一个包含所有这些边缘的简单循环?我们为这些路径和周期的存在提供了必要和充分的条件,并制定了高效的算法来解决这一问题和相关问题。