We generalize the concept of a 2-coloring of a graph to what we call a semi-balanced coloring by relaxing a certain discrepancy condition on the shortest-paths hypergraph of the graph. Let G be an undirected, unweighted, connected graph with n vertices and m edges. We prove that the number of different semi-balanced colorings of G is: (1) at most n + 1 if G is bipartite; (2) at most m if G is non-bipartite and triangle-free; and (3) at most m + 1 if G is non-bipartite. Based on the above combinatorial investigation, we design an algorithm to enumerate all semi-balanced colorings of G in O(nm2) time.
ASJC Scopus subject areas
- Discrete Mathematics and Combinatorics