HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

NP hardness of adaption of the graph bandwidth problem

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
problemtheadaptiongraphhardnessbandwidth

Problem

Is the following adaptation of the graph bandwidth problem NP hard? If so, which problem could a reduction use?

Given: Graph $G = (V , E ), L:E\to \mathbb N$.

Question: Is there a $f : V \to \mathbb Z$ where for each $e = \{u, v \} \in E$, $|f (u) - f (v )| = L(e)$?

Solution

This problem can be trivially solved for a forest. However it is $\mathrm{NP}$-complete even for a single cycle. Let's reduce the partition problem to this one.

Given a multiset $S$ of positive integers we build a cycle graph $G \cong C_{|S|}$ on $|S|$ vertices and place elements of $S$ one per edge as the function $L$. Now the function $f$ exists if and only if there is a partition of the multiset $S$ into two subsets $S_1$ and $S_2$ such that sum of elements in both subsets is the same.

  • If such partition exists, then starting with an arbitrary vertex $v$ of the graph $G$ we firstly let $f(v) = 0$ and then moving around the cycle along edge $e = \{\,u, w\,\}$ from the vertex $u$ to the vertex $w$ we let $f(w) = f(u) + L(e)$ if $L(e)$ came to $S_1$ or $f(w) = f(u) - L(e)$ otherwise. (Note that for equal elements distributed between $S_1$ and $S_2$ corresponding number of edges should take $+$ and $-$ signs.) Going along the last edge to the vertex $v$ we don't have any contradiction, because each element of $S_1$ was added and each element of $S_2$ was subtracted exactly once.



  • If such a function $f$ exists, then starting from an arbitrary vertex $v$ and moving around the cycle along the edge $e = \{\,u, w\,\}$ from the vertex $u$ to the vertex $w$ we place element $L(e)$ into $S_1$ if $f(w) = f(u) + L(e)$ or into $S_2$ otherwise. Since after passing each edge once we added or subtracted $L(e)$ for each $e$ exactly once and starting from $f(v)$ we finally get $f(v)$ again, we conclude that the sum of elements in subsets $S_1$ and $S_2$ is the same.



Since the reduction is polynomial in space and time, and partition problem is $\mathrm{NP}$-complete, then the given problem is $\mathrm{NP}$-hard. And since it belongs to the class $\mathrm{NP}$ we conclude that it is $\mathrm{NP}$-complete.

Context

StackExchange Computer Science Q#165649, answer score: 3

Revisions (0)

No revisions yet.