IWOCA 2020: Combinatorial Algorithms pp 56-68

# On Proper Labellings of Graphs with Minimum Label Sum

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 12126)

## Abstract

The 1-2-3 Conjecture states that every nice graph G (without component isomorphic to $$K_2$$) admits a proper 3-labelling, i.e., a labelling of the edges with 1, 2, 3 such that no two adjacent vertices are incident to the same sum of labels. Another interpretation of this conjecture is that every nice graph G can be turned into a locally irregular multigraph M, i.e., with no two adjacent vertices of the same degree, by replacing each edge by at most three parallel edges. In other words, for every nice graph G, there should exist a locally irregular multigraph M with the same adjacencies and having few edges.

We study proper labellings of graphs with the extra requirement that the sum of assigned labels must be as small as possible. That is, given a graph G, we are looking for a locally irregular multigraph $$M^*$$ with the fewest edges possible that can be obtained from G by replacing edges with parallel edges. This problem is quite different from the 1-2-3 Conjecture, as we prove that there is no k such that $$M^*$$ can always be obtained from G by replacing each edge with at most k parallel edges.

We investigate several aspects of this problem. We prove that the problem of designing proper labellings with minimum label sum is $$\mathcal {NP}$$-hard in general, but solvable in polynomial time for graphs with bounded treewidth. We also conjecture that every nice connected graph G admits a proper labelling with label sum at most $$\frac{3}{2}|E(G)|+\mathcal {O}(1)$$, which we verify for several classes of graphs.

## Keywords

Proper labelling 1-2-3 Conjecture Minimum label sum

## 1 Introduction

In this paper, we consider proper labellings of graphs, a notion related to the 1-2-3 Conjecture, with the extra constraint that the sum of assigned labels must be minimised. For any notation on graph theory not defined here, we refer the reader to . For a graph G, a function $$\ell :E(G)\mapsto \{1,\dots ,k\}$$ is called a k-labelling of G. For any $$v\in V(G)$$, let $$c_\ell (v):V(G)\mapsto \mathbb {N}^*$$ be the colour of v that is induced by $$\ell$$, being the sum of labels assigned to the edges incident to v. That is, $$c_\ell (v) = \sum _{u \in N(v)} \ell (vu)$$ where $$N(v)=\{u\in V(G):uv\in E(G)\}$$ is the neighbourhood of v. We say that $$\ell$$ is a proper labelling if the resulting colouring $$c_\ell$$ is a proper vertex-colouring of G, i.e., for every edge $$uv \in E(G)$$ we have $$c_\ell (u) \ne c_\ell (v)$$. Note that a graph admits a proper labelling if and only if it has no $$K_2$$ as a component . Therefore, we here focus only on nice graphs, i.e., graphs without any component isomorphic to $$K_2$$. Given a nice graph G, let $$\mathrm{\chi _\Sigma }(G)$$ be the smallest k such that G admits a proper k-labelling.

Maybe the most famous conjecture concerning proper labellings of graphs is the so-called 1-2-3 Conjecture, introduced by Karoński, Łuczak and Thomason in 2004 . This conjecture states that for every nice graph G, we have $$\mathrm{\chi _\Sigma }(G)\le 3$$. It is worth noting that there exist nice graphs, such as nice complete graphs , for which the upper bound is attained. Actually, given a graph G, deciding if $$\mathrm{\chi _\Sigma }(G) \le 2$$ holds is an $$\mathcal {NP}$$-complete problem . The best currently known result towards the 1-2-3 Conjecture is that for any nice graph G, we have $$\mathrm{\chi _\Sigma }(G)\le 5$$ . Another important result states that the conjecture is satisfied for nice 3-colourable graphs . Quite recently, a characterisation of nice bipartite graphs G with $$\mathrm{\chi _\Sigma }(G)=3$$ was provided in . Moreover, $$\mathrm{\chi _\Sigma }(G)\le 4$$ holds for every nice regular graph G  and $$\mathrm{\chi _\Sigma }(T)\le 2$$ holds for every nice tree T .

Our work takes place in a recent series of works dedicated to better understanding proper labellings by studying variations with additional requirements, such as minimising the number of distinct colours  or minimising the maximum colour  induced by a proper k-labelling. An additional motivation is the following . Given a graph G and a proper labelling $$\ell$$ of G, by replacing every edge e by $$\ell (e)$$ parallel edges, we obtain a multigraph $$M_{G,\ell }$$ with the same adjacencies as G that is locally irregular, i.e., in which no two adjacent vertices have the same degree. In this setting, the 1-2-3 Conjecture states that, for every nice graph G, we can construct a corresponding $$M_{G,\ell }$$ by replacing each edge by at most three parallel edges, and thus construct such an $$M_{G,\ell }$$ with at most 3|E(G)| edges. One could argue however, that there might be cases in which it could be possible to obtain such a multigraph with fewer edges when being allowed to replace edges by more than three parallel edges. We study this through the following additional notions and definitions. Formally, for a labelling $$\ell$$ of a nice graph G, let $$\sigma (\ell )$$ be the sum of labels assigned to the edges of G by $$\ell$$. That is, $$\sigma (\ell ) =\sum _{e \in E(G)} \ell (e).$$ For any $$k \ge 1$$, let $$\mathrm{mE}_k(G)$$ be the minimum value of $$\sigma (\ell )$$ over all proper k-labellings $$\ell$$ of G. That is, $$\mathrm{mE}_k(G) = \min \left\{ \sigma (\ell ) : \ell \mathrm{~is~a~proper~} k\mathrm{-labelling~of~} G\right\}$$. Let $$\mathrm{mE}(G) = \min \{\mathrm{mE}_k(G) : k \ge \mathrm{\chi _\Sigma }(G)\}$$. Computing a proper labelling $$\ell ^*$$ such that $$\sigma (\ell ^*)=\mathrm{mE}(G)$$ is thus equivalent to finding a locally irregular multigraph $$M_{G,\ell ^*}$$ with minimum number of edges.

