# A Hajós-like theorem for weighted coloring

- J. Araujo
^{1}Email author and - C. Linhares Sales
^{2}

**19**:98

https://doi.org/10.1007/s13173-012-0098-y

© The Brazilian Computer Society 2013

**Received: **18 September 2012

**Accepted: **21 December 2012

**Published: **11 January 2013

## Abstract

The Hajós’ Theorem (Wiss Z Martin Luther Univ Math-Natur Reihe, 10, pp 116–117, 1961) shows a necessary and sufficient condition for the chromatic number of a given graph \(G\) to be at least \(k\): \(G\) must contain a \(k\)-constructible subgraph. A graph is \(k\)-constructible if it can be obtained from a complete graph of order \(k\) by successively applying a set of well-defined operations. Given a vertex-weighted graph \(G\) and a (proper) \(r\)-coloring \(c=\{C_1, \ldots , C_r\}\) of \(G\), the weight of a color class \(C_i\) is the maximum weight of a vertex colored \(i\) and the weight of \(c\) is the sum of the weights of its color classes. The objective of the Weighted Coloring Problem [7] is, given a vertex-weighted graph \(G\), to determine the minimum weight of a proper coloring of \(G\), that is, its weighted chromatic number. In this article, we prove that the Weighted Coloring Problem admits a version of the Hajós’ Theorem and so we show a necessary and sufficient condition for the weighted chromatic number of a vertex-weighted graph \(G\) to be at least \(k\), for any positive real \(k\).

### Keywords

Graph coloring Hajós’ theorem Weighted coloring Max coloring## 1 Introduction

For the terms not defined here the reader can be referred to [2].

Given a graph \(G = (V, E)\), a \(k\)-coloring \(c\) of \(G\) is an assignment of colors to the vertices of \(G\), \(c: V(G) \rightarrow \{1,\ldots ,k\}\), such that if \((u,v)\in E\), then \(c(u)\ne c(v)\). The chromatic number of a graph \(G\), \(\chi (G)\), is the smallest integer \(k\) such that \(G\) admits a \(k\)-coloring.

The Vertex Coloring Problem consists in, for a given a graph \(G\), determining \(\chi (G)\). It is a well known fact that it is a NP-hard problem [11].

The characterization of the \(k\)-chromatic graphs, i.e., graphs \(G\) such that \(\chi (G)=k\), has been a challenging problem for many years. In 1961, Hajós [8] gave a characterization of graphs with chromatic number of value at least \(k\) by proving that they must contain a \(k\)-constructible subgraph. In order to present this characterization, we need to recall some definitions. The *identification* of two vertices \(a\) and \(b\) of a graph \(G\) means the removal of \(a\) and \(b\) followed by the inclusion of a new vertex \(a \circ b\) adjacent to each vertex in \(N_G(a) \cup N_G(b)\), where \(N_G(x)\) is the set of neighbors of a vertex \(x\) in a graph \(G\). A graph \(G=(V,E)\) is *complete* if it is simple and for every pair of vertices \(u,v\) of \(G\), \(uv \in E(G)\). We denote by \(K_n\) the complete graph with \(n\) vertices.

###
**Definition 1.1**

- 1.
The complete graph on \(k\) vertices is \(k\)-constructible.

- 2.
**Hajós’ Sum:**If \(G_1\) and \(G_2\) are disjoint graphs which are \(k\)-constructible, \((a_1,b_1)\) is an edge of \(G_1\) and \((a_2,b_2)\) is an edge of \(G_2\), then the graph \(G\) obtained from \(G_1\cup G_2\) by removing \((a_1,b_1)\) and \((a_2,b_2)\), identifying \(a_1\) with \(a_2\), and adding an edge between \((b_1,b_2)\), is a \(k\)-constructible graph (see Fig. 1). - 3.
**Identification:**If \(G\) is \(k\)-constructible and \(a\) and \(b\) are two non-adjacent vertices of \(G\), then the graph obtained by the identification of \(a\) and \(b\) is a \(k\)-constructible graph.

###
**Theorem 1.1**

