Полезное:
Как сделать разговор полезным и приятным
Как сделать объемную звезду своими руками
Как сделать то, что делать не хочется?
Как сделать погремушку
Как сделать так чтобы женщины сами знакомились с вами
Как сделать идею коммерческой
Как сделать хорошую растяжку ног?
Как сделать наш разум здоровым?
Как сделать, чтобы люди обманывали меньше
Вопрос 4. Как сделать так, чтобы вас уважали и ценили?
Как сделать лучше себе и другим людям
Как сделать свидание интересным?
Категории:
АрхитектураАстрономияБиологияГеографияГеологияИнформатикаИскусствоИсторияКулинарияКультураМаркетингМатематикаМедицинаМенеджментОхрана трудаПравоПроизводствоПсихологияРелигияСоциологияСпортТехникаФизикаФилософияХимияЭкологияЭкономикаЭлектроника
|
Greedy graph coloring algorithm 8.9Input: Undirected graph G = <V, E>. Output: Graph G in which every vertex vi ÎV gets its color(vi) so that: - color(vi) Î {1, 2, …, max}, max ³ c(G); - if vi and vj are adjacent then color(vi) ¹ color(vj).
Let us trace Algorithm 8.9on the input graph G1. After execution of this algorithm, we can conclude that c(G1) £ 4. Also we can see that c(G1) ³ 3 because there are cycles of odd length, for example, {M,G}, {G,K}, {K,M}. What is the exact minimum number of colors (3 or 4) required by G1? Agorithm 8.9 does not give a precise answer for this question. The same is true for any other graph coloring algorithm designed so far. If we slightly deviate from the greedy strategy of Algorithm we can get a better variant of assigning colors to vertices of G1. Vertices of G1 are correctly colored by 3 colors. So c(G1) £ 3. The presence of cycles of odd length prompts: c(G1) ³ 3. From here it follows c(G1) = 3. For many graphs, the above greedy algorithm finds the upper bound for the chromatic number which is equal to this number. But it cannot be guaranteed.
|