Our Contributions. Section 2 starts by giving observations on labellings that are used to deduce the value of $$\mathrm{mE}$$ for nice complete bipartite graphs, complete graphs and cycles. We then exhibit an infinite family of graphs G showing that, for any fixed $$k \ge 2$$, the value $$\mathrm{mE}_k(G)$$ can be arbitrarily larger than $$\mathrm{mE}_{k+1}(G)$$, thereby establishing a fundamental property of our problem.

In Sect. 3, we study the complexity of computing the parameter $$\mathrm{mE}_k(G)$$ for some input integer k and nice graph G. We establish both positive and negative results. On the negative side we prove that determining $$\mathrm{mE}_2(G)$$ is $$\mathcal {NP}$$-complete, even when G is restricted to a planar bipartite graph. An important point is that this is contrasting with the complexity of determining whether $$\mathrm{\chi _\Sigma }(G) \le 2$$ holds for a given bipartite graph G, which can be done in polynomial time . On the positive side, we prove that determining $$\mathrm{mE}_k(G)$$ can be done in polynomial time whenever k is fixed and G is a graph with bounded treewidth.

Finally, Sect. 4 is dedicated to bounds on $$\mathrm{mE}$$. Our guiding thread is a conjecture we raise, stating that, for any nice connected graph G, $$\mathrm{mE}(G)\le \frac{3}{2}|E(G)|+\mathcal {O}(1)$$. Towards this conjecture, we focus on the bipartite case. As support, we both provide infinite families of bipartite graphs G with “large” value of $$\mathrm{mE}_2(G)$$, and prove the conjecture for several classes of bipartite graphs.

## 2 First Insights into the Problem

In this section, we give first insights into the problem of determining the parameters $$\mathrm{mE}(G)$$ and $$\mathrm{mE}_k(G)$$ for a given graph G. We start off, in Sect. 2.1, by raising observations on labellings and by considering easy classes of graphs. For each G belonging to the classes we consider, we actually have $$\mathrm{mE}_k(G)=\mathrm{mE}(G)$$ for $$k=\mathrm{\chi _\Sigma }(G)$$. Put differently, a larger label than $$\mathrm{\chi _\Sigma }(G)$$ is not needed to achieve the smallest label sum. However, this behaviour is not systematic, as we exhibit, in Sect. 2.2, examples of trees T for which the smallest k such that $$\mathrm{mE}_k(T)=\mathrm{mE}(T)$$ is arbitrarily large.

### 2.1 Warm-Up Results

First off, note that in general, labellings have systematic properties that can be useful to establish bounds on $$\mathrm{mE}$$ and $$\mathrm{mE}_k$$.

### Observation 1

Let $$\ell$$ be a k-labelling of a graph G. The following items hold:
• $$|E(G)| \le \sigma (\ell ) \le k |E(G)|$$.

• $$\sum _{e \in E(G)} 2 \ell (e) = 2 \sigma (\ell ) = \sum _{v \in V(G)} c_\ell (v)$$.

• $$\sum _{v \in V(G)} c_\ell (v)$$ must therefore be an even number.

In particular, these observations allow to determine the value of $$\mathrm{mE}$$ for simple graph topologies, namely for complete bipartite graphs, complete graphs, and cycles. Due to lack of space, we only sketch the proof of the result about cycles.

### Theorem 2

Let $$G= K_{n,m}$$ be a complete bipartite graph with order $$n+m>2$$.

• If $$n \ne m$$, then $$\mathrm{mE}(G)=\mathrm{mE}_1(G)=|E(G)|$$;

• otherwise, i.e., $$n=m$$, we have $$\mathrm{mE}(G)=\mathrm{mE}_2(G)=|E(G)|+\sqrt{|E(G)|}$$.

### Theorem 3

Let $$K_n$$ be a complete graph with order $$n \ge 3$$. Then:
• if $$n=3$$, then $$\mathrm{mE}(K_3)=\mathrm{mE}_3(K_3)=6=2|E(K_3)|$$;

• if $$n \equiv 0$$ or $$1 \pmod {4}$$, then $$\mathrm{mE}(K_n)=\mathrm{mE}_3(K_n)=\frac{3}{2}|E(K_n)|$$;

• if $$n \equiv 2$$ or $$3 \pmod {4}$$, then $$\mathrm{mE}(K_n)=\mathrm{mE}_3(K_n)=\left\lceil \frac{3}{2}|E(K_n)|\right\rceil$$.

### Theorem 4

Let $$C_n$$ be a cycle with length $$n \ge 3$$. Then:
• if $$n \equiv 0\pmod {4}$$, then $$\mathrm{mE}(C_n)=\mathrm{mE}_2(C_n)=\frac{3}{2}|E(C_n)|$$;

• if $$n \equiv 1$$ or $$3\pmod {4}$$, then $$\mathrm{mE}(C_n)=\mathrm{mE}_3(C_n)=\left\lceil \frac{3}{2}|E(C_n)|\right\rceil +1$$;

• if $$n \equiv 2 \pmod {4}$$, then $$\mathrm{mE}(C_n)=\mathrm{mE}_3(C_n)=\frac{3}{2}|E(C_n)|+3$$.

Sketch of Proof. The proof of the lower bounds follow mainly from the fact that, for any $$l \le k$$, any proper k-labelling $$\ell$$ of $$C_n$$ assigns label l to at most $${\lfloor }\frac{1}{2}|E(C_n)|{\rfloor }$$ edges if n is odd and to at most Open image in new window . This claim is proved by considering the conflict graph that consists of one vertex per edge of $$C_n$$, with two vertices being adjacent when the corresponding edges of $$C_n$$ cannot have the same label. We show that this conflict graph is either one cycle or two disjoint cycles (depending on the parity of n) and so the size of any of its independent sets (corresponding to a set of edges of $$C_n$$ that can receive the same label) is bounded above as required.