(Hajós [8]) \(\chi (G)\ge k\) if and only if \(G\) is a supergraph of a \(k\)-constructible graph.

The Hajós’ Theorem determines a set of operations that we can use to obtain, from a complete graph with \(k\) vertices, all \(k\)-chromatic graphs, including the \(k\)-critical ones. A graph \(H\) is \(k\)-critical if \(\chi (H) \ge k\) and for every proper subgraph \(I\) of \(H\), \(\chi (I) < k\). Clearly, for a given graph \(G\), the difficulty of determining whether \(\chi (G)\ge k\) is equivalent to the difficulty of determining if \(G\) contains a \(k\)-critical subgraph \(H\). Thanks to the Hajós’ Theorem, we know that all the \(k\)-critical graphs can be built from complete graphs on \(k\) vertices by successive applications of Hajós Sum and Identification of vertices. Because of this, it has been subject of interest to obtain the Hajós-like theorems for several variations of the classical coloring problem. Gravier [6] proved an extension of Hajós’ Theorem for List Coloring. Král [12] gave a simplified proof of Gravier’s result. Zhu [17] found an extension of this theorem for the chromatic circular number. Mohar [14] demonstrated two new versions of the referred theorem for chromatic circular number and an extension of Hajós’ Theorem for the channel assignment problem, i.e., a coloring of edge-weighted graphs.

In this paper, we are interested in a variation of the classical Vertex Coloring Problem, which is called the Weighted Coloring Problem. In order to present it, we need some definitions.

*weight of a color class*\(C_i\) in the coloring \(c\) is the maximum weight of a vertex in this color class. Moreover, the

*weight of a*\(k\)

*-coloring*\(c\), denoted by \(w(c)\), is the sum of the weights of its color classes. The Weighted Coloring Problem [7] consists in, for a given graph \(G\) with non-negatives real weights associated to its vertices, determining the minimum weight of a proper coloring of \(G\), that is, the

*weighted chromatic number*of \(G\), denoted by \(\chi _w(G)\):

The complexity of this problem was already studied in some previous works. It was shown that the weighted chromatic number of a graph \(G\) can be calculated in polynomial-time whenever \(G\) is a bipartite graph with only two different weights associated to its vertices [4], or \(G\) is a \(P_5\)-free bipartite graph [3], or \(G\) belongs to a subclass of \(P_4\)-sparse graphs that properly contains the cographs [1].

On the other hand, it was proved that the decision version of Weighted Coloring is \(NP\)-complete for bipartite graphs [4], split graphs [4], planar graphs [3], interval graphs [5] and others graph classes.

In the next section, we show an extension of Hajós’ Theorem for Weighted Coloring.

## 2 Hajós’ theorem for weighted coloring

In this section, we deal with simple (vertex-)weighted graphs. We denote by \(G=(V,E,w)\) a vertex-weighted graph \(G = (V,E)\) together with its function weight \(w: V \rightarrow \mathbb R ^+\).

###
**Notation 2.1**

The infinity family of complete weighted graphs \(G=(V,E,w)\) with order \(n = |V(G)|\) and such that \(\sum _{v\in V} w(v) = k\) is denoted by \(\mathcal K ^k_n\).

###
**Notation 2.2**

Given a weighted graph \(G=(V,E,w)\) and a proper coloring \(c\) of \(G\), we choose as the **representative** of the color \(i\) in \(c\), \(rep_c(i)\), a unique vertex \(v \in V\) satisfying the inequality \(w(v)\ge w(x)\), for all \(x\in V\) such that \(c(x)\ =\ c(v) =i\).

###
**Definition 2.1**

Given weighted graphs \(G=(V,E,w)\) and \(H=(V^{\prime },E^{\prime }, w^{\prime })\), we say that \(H\subseteq G\) (\(H\) is a *weighted subgraph* of \(G\)) if \(V^{\prime }\subseteq V\), \(E^{\prime }\subseteq E\), and, for all \(v\in V^{\prime }\), we have \(w^{\prime }(v)\ \le \ w(v)\).

Now, we redefine the Hajós’ construction to the weighted case:

