# Reduce maximum capacity simple cycle to maximum capacity minimum cost cycle

Consider the following problems

$(A)$: Let $G=(V,E)$ a non-directed graph, a capacity function $u:V\to\mathbb Q_+\cup\{0\}$ and $m \in \mathbb Q_+$. Decide if there exists a simple cycle such that the sum of the capacities of its vertices is greater than $m$.

$(B)$: Let $G=(V,E)$ a non-directed graph, a cost function $c:E\to\mathbb{Q}_+\cup\{0\}$, a capacity function $u:V\to\mathbb Q_+\cup\{0\}$ and $m,k \in \mathbb Q_+$. Decide if there exists a cycle (can repeat vertices) with cost less or equal than $k$ such that the sum of the capacities of its vertices is greater than $m$.

Is it possible to reduce $A$ to $B$ polynomially?

Observation: If the cycle of the problem $B$ repeats a vertex we have to count its capacity as many times as it appears.

• I think so. Hint: show that (A) is in NP, and that (B) is NP-hard. (Try, say, a reduction from KNAPSACK.) This would be a nice homework problem... – Neal Young Jun 22 at 20:43
• I was looking for a direct reduction, the idea was to avoid external problems. – Gonzalo Benavides Jun 26 at 17:30
• Ah, perhaps you should put that in your question, and also say more precisely what you mean by "direct" (which may be hard to clearly define). My bet would be that there is no especially simple reduction. Asking for a simple cycle seems very different than asking for a cycle of bounded cost. (Unless in (B) you intend to allow cycles to repeat vertices but not edges. Then it would be easy to reduce (A) to (B), even with all edge costs being zero.) – Neal Young Jun 26 at 18:03