The upper bounds on $$\mathrm{mE}$$ are proven by giving a proper labelling matching the lower bound. For instance, if Open image in new window , it is sufficient to alternate two consecutive edges labelled with 1, then two consecutive edges labelled with 2, and so on. When Open image in new window , one single edge labelled with 3 is necessary and sufficient while two such edges are required and sufficient in the last case. $$\Diamond$$

### 2.2 Using Larger Labels can be Arbitrarily Better

In this section, we show that there is no absolute constant $$k \in \mathbb {N}$$ such that $$\mathrm{mE}(G)=\mathrm{mE}_k(G)$$ for all nice graphs. More precisely, for any integer k, we exhibit a tree $$T_k$$ such that $$\mathrm{mE}(T_k)=\mathrm{mE}_k(T_k)<\mathrm{mE}_{k-1}(T_k)$$.

Let us first introduce the auxiliary graph $$A(\alpha ,\beta )$$ (for $$\alpha \ge 2$$ and $$\beta \ge 0$$), which will serve as the building block for $$T_k$$. This auxiliary graph is a tree built recursively as follows. For any $$\alpha ^*\in \mathbb {N}$$, define $$A(\alpha ^*,0)$$ as a leaf. For any $$\beta >0$$, define $$A(\alpha ,\beta )$$ as a tree of height $$\beta$$, rooted in a vertex r with $$\alpha$$ children. For each $$1\le i\le \alpha$$, let $$c_i$$ be the corresponding child of r; each $$c_i$$ is the root of an $$A(\alpha +i,\beta -1)$$ tree and thus $$d(c_i)=\alpha +i+1$$ (since each $$c_i$$ has $$\alpha +i$$ children of its own and an edge connecting it with his parent). Note that $$d(c_i)\in D(\alpha ) =[\alpha +2,2\alpha +1]$$ and that for $$i\ne j$$, we have $$d(c_i)\ne d(c_j)$$ (and thus all values of D(a) are used exactly once). Finally, we say that $$A(\alpha ,\beta )$$ is represented by r.

Let us also define the pending auxiliary graph that corresponds to $$A(\alpha ,\beta )$$ as $$P(\alpha ,\beta )= (V,E)$$, where $$V=V(A(\alpha ,\beta ))\cup \{v\}$$ and $$E=E(A(\alpha ,\beta ))\cup \{vr\}$$; in essence $$P(\alpha ,\beta )$$ is $$A(\alpha ,\beta )$$ with an extra vertex v connected to r. The vertex r is called the representative of $$P(\alpha ,\beta )$$. The graph $$P(\alpha ,\beta )$$ is said to be pending from v. Observe that $$P(\alpha ,\beta )$$ is locally irregular and thus the labelling $$\ell$$ that assigns label 1 on every one of its edges is proper and $$\mathrm{mE}(P(\alpha ,\beta ))=|E|$$.

### Theorem 5

For any $$k\ge 2$$, there is a graph $$T_k$$ with $$\mathrm{mE}_{k+1}(T_k)<\mathrm{mE}_k(T_k)$$.

Sketch of Proof. Let $$k\ge 2$$ and let us describe the construction of $$T_k$$. For $$0\le j\le k-1$$, let $$P(k+j,2(k+1))$$ be the graph pending from $$v_j$$ that corresponds to an auxiliary graph $$A(k+j,2(k+1))$$ (represented by a vertex $$r_j$$) and let uv be two adjacent vertices. The tree $$T_k$$ is the graph that is produced by merging v with each one of the $$v_j$$. Observe that since $$r_j$$ represents $$A(k+j,2(k+1))$$, each $$r_j$$ has $$d(r_j)=k+j+1$$ in $$T_k$$ and that the height of $$T_k$$ is $$2(k+1)+1$$. Also observe that in $$T_k$$, since $$N(v)=\{r_0,\dots ,r_{k-1},u\}$$, we have $$d(v)=k+1=d(r_0)$$.

Let $$\ell$$ be the $$(k+1)$$-labelling of $$T_k$$ that assigns label $$k+1$$ to the edge uv and label 1 to the remaining edges of $$T_k$$. It easy to see that $$\ell$$ is a proper $$(k+1)$$-labelling for $$T_k$$ with $$\sigma (\ell )=|E(T_k)|+k$$.

Let $$\ell '$$ be any proper k-labelling of $$T_k$$. It suffices to show that $$\sigma (\ell ')>|E(T_k)|+k$$. For any $$w\in N(r_0)\setminus \{v\}$$ and $$y\in N(v)\setminus \{u,r_0\}$$, since $$d(v)=d(r_0)=k+1$$, at least one of the edges uv, $$r_0w$$ or vy has to have a label different from 1 for $$\ell '$$ to be proper. Let us assume that $$\ell (uv) \ne 1$$ (the other cases being similar). Let $$\ell '(uv)=l$$ with $$2\le l\le k$$ and assume that only this edge of $$T_k$$ has a label different from 1. Then $$c_{\ell '}(v)=k+l$$ and $$k+l\in [k+2,2k]$$. Recall that for each $$0\le j\le k-1$$, $$r_j$$ has $$d(r_j)=k+j+1$$ and thus $$d(r_j)\in [k+1,2k]$$. Since uv is the only edge with a label different from 1, $$c_{\ell '}(r_j)=d(r_j)$$. It follows that there exists a $$j\in [0,k-1]$$, such that $$c_{\ell '}(r_j)=c_{\ell '}(v)$$ leading to $$\ell '$$ not being proper. Thus, there must exist another edge $$u'v'$$ (with, say, $$u'$$ being the parent of $$v'$$) that is assigned a label different from 1 by $$\ell '$$. Note that this edge $$u'v'$$ belongs to $$P(q,2(k+1))$$ (for some $$q\in [k,2k-1]$$) and either $$v'=v$$ or $$v'$$ is the child of the representative v of $$P(q,2(k+1))$$. It can be shown that, for $$\ell$$ to be proper, at least one child of $$u'$$ has one of its incident edges e assigned a label distinct from 1. This edge e belongs to some subtree P(q, 2k) and e is incident to either the representative of this copy of P(q, 2k) or to a child of this representative. Applying this argument recursively, it can be proved that, for $$\ell$$ to be proper, this copy of P(q, 2k) must contain at least k edges with a label greater than 1. Overall, $$\mathrm{mE}(T_k)\ge |E(T_k)|+k+1$$.