###
**Definition 2.2**

*weighted*\(k\)-constructible graphs are defined recursively as follows:

- 1.
The graphs in \(\bigcup _{i\in \mathbb N } \mathcal K ^k_i\) are weighted \(k\)-constructible.

- 2.
**Weighted Hajós’ Sum:**If \(G_1\) and \(G_2\) are disjoint weighted \(k\)-constructible graphs, \((a_1,b_1)\) is an edge of \(G_1\) and \((a_2,b_2)\) is an edge of \(G_2\), then the graph \(G\) obtained from \(G_1\cup G_2\) by removing \((a_1,b_1)\) and \((a_2,b_2)\), identifying \(a_1\) with \(a_2\) into a vertex \(a_1 \circ a_2\), doing \(w(a_1 \circ a_2) = \) max \(\{w(a_1),w(a_2)\}\), and adding the edge \((b_1,b_2)\) is a weighted \(k\)-constructible graph. - 3.
**Weighted Identification:**If \(a\) and \(b\) are two non-adjacent vertices of a weighted \(k\)-constructible \(G\), then the graph that we obtain by the identification of two vertices \(a\) and \(b\) into a vertex \(a \circ b\), doing \(w(a \circ b) =\) max\(\{w(a),w(b)\}\), is a weighted \(k\)-constructible graph.

###
**Theorem 2.1**

Let \(G=(V,E,w)\) be a weighted graph and \(k\) be a positive real. Therefore, \(\chi _w(G) \ge k\) if and only if \(G\) has a weighted \(k\)-constructible weighted subgraph \(H\).

###
*Proof*

In order to simplify the notation, whenever we refer to *subgraph* in this proof, we mean *weighted subgraph*, as in Definition 2.1.

We prove first that if \(\chi _w(G)\ge k\), then \(G\) has a weighted \(k\)-constructible subgraph \(H\). Suppose, by contradiction, that this statement is false and consider as a counter-example a graph \(G = (V, E, w)\) which is maximal with respect to its number of edges. It means that \(\chi _w(G)\ge k\) and \(G\) does not contain any weighted \(k\)-constructible subgraphs and for any pair of non-adjacent vertices of \(G\), let us say \(u,v\), \(G^{\prime }=G + uv\) contains a weighted \(k\)-constructible subgraph.

We claim that \(G\) is not isomorphic to a complete multipartite graph. Suppose the contrary and let \(p\) be the number of stable sets in the partition \(\mathcal P \) of \(V(G)\). For each color class \(C_i\), of an optimal weighted coloring \(c\) of \(G\), there is no pair of vertices of \(C_i\) in distinct sets of \(\mathcal P \), since there is an edge between any two vertices of distinct parts.

Moreover, we cannot have more than one color class in one stable set. As a matter of fact, suppose by contradiction that there are two color classes, say \(C_i\) and \(C_j\), whose vertices belong to the same stable set in the partition \(\mathcal P \) of \(V(G)\). Without loss of generality, suppose that \(w(rep_c(i)) \ge w(rep_c(j))\). Then a coloring \(c^{\prime }\), obtained from \(c\) by the union of the color classes \(C_i\) and \(C_j\), has cost exactly \(\chi _w(G) - w(rep_c(j))\), and this contradicts the optimality of \(c\).

Consequently, the vertices with the greatest weight in every part are exactly the representatives of each color class. Observe that the subgraph induced by the representatives is an element of the set \(\mathcal K _p^k\), because \(\chi _w(G)\ge k\) and \(p\in \mathbb N \). This contradicts the hypothesis that \(G\) has no weighted \(k\)-constructible subgraph.

