mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
Update backtracking/coloring.py
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
9da28b0ccc
commit
42c32e7c4e
|
@ -125,7 +125,7 @@ def util_color(
|
||||||
|
|
||||||
def color(graph: list[list[int]], max_colors: int) -> list[int]:
|
def color(graph: list[list[int]], max_colors: int) -> list[int]:
|
||||||
"""
|
"""
|
||||||
Attempts to color the graph with at most max_colors colors such that no two adjacent
|
Attempt to color the graph with at most max_colors colors such that no two adjacent
|
||||||
vertices have the same color.
|
vertices have the same color.
|
||||||
If it is possible, returns the list of color assignments;
|
If it is possible, returns the list of color assignments;
|
||||||
otherwise, returns an empty list.
|
otherwise, returns an empty list.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user