Observe that the height of $$T_k$$ can be freely controlled by changing the $$\beta$$ value of the pending auxiliary graphs that form it. Furthermore, it follows from some of the arguments we have employed that $$\mathrm{mE}(T(\alpha ,2\beta ))<\mathrm{mE}(T(\alpha ,2\beta '))$$ for $$\beta <\beta '$$. Put simply, since the difference between $$\mathrm{mE}_{k+1}(T_k)$$ and $$\mathrm{mE}_{k}(T_k)$$ depends on the height of $$T_k$$ and this can be an arbitrary number, the following holds:

### Corollary 1

For any $$k\ge 2$$, there exists a graph $$T_k$$ such that $$\mathrm{mE}_{k+1}(T_k)$$ is arbitrarily smaller than $$\mathrm{mE}_k(T_k)$$.

## 3 Complexity Aspects

This section is devoted to the complexity aspects of the problem of computing $$\mathrm{mE}_k$$. On the negative side, we prove that the problem is $$\mathcal {NP}$$-complete in planar bipartite graphs. On the positive side, we prove that the problem can be solved in polynomial time for graphs with bounded treewidth, and that it is even FPT when parameterised by the treewidth plus the maximum degree.

### 3.1 $$\mathcal {NP}$$-hardness for Planar Bipartite Graphs

Let us first introduce the k-gadget, for $$k\ge 11$$, which will be useful for proving the main Theorem of this section. To build this gadget, start with $$k-1$$ stars, each having a center denoted by $$s_i$$, $$i\in [1,k-1]$$, such that $$d(s_i)=k+1$$. For each star, pick an arbitrary edge $$s_iy_i$$ and identify all the $$y_i$$ into a single vertex y, which is called the representative of the gadget. Finally add another vertex u, called the root of the gadget, which is connected to y. It is clear that $$d(u)=1$$ and $$d(y)=k$$. Also, each k-gadget is a tree with $$\mathcal {O}(k^2)$$ edges. Let v be a vertex of a graph G, and H be a k-gadget. The operation of adding H to G and identifying the root u of H with v is called attaching H to v.

### Theorem 6

Let G be a nice planar bipartite graph, $$k\ge 2$$ and $$q\in \mathbb {N}$$. The problem of deciding if $$\mathrm{mE}_k(G)\le q$$ is $$\mathcal {NP}$$-complete.

### Proof

The problem is clearly in $$\mathcal {NP}$$. We focus on showing it is also $$\mathcal {NP}$$-hard. The proof is done by reduction from Planar Monotone 1-in-3 SAT, which was shown to be $$\mathcal {NP}$$-complete in . In this problem, a 3CNF formula F is given as input, which has clauses with exactly three distinct variables all of which appear only positively. We say that a bipartite graph $$G'=(V,C,E)$$ corresponds to F if it is constructed in the following way: for each variable $$x_i$$ of F we add a variable vertex $$v_i$$ in V and for each clause $$C_j$$ of F we add a clause vertex $$c_j$$ in C. Then the edge $$v_ic_j$$ is added if variable $$x_i$$ appears in clause $$C_j$$. In the Planar Monotone 1-in-3 SAT problem, we also have that for any instance F the corresponding graph is planar. The question is whether there exists a 1-in-3 truth assignment of F; that is a truth assignment to the variables of F such that each clause has exactly one variable with the value true.

Let us prove the statement for $$k=2$$. Let F be the 3CNF formula with c clauses that is given as input to the Planar Monotone 1-in-3 SAT problem. Our goal is to construct a planar bipartite graph G such that F is 1-in-3 satisfiable if and only if $$\mathrm{mE}_2(G)\le |E(G)|+c$$.

Start with $$G'=(V,C,E)$$ being the planar bipartite graph that corresponds to F, with V being the set of the variable vertices $$v_i$$, C being the set of the clause vertices $$c_j$$ and $$|C|=c$$. In F, each clause has exactly three variables but there is no bound on how many times a variable appears in F. Thus for each $$v_i\in V, d(v_i)\ge 1$$ and for each $$c_j\in C, d(c_j)=3$$. It follows that $$|V|\le 3c$$.

Modify $$G'$$ by adding the k-gadgets described earlier in the following way. For each variable vertex $$v_i$$ of G, let $$d_i$$ be the degree of $$v_i$$ in $$G'$$. Let $$d_{v,i}=(d_i-1)(c+1)+d_i$$ and $$d_c=3(c+1)+3$$. For each variable vertex $$v_i$$, for all $$1\le j<d_i$$, attach $$c+1$$ copies of the $$(d_{v,i}+j)$$-gadget. Thus the degree of each $$v_i$$ in G becomes equal to $$d_{v,i}$$. On each clause vertex $$c_j$$, attach $$c+1$$ copies of the $$d_c$$-gadget, $$c+1$$ copies of the $$(d_c+2)$$-gadget and $$c+1$$ copies of the $$(d_c+3)$$-gadget. Thus the degree of each $$c_j$$ in G becomes equal to $$d_c$$. Clearly, the construction of G is achieved in polynomial time. Observe also that since $$G'$$ is planar and the attached gadgets are actually trees, G is also planar.

### Claim

Let G(VCE) be a bipartite graph and $$\ell$$ be any proper 2-labelling of G such that $$\sigma (\ell )\le |E(G)|+c$$, for $$c=|C|$$. Let H be any p-gadget attached to G, where $$p-1>c$$. Let y be the representative of H. If at least one edge e of H incident to y is labelled 2, then at least two edges of H are labelled 2.

Let $$\ell$$ be a proper 2-labelling of G such that $$\sigma (\ell )\le |E(G)|+c$$, i.e., there are at most c edges of G labelled 2 by $$\ell$$. Observe that G contains p-gadgets for $$p\in \{d_{v,i}+1,d_{v,i}+2,\dots d_{v,i}+d_i-1,d_c,d_c+2,d_c+3$$ and $$d_{v,i}-1, d_c-1>c$$. Thus the above claim holds for each gadget attached to G.

### Claim

For any proper 2-labelling $$\ell$$ of G with $$\sigma (\ell )\le |E(G)|+c$$, we have that:
• for each variable vertex $$v_i\in V, c_\ell (v_i)\notin \{d_{v,i}+1, d_{v,i}+2,\dots , d_{v,i}+d_i-1\}$$

• for each clause vertex $$c_j\in C, c_\ell (c_j)\notin \{d_c,d_c+2,d_c+3\}$$

### Claim

Let $$\ell$$ be any proper 2-labelling of G with $$\sigma (\ell )\le |E(G)|+c$$. Then all edges of the attached gadgets must be labelled 1.

Using the above Claims, it follows that the only possible colours induced by $$\ell$$ on the vertices of $$G'$$ are in $$\{d_{v,i}, d_{v,i}+1, d_{v,i}+2,\dots , d_{v,i}+d_i-1,d_{v,i}+d_i\}$$ for each variable vertex $$v_i\in V$$, and in $$\{d_c,d_c+1,d_c+2,d_c+3\}$$ for every clause vertex $$c_j\in C$$. Furthermore, for every variable vertex $$v_i$$, we have $$c_\ell (v_i)\in \{d_{v,i},d_{v,i}+d_i\}$$, and observe that $$c_\ell (v_i)=d_{v,i}$$ if all edges of $$G'$$ incident to $$v_i$$ are labelled 1, while $$c_\ell {v_i}=d_{v,i}+d_i$$ if all edges of $$G'$$ incident to $$v_i$$ are labelled 2. For every clause vertex $$c_j$$, we have $$c_\ell (c_j)=\{d_c+1\}$$, which corresponds to two edges of $$G'$$ incident to $$c_j$$ labelled 1 and only one edge labelled 2.

We are now ready to show the equivalence between finding a 1-in-3 truth assignment $$\phi$$ of F and finding a proper 2-labelling $$\ell$$ of G such that $$\sigma (\ell )=\mathrm{mE}_2(G)\le |E(G)|+c$$. An edge $$v_ic_j$$ of $$G'$$ labelled 2 (1, respectively) by $$\ell$$ corresponds to variable $$x_i$$ bringing truth value true (false, respectively) to clause $$C_j$$ by $$\phi$$. Also, we know that in $$G'$$, each variable vertex $$v_i$$ is adjacent to $$n\ge 1$$ edges, all having the same label (either 1 or 2). Accordingly, the corresponding variable $$x_i$$ brings, by $$\phi$$, the same truth value to the n clauses of F that contain it. Finally, in $$G'$$, each clause vertex $$c_j$$ is adjacent to two edges labelled 1 and one labelled 2. This corresponds to the clause $$C_j$$ being regarded as satisfied by $$\phi$$ only when it has exactly one true variable.    $$\square$$

### 3.2 Polynomiality for Bounded-Treewidth Graphs

The following theorem is proved by a classical (while non trivial) dynamic programming algorithm on tree-decompositions. Due to lack of space, we only state our main theorem. The full description of the algorithm and of its proof can be found in .

### Theorem 7

Let $$k\ge 2$$ and $$tw \ge 1$$ be two fixed integers. Given a nice graph G with $$|V(G)|=n$$ and an integer s, the problem of deciding whether $$\mathrm{mE}_k(G)\le s$$ can be solved in polynomial time if G has treewidth at most $$tw$$ (and in linear time if G is additionally of bounded maximum degree).

Importantly, the above theorem provides a constructive polynomial-time algorithm to compute $$\mathrm{mE}_k$$ in the class of trees and in the class of odd multi-cacti (an important class in the context of the 1-2-3 Conjecture, that we detail below). Note however that k must be fixed and since, by Theorem 5, the smallest integer k such that $$\mathrm{mE}(T)=\mathrm{mE}_k(T)$$ for every tree T is not bounded, we leave open the question of the complexity of computing $$\mathrm{mE}$$ in the class of trees.

## 4 General Bounds

Recall that $$\mathrm{mE}(G) \le \mathrm{\chi _\Sigma }(G)|E(G)|$$ and $$\mathrm{\chi _\Sigma }(G) \le 5$$ (see ) hold for every nice graph G. Thus $$\mathrm{mE}(G) \le 5 |E(G)|$$ holds for every nice graph G, and even $$\mathrm{mE}(G) \le 4 |E(G)|$$ holds when G is regular . Moreover, for every graph satisfying the 1-2-3 Conjecture, even $$\mathrm{mE}(G) \le 3|E(G)|$$ holds. Throughout this section, we study how tight this bound is, in particular in the bipartite case.

### 4.1 Upper Bounds

Recall that bipartite graphs satisfy the 1-2-3 Conjecture . For $$i \in \{1,2,3\}$$, let $$\mathcal {B}_i$$ be the set of bipartite graphs G with $$\mathrm{\chi _\Sigma }(G)=i$$. In particular, $$\mathcal {B}_1$$ is the set of locally irregular bipartite graphs and the set $$\mathcal {B}_3$$ is that of the so-called odd multi-cacti, which are defined as follows . The set $$\mathcal {B}_3$$ is exactly the set of graphs that can be obtained at any moment of the following procedure:
• Start from a cycle with length at least 6 congruent to 2 modulo 4 whose edges are properly coloured with red and green.

• Repeatedly consider a green edge uv, and join u and v by a path of length at least 5 congruent to 1 modulo 4 whose edges are properly coloured with red and green, where the edge incident to u and that incident to v are red.

### Theorem 8

Every nice bipartite graph G satisfies $$\mathrm{mE}(G) \le \mathrm{mE}_3(G) \le 2|E(G)|$$. Moreover, if $$G \in \mathcal {B}_2$$, then $$\mathrm{mE}(G)<2|E(G)|$$.

### Proof

The statement trivially holds for every $$G\in \mathcal {B}_1$$ since G is locally irregular and so $$\mathrm{mE}(G)=|E(G)|$$. For every $$G \in \mathcal {B}_2$$ (so G is not locally irregular), if we had $$\mathrm{mE}_2(G)=2 |E(G)|$$, then the only proper 2-labelling of G would be the one assigning label 2 to all edges, which can only be proper if G is locally irregular, a contradiction. Therefore, in any proper 2-labelling of G, there must be at least one edge assigned label 1, implying that $$\mathrm{mE}(G)<2|E(G)|$$.

Let us now assume $$G \in \mathcal {B}_3$$, i.e., G is an odd multi-cactus with bipartition (UV) (both |U| and |V| are odd by construction). If G is a cycle with length at least 6 congruent to 2 modulo 4, then the result follows from Theorem 4. Thus, we may assume that the maximum degree $$\Delta (G)$$ of G is at least 3, i.e., some path attachments were made to build G starting from an original cycle.

Let us consider the last green edge xy to which a path $$P=(x,v_1,\dots ,v_{4k},y)$$ was attached in the construction of G, where $$k \ge 1$$. Recall that $$d(x)=d(y) \ge 3$$ by construction. Consider $$G'=G-\{v_1,v_2,v_3\}$$. Assuming $$v_1,v_3 \in U$$ and $$v_2 \in V$$, the bipartition of $$G'$$ is $$(U',V')=(U \setminus \{v_1,v_3\}, V \setminus \{v_2\})$$. This means that $$|V'|$$ is even. It is known that any bipartite graph with one part X of even size belongs to $$\mathcal {B}_2$$ and furthermore admits proper 2-labellings where all vertices of X have odd colour while all vertices of the other part Y have even colour . Therefore, there is a proper 2-labelling $$\ell '$$ of $$G'$$ such that all vertices of $$U'$$ have even colour while all vertices of $$V'$$ have odd colour. Since $$x \in V'$$, the colour $$c_{\ell '}(x)$$ is odd, and thus at least 3 since $$d_{G'}(x) \ge 2$$. Similarly, $$v_4 \in V'$$, so the colour $$c_{\ell '}(v_4)$$ is odd, and it is precisely 1 since $$d_{G'}(v_4)=1$$.

We now extend $$\ell '$$ to a proper 3-labelling $$\ell$$ of G, by assigning label 1 to $$v_1v_2$$, label 2 to $$xv_1$$ and $$v_3v_4$$, and label 3 to $$v_2v_3$$. This way, note that $$c_\ell (x)$$ and $$c_\ell (v_4)$$ remain odd. Also, $$c_\ell (v_1)=3<5\le c_\ell (x)$$, $$c_\ell (v_3)=5>3=c_\ell (v_4)$$ and $$c_\ell (v_2)=4 \not \in \{c_\ell (v_1),c_\ell (v_3)\}=\{3,5\}$$. For these reasons, it should be clear that $$\ell$$ is indeed a proper 3-labelling of G. We additionally note that label 3 is actually assigned only once by $$\ell$$, to $$v_2v_3$$. Furthermore, $$\ell$$ assigns label 1 at least once, e.g. to $$v_1v_2$$. From this, it follows that $$\sigma (\ell ) \le 2 |E(G)|$$.   $$\square$$

Note that the upper bound in Theorem 8 is tight due to $$C_6$$ for which $$\mathrm{mE}(C_6)=12=2|E(C_6)|$$ (recall Theorem 4). However this seems to be a pathological case due to the small size of $$C_6$$. For larger graphs, the next result shows that the upper bound can actually be improved.

### Theorem 9

Let G be a connected bipartite graph with bipartition (UV) where |U| is even. Then, we have $$\mathrm{mE}_2(G) \le |E(G)| + |V(G)| -1$$.

### Proof

Let $$U_e$$ ($$U_o$$, respectively) be the set of vertices of U of even (odd, respectively) degree in G, and $$V_e$$ ($$V_o$$, respectively) be the set of vertices of V of even (odd, respectively) degree in G. Note that either $$|U_e|$$ and $$|V_o|$$ must have the same parity, or $$|U_o|$$ and $$|V_e|$$ must have the same parity. This is because, otherwise, since |U| is even and $$|U|=|U_e|+|U_o|$$, the sizes $$|U_e|$$ and $$|U_o|$$ must have the same parity, we would get that also $$|V_e|$$ and $$|V_o|$$ have the same parity. Then we would deduce that $$\sum _{u \in U} d(u) \not \equiv \sum _{v \in V} d(v) \pmod 2$$, which is not possible.

Without loss of generality, we may assume that $$U_e$$ and $$V_o$$ have the same parity, thus that $$|U_e|+|V_o|$$ is even. Our aim now, is to design a 2-labelling of G that assigns label 2 on as few edges as possible, such that all vertices in U get an odd colour while all vertices in V get an even colour. Such a labelling will obviously be proper. To that aim, we proceed as follows. Let us start with assigning label 1 to all edges of G. This way, at this point the colour of every vertex is exactly its degree; so all vertices in $$U_o$$ and $$V_e$$ verify the desired colour property, while all vertices in $$U_e$$ and $$V_o$$ do not. To fix these vertices, we consider any spanning tree T of G. We now repeatedly apply the following fixing procedure: we consider any two vertices x and y of $$U_e \cup V_o$$ that remain to be fixed, and flip (i.e., turn the 1’s into 2’s, and vice versa) the labels of all edges on the unique path in T from x to y. This way, only the colours of x and y are altered modulo 2. Since $$|U_e|+|V_o|$$ is even, there is an even number of vertices to fix, and, by flipping labels along paths of T, we can fix the colour of all vertices in $$U_e \cup V_o$$. This results in a 2-labelling $$\ell$$ of G, with the desired properties, which is thus proper. Note now that $$\ell$$ assigns label 2 only to a subset of the edges of T. Since T has $$|V(G)|-1$$ edges, the result follows.   $$\square$$

The arguments in the proof of Theorem 9 actually generalise to graphs with larger chromatic number. See  for the proof details.

### Theorem 10

Let G be a connected graph with chromatic number $$k = \chi (G)$$ at least 3. Then, we have $$\mathrm{mE}(G) \le \mathrm{mE}_{2\lfloor \frac{k}{2}\rfloor +1}(G) \le |E(G)|+2 \left\lfloor \frac{k}{2} \right\rfloor |V(G)|$$.

### 4.2 General Conjecture and Refined Bounds for Bipartite Graphs

We are not aware of graphs for which all proper 3-labellings require more than a few edges labelled with 3. In general, it might actually be true that, for all nice graphs, there is a proper 3-labelling with a few 3’s where the number of 1’s is about the number of 2’s. Also, we observed, during experimentation via computer programs, that only small graphs G seem to have their value of $$\mathrm{mE}(G)$$ close to 2|E(G)| (recall that $$K_3$$ and $$C_6$$ are such examples, by Theorems 3 and 4). This leads us to conjecture the following:

### Conjecture 1

There is an absolute constant $$c \ge 1$$ such that, for every nice connected graph G, we have $$\mathrm{mE}(G) \le \frac{3}{2} |E(G)|+c$$.

In the rest of this section, we investigate Conjecture 1 by giving a special focus to bipartite graphs. We exhibit several upper bounds for $$\mathrm{mE}(G)$$ in various subclasses of bipartite graphs. Each of these upper bounds support Conjecture 1. We also exhibit examples of graphs achieving these upper bounds.

Lower Bounds. We first show that it is not possible to lower $$\mathrm{mE}(G)$$ below the $$\frac{3}{2}|E(G)|$$ barrier for general graphs G. This is already illustrated by Theorem 4, which states that $$\mathrm{mE}(C_n)=\frac{3}{2}|E(G)|+3$$ for every $$n \equiv 2 \pmod {4}$$. Note that these cycles $$C_n$$ are such that $$\mathrm{\chi _\Sigma }(C_n)=3$$. The lower bound even holds for bipartite graphs G with $$\mathrm{\chi _\Sigma }(G)=2$$. Indeed, there exist bipartite graphs for which label 2 must be assigned to at least half of the edges by any proper 2-labelling. This is a consequence of the following more general result.

### Theorem 11

There exist infinitely many bipartite graphs $$G \in \mathcal {B}_2$$ with various structure verifying $$\mathrm{mE}_2(G) = \frac{3}{2}|E(G)|$$. This remains true for trees.

Sketch of Proof. Let G be any graph, and let H be a graph obtained from G by subdividing every edge e exactly $$n_e$$ times, where $$n_e=4k_e+3$$ for some $$k_e \ge 0$$. Then $$\mathrm{\chi _\Sigma }(H)=2$$. Furthermore, $$\mathrm{mE}_2(H)=\frac{3}{2}|E(H)|$$.

Through our experimentation, we also managed to come up with the following class of bipartite graphs G for which $$\mathrm{mE}_2(G)$$ slightly exceeds $$\frac{3}{2}|E(G)|$$.

### Theorem 12

Let $$x,y \ge 4$$ be any two integers congruent to 0 modulo 4, and let H be the graph obtained by adding an edge joining any vertex of a cycle of length x and any vertex of a cycle of length y. Then, we have $$\mathrm{mE}_2(H)=\left\lceil \frac{3}{2} |E(H)|\right\rceil$$.

Improved Upper Bounds. It is worth pointing out that a proper 2-labelling $$\ell$$ of a graph G where $$\sigma (\ell )$$ is about $$\frac{3}{2} |E(G)|$$ is actually a 2-labelling where the number of assigned 1’s is about the same as the number of assigned 2’s. Thus, Conjecture 1 relates to equitable proper labellings of graphs, introduced in , which are proper labellings where, for every two assigned labels ij, the number of edges assigned label i differs by at most 1 from the number of edges assigned label j. Regarding Conjecture 1, observe that $$\mathrm{mE}_2(G) \le \frac{3}{2} |E(G)|+1$$ holds for every graph G admitting an equitable proper 2-labelling.

The authors in  proved that nice forests admit equitable proper 2-labellings. This directly implies Theorem 13 below for trees with even size, while it does not for trees with odd size (as a 2-labelling where the number of assigned 2’s is one more than the number of assigned 1’s does not fulfill our claim), for which we need a dedicated proof. Recall that this result is optimal due to Theorem 11.

### Theorem 13

For every nice tree T, we have $$\mathrm{mE}_2(T) \le \frac{3}{2} |E(T)|$$.

Sketch of Proof. The proof is by induction on the number k of branching vertices (i.e., vertices with degree at least 3) of T. Observe that, for a path $$P=(v_1,\dots ,v_n)$$ where $$v_2,\dots ,v_{n-1}$$ have degree 2, two inner vertices cannot be involved in a colour conflict by a 2-labelling assigning consecutive labels 1, 2, 2,  $$1,1,\dots$$ (a path labelled in this fashion is called a 1-extension) or $$2,1,1,2,2,\dots$$ (called a 2-extension) to the edges of P. Note also that 1-extensions and 2-extensions comply with equitability, as the numbers of 1’s and 2’s assigned to the edges of P differ by at most 1.

When $$k=0$$, i.e., T is a path, the claim is proved by performing a 1-extension or a 2-extension from a degree-1 vertex to the other so that more 1’s than 2’s are assigned. For larger values of k, the claim is proved by rooting T at some degree-1 vertex r, considering a branching vertex v at largest distance from r, and removing all pendant paths attached to v, resulting in a tree $$T'$$. This tree $$T'$$ can be assumed to be nice (as otherwise there would be a better choice for r), and it thus admits, by induction, a proper 2-labelling assigning more 1’s than 2’s. It can then be proved that this labelling can be extended, by performing 1-extensions and 2-extensions, to the paths attached to v, resulting in a proper 2-labelling of T where more 1’s than 2’s are assigned.

Towards Conjecture 1, refined bounds can be deduced in particular contexts. For instance, any graph G satisfies $$|E(G)|+|V(G)|-1 \le \frac{3}{2} |E(G)|$$ as soon as $$|E(G)| \ge 2 |V(G)|-2$$. As a consequence, Theorem 9 implies that a bipartite graph $$G \in \mathcal {B}_2$$ with a part of even size verifies $$\mathrm{mE}_2(G) \le \frac{3}{2} |E(G)|$$ as soon as G has minimum degree at least 4, or more generally when G is dense enough. The same holds for Hamiltonian bipartite graphs with a part of even size.

### Lemma 1

Let G be a Hamiltonian bipartite graph with bipartition (UV) where |U| is even. Then $$\mathrm{mE}(G) \le \mathrm{mE}_2(G) \le \frac{3}{2} |E(G)|$$.

### Proof

Just mimic the proof of Theorem 9, but repair pairs of defective vertices of G along a Hamiltonian cycle $$C=(v_0, \dots , v_{n-1},v_0)$$, matching each of them, say, with the next defective vertex in the ordering of C. If this fixing process turns more than half of the labels to 2, then, instead, repair pairs of vertices around C matching each of them with the previous defective vertex in the ordering (which is equivalent to flipping the labels along C).   $$\square$$

The same result holds when G is bipartite and cubic (in which case $$\mathrm{\chi _\Sigma }(G)=2$$ since $$G \in \mathcal {B}_2$$, by definition of odd multi-cacti), by a more general argument:

### Lemma 2

Let G be a regular graph with $$\mathrm{\chi _\Sigma }(G)=2$$. Then $$\mathrm{mE}_2(G) \le \frac{3}{2} |E(G)|$$.

### Proof

Let $$\ell$$ be a proper 2-labelling of G. Since G is regular, the edges labelled 1 by $$\ell$$, and similarly the edges labelled 2, must induce a locally irregular subgraph of G. Then the 2-labelling $$\ell '$$ of G obtained by turning all 1’s into 2’s, and vice versa, is also proper. Now there is one of $$\ell$$ and $$\ell '$$ that assigns label 2 to at most half of the edges, and the conclusion follows.   $$\square$$

## 5 Conclusion

We have here studied the algorithmic complexity and bounds for the parameter $$\mathrm{mE}$$. The main question we leave open is Conjecture 1 asking whether $$\mathrm{mE}(G)\le \frac{3}{2}|E(G)| + \mathcal {O}(1)$$ holds for every nice connected graph G. We think that the proof of Theorem 9 could be improved to prove the conjecture for bipartite graphs.

Regarding our algorithmic results in Sect. 3, note that they all deal, for a given graph G, with the parameter $$\mathrm{mE}_k(G)$$ (for some k), and not with the more general parameter $$\mathrm{mE}(G)$$. This is mainly because, as indicated by Theorem 5, in general there is no absolute constant that bounds, for all graphs G, the smallest k such that $$\mathrm{mE}(G)=\mathrm{mE}_k(G)$$. In particular, even for a graph G of bounded treewidth, although we can determine $$\mathrm{mE}_k(G)$$ in polynomial time for any fixed k (due to our algorithm in Theorem 7), running enough iterations of our algorithm to determine $$\mathrm{mE}(G)$$ is not feasible in polynomial time. Thus, the question of determining the complexity of $$\mathrm{mE}(G)$$ is left open, even when G is a tree.

## References

1. 1.
Baudon, O., Bensmail, J., Hocquard, H., Senhaji, M., Sopena, E.: Edge weights and vertex colours: minimizing sum count. Discrete Appl. Math. 270, 13–24 (2019)
2. 2.
Baudon, O., Pilśniak, M., Przybyło, J., Senhaji, M., Sopena, E., Woźniak, M.: Equitable neighbour-sum-distinguishing edge and total colourings. Discrete Appl. Math. 222, 40–53 (2017)
3. 3.
Bensmail, J., Fioravantes, F., Nisse, N.: On proper labellings of graphs with minimum label sum. Research report (2020). https://hal.archives-ouvertes.fr/hal-02450521
4. 4.
Bensmail, J., Li, B., Li, B., Nisse, N.: On minimizing the maximum color for the 1-2-3 conjecture. Research report (2019). https://hal.archives-ouvertes.fr/hal-02330418
5. 5.
Chang, G., Lu, C., Wu, J., Yu, Q.: Vertex-coloring edge-weightings of graphs. Taiwanese J. Math. 15, 1807–1813 (2011)
6. 6.
Chartrand, G., Erdős, P., Oellermann, O.: How to define an irregular graph. Coll. Math. J. 19, 36–42 (1998)
7. 7.
Diestel, R.: Graph Theory. Graduate Texts in Mathematics, vol. 173, 4th edn. Springer, Heidelberg (2012)
8. 8.
Dudek, A., Wajc, D.: On the complexity of vertex-coloring edge-weightings. Discrete Math. Theoret. Comput. Sci. 13, 45–50 (2011)
9. 9.
Kalkowski, M., Karoński, M., Pfender, F.: Vertex-coloring edge-weightings: towards the 1-2-3-conjecture. J. Comb. Theory Ser. B 100(3), 347–349 (2010)
10. 10.
Karoński, M., Łuczak, T., Thomason, A.: Edge weights and vertex colours. J. Comb. Theory Ser. B 91(1), 151–157 (2004)
11. 11.
Mulzer, W., Rote, G.: Minimum-weight triangulation is NP-hard. J. ACM 55(2), 11:1–11:29 (2008)
12. 12.
Przybyło, J.: The 1-2-3 conjecture almost holds for regular graphs (2018)Google Scholar
13. 13.
Thomassen, C., Wu, Y., Zhang, C.Q.: The 3-flow conjecture, factors modulo $$k$$, and the 1-2-3-conjecture. J. Comb. Theory Ser. B 121, 308–325 (2016)