Therefore, the counter-example \(G\) is not a complete multipartite graph. Thus, there are at least three vertices in \(G\), let us say \(a\), \(b\) and \(c\), such that \(ab, bc \notin E(G)\) and \(ac\in E(G)\). Consider now the graphs \(G_1 = G + ab\) and \(G_2 = G + bc\). Because of the maximality of \(G\), \(G_1\) and \(G_2\) have, respectively, weighted \(k\)-constructible subgraphs \(H_1\) and \(H_2\). Obviously, the edges \(ab\) and \(bc\) belong, respectively, to \(H_1\) and \(H_2\). Consider then the application of Hajós Sum in two disjoint graphs isomorphic to \(H_1\) and \(H_2\), respectively. Let us choose edge \(ab\) of \(H_1\) and \(bc\) of \(H_2\) to remove and let us identify the vertices labeled \(b\). Finally, identify all the vertices in \(H_1\) with their correspondent vertices in \(H_2\), if they exist. Observe that a graph isomorphic to a subgraph of \(G\) is obtained at the end of this sequence of operations. Then, \(G\) has a weighted \(k\)-constructible subgraph, a contradiction.

Conversely, we prove now that, if \(G\) has a weighted \(k\)-constructible subgraph \(H\), then \(\chi _w(G)\ge k\). First, observe that \(\chi _w(G)\ge \chi _w(H)\). Then, we just have to show that \(\chi _w(H)\ge k\). The proof is by induction on the number of Hajós’ operations applied to obtain \(H\).

If \(H\) is isomorphic to a graph \(K^k_i \in \mathcal K ^k_i\), for some \(i\in \mathbb N \), then its weighted chromatic number is trivially \(k\), since it is a complete graph whose sum of weights is equal to \(k\).

Suppose then that \(H\) was obtained by the Weighted Identification of two non-adjacent vertices \(a\) and \(b\) of a weighted \(k\)-constructible graph \(H^{\prime }\) into a vertex \(a \circ b\). By the induction hypothesis, \(H^{\prime }\) has a weighted chromatic number of value at least \(k\). Suppose, by contradiction, that \(\chi _w(H) < k\) and let \(c\) be an optimal weighted coloring of \(H\). Then, a coloring \(c^{\prime }\) of \(H^{\prime }\) can be obtained from \(c\), by assigning to \(a\) and \(b\) the color assigned to \(a \circ b\) in \(c\), and letting all the other vertices of \(H^{\prime }\) be assigned to the same color they have been assigned in \(c\). Observe that, except for the color \(i\) of \(a \circ b\), for all the other colors \(j\), \(rep_{c^{\prime }}(j) = rep_c(j)\). For the color \(i\), the vertex \(rep_c(i)\) has weight greater than or equal to the weight of \(a \circ b\), that is greater than or equal to the weight of \(a\) and \(b\). Therefore, the coloring \(c^{\prime }\) has weight equal to the coloring \(c\), that is less than \(k\). This contradicts the hypothesis of \(\chi _w(H^{\prime })\ge k\).

Finally, suppose that \(H\) was obtained from weighted \(k\)-constructible graphs \(H_1\) and \(H_2\) using the Weighted Hajós’ Sum on the edges \((a_1,b_1)\) and \((a_2,b_2)\) from \(H_1\) and \(H_2\), respectively. Let \(a_1 \circ a_2\) be the vertex of \(H\) obtained by the identification of \(a_1\) e \(a_2\). Suppose, by contradiction, that \(\chi (H) < k\), while \(\chi (H_1) \ge k\) and \(\chi (H_2) \ge k\). Consider an optimal weighted coloring \(c\) of \(H\). Observe that either \(c(a_1 \circ a_2)\ne c(b_1)\) or \(c(a_1 \circ a_2)\ne c(b_2)\) (because \(b_1\) and \(b_2\) are adjacent). Without loss of generality, suppose that \(c(a_1 \circ a_2)\ne c(b_1)\). Then, consider now the restriction \(c^{\prime }\) of \(c\) to \(H_1\), assigning to \(a_1\) the color of \(a_1 \circ a_2\). We have that, for every color class \(C_j\) of \(c^{\prime }\), the weight of \(rep_{c^{\prime }}(j) \le rep_c(j)\) (including the color class of \(a_1\), because the weight of \(a_1\) is less than or equal to the weight of \(a_1 \circ a_2\)). Consequently, \(w(c^{\prime }) \le w(c) < k\), contradicting the hypothesis that \(\chi _w(H_1) \ge k\). \(\square \)

## 3 Conclusions

Ore [15] has proved that the Hajós construction can be simplified. He has shown that by using only one operation that collapses the two Hajós operations, one may construct any \(k\)-colorable graph from complete graphs of order \(k\).

It is not difficult to see that the same simplification can be done for the weighted case. It is just necessary use of the same adaptation we did whenever two vertices \(u\) and \(v\) are identified, i.e., the weight of the new vertex must be the maximum value between the weight of \(u\) and the weight of \(v\).

Moreover, by extending the ideas of Urquhart [16] for the non-weighted case, it is also not hard to establish the equivalence between the class of the weighted \(k\)-constructible graphs and the class obtained by using the adapted Ore’s operation described above.

Finally, there is a well known problem that is to study the complexity of the construction of \(k\)-chromatic graphs of a given size by Hajós operations [9, 10, 13]. Since the Vertex Coloring Problem is a particular case of Weighted Coloring, it is obvious that the complexity of this problem in the weighted case is as hard as in the non-weighted one and can also be left as open question.

## Notes

## Authors’ Affiliations

## References

- Araujo J, Linhares Sales C, Sau I (2010) Weighted coloring on $$p_4$$ -sparse graphs. In: 11es Journées Doctorales en Informatique et Réseaux (Sophia Antipolis, Mar 2010)Google Scholar
- Bondy JA, Murty USR (2008) Graph theory. Graduate texts in mathematics. Springer, BerlinGoogle Scholar
- de Werra D, Demange M, Escoffier B, Monnot J, Paschos VT (2005) Weighted coloring on planar, bipartite and split graphs: complexity and improved approximation. Lect Notes Comput Sci 3341:896–907Google Scholar
- Demange M, de Werra D, Monnot J, Paschos VT (2002) Weighted node coloring: when stable sets are expensive. Lect Notes Comput Sci 2573:114–125View ArticleGoogle Scholar
- Escoffier B, Monnot J, Paschos VT (2006) Weighted coloring: futher complexity and approximability results. Inf Process Lett 97:98–103MATHMathSciNetView ArticleGoogle Scholar
- Gravier S (1996) A Hajós-like theorem for list coloring. Discret Math 152:299–302Google Scholar
- Guan D, Zhu X (1997) A coloring problem for weighted graphs. Inf Process Lett 61:77–81MathSciNetView ArticleGoogle Scholar
- Hajós G (1961) Uber eine konstruktion nicht n-farbbarer graphen. Wiss Z Martin Luther Univ Math-Natur Reihe 10:116–117Google Scholar
- Hanson D, Robinson GC, Toft B (1986) Remarks on the graph colour theorem of Hajós. Cong Numer 55:69–76Google Scholar
- Jensen TR, Toft B (1995) Graph coloring problems. Wiley-Interscience, New YorkMATHGoogle Scholar
- Karp RM (1972) Reducibility among combinatorial problems. In: Miller RE, Thatcher JW (eds) Complexity of computer computations. Plenum, New York, pp 85–104Google Scholar
- Kral D (2004) Hajós’ theorem for list coloring. Discrete Math 287:161–163MATHMathSciNetView ArticleGoogle Scholar
- Mansfield A, Welsh D (1982) Some colouring problems and their complexity. In: Bollobás B (ed) Graph theory, proceedings of the conference on graph theory, vol 62 of North-Holland mathematics studies. North-Holland, pp 159–170Google Scholar
- Mohar B (2005) Hajós’ theorem for colorings of edge-weighted graphs. Combinatorica 25:65–76MATHMathSciNetView ArticleGoogle Scholar
- Ore O (1967) The four color problem. Academic Press, New YorkMATHGoogle Scholar
- Urquhart A (1997) The graph constructions of Hajós and Ore. J Graph Theory 26:211–215MATHMathSciNetView ArticleGoogle Scholar
- Zhu X (2003) An analogue of Hajós’ theorem for the circular chromatic number (ii). Graphs Comb 19:419–432MATHView ArticleGoogle